mv

From NetBSD Wiki

Jump to: navigation, search

mv -- move files

In its first form, the mv(1) utility renames the file named by the source operand to the destination path named by the target operand. This form is assumed when the last operand does not name an already existing directory.

In its second form, mv moves each file named by a source operand to a destination file in the existing directory named by the directory operand. The destination path for each operand is the pathname produced by the concatenation of the last operand, a slash, and the final pathname component of the named file.

Contents

Renaming files

% pwd
/home/john/WeirdAlYankovic
% ls -l 
total 9284
drwxr-xr-x  2 john  users      512 Jun 23 15:40 music
-rw-r-----  1 john  users  4723254 Jun 23 04:10 yourepitiful.mp3

% mv yourepitiful.mp3 yourebeautiful.mp3
% mv music mp3s

% ls -l
total 9284
drwxr-xr-x  2 john  users      512 Jun 23 15:40 mp3s
-rw-r-----  1 john  users  4723254 Jun 23 04:10 yourebeautiful.mp3

Moving files

% mv yourebeautiful.mp3 mp3s
% ls -l
total 4
drwxr-xr-x  2 john  users  512 Jun 23 15:45 mp3s

See also

View source code (Please report any bugs or suggestions here).

Retrieved from "http://wiki.netbsd.se/mv"
Personal tools