2010年8月8日星期日

linux mv command: move a file or rename

Basic operation for:
mv command to rename a file or directory, or file into another location.

Syntax:

mv [-if] the source file target file # file rename
mv [-if] file ... directory # the file (one or more) moved to the specified directory

Options description:
-I: If the specified directory has the same title, is first asked to overwrite the old file;
-F: the mv operation to cover an existing target file does not give any instructions;

Implementation of the example:

view sourceprint? 1 $ mv text.txt text.log # files will be renamed as text.log text.txt

2 $ mv text.log yesterday.log logs # will text.log and yesterday.log into the logs directory

3 $ mv info / logs # the info into the logs directory directory. Note that if the logs directory does not exist, then the command info renamed logs.

#After No. Description.

没有评论:

发表评论