2018-11-09 11:47:59 +00:00
|
|
|
---
|
|
|
|
layout: page
|
2018-11-10 21:05:37 +00:00
|
|
|
category-page: fs
|
|
|
|
category-title: FileSystem
|
|
|
|
tags: directory list move rename
|
2018-11-09 11:47:59 +00:00
|
|
|
author: Mattia Hijman
|
|
|
|
title: mv
|
2018-11-18 20:38:56 +00:00
|
|
|
previous-page: pages/fs/mkdir.html
|
|
|
|
next-page: pages/fs/pwd.html
|
2018-11-09 11:47:59 +00:00
|
|
|
---
|
2018-11-16 12:47:48 +00:00
|
|
|
|
|
|
|
<!-- Co-authored with Joy Albertini -->
|
|
|
|
|
2018-11-12 10:47:50 +00:00
|
|
|
The <code>mv</code> command is used to move a file from a given path to another.
|
|
|
|
It can also be used to rename a file by moving it into the same directory,
|
|
|
|
but with a different name.<br>
|
2018-11-10 21:05:37 +00:00
|
|
|
It stands for <i>MoVe</i>.
|
2018-11-09 11:47:59 +00:00
|
|
|
|
2018-11-10 21:05:37 +00:00
|
|
|
<pre>
|
|
|
|
mv [-finv] source target
|
|
|
|
</pre>
|
2018-11-09 11:47:59 +00:00
|
|
|
|
2018-11-12 10:47:50 +00:00
|
|
|
<h3>Flags</h3>
|
2018-11-09 11:47:59 +00:00
|
|
|
|
|
|
|
<ul>
|
2018-11-16 12:47:48 +00:00
|
|
|
<li> <b>-f</b>: Force overwriting file(s) without asking a confirmation.</li>
|
|
|
|
<li> <b>-i</b>: Request confirmation before overwriting the file(s).</li>
|
|
|
|
<li> <b>-n</b>: Don't allow to overwrite existing file(s).</li>
|
2018-11-10 21:05:37 +00:00
|
|
|
<li> <b>-v</b>: Cause mv to be verbose, showing files after they are moved.</li>
|
2018-11-09 11:47:59 +00:00
|
|
|
</ul>
|