MV Command Summary

Source: Internet
Author: User

MV: Move or rename files. Common parameters:-F, default.

[[EMAIL PROTECTED] ~]# MAN MVMV (1)                               User Commands                            MV (1) NAME        mv - move  (rename)  filesSYNOPSIS        mv [option]... [-t] source dest       mv  [option]... source... directory       mv [option] ...  -t directory source ... Description       rename source to dest, or move  source (s)  to directory.       mandatory arguments to long options are mandatory for short options too.        --backup[=CONTROL]               make a backup of each existing destination  File       -b     like --backup but  does not accept an argument       -f, -- force              do not  prompt before overwriting       -i, --interactive               prompt before  overwrite       -n, --no-clobber               d o not overwrite an existing file       if  You specify more than one of -i, -f, -n, only the final  one takes effect.       --strip-trailing-slashes               remove any trailing  slashes from each SOURCE argument       -S,  --suffix=suffix              override  the usual backup suffix       -t, -- target-directory=directory               Move all source arguments into directory       -t,  --no-target-directory &nBsp;            treat dest as a  normal file       -u, --update               move  only when the  Source file is newer than the destination file or when the  destination file is miss-               ing       -v, --verbose               explain what is being  done       --help display this help and exit        --version               output versioN information and exit       the backup suffix  is  ' ~ ', unless set with --suffix or simple_backup_suffix.   the version control method may  be        selected via the --backup option or through the version_control  environment variable.  here are the values:        none, off              never  make backups  (Even if --backup is given)         numbered, t               make numbered backups       existing, nil               numbered if numbered backups exist, simple  otherwise       simple, never               always make simple backups


1. Default parameter: Move file to directory.

[email protected] ~]# ls hello/[[email protected] ~]# mv Test.txt hello/. [[email protected] ~]# ls hello/test.txt

2. Default parameter: Rename.

[Email protected] ~]# LS-LRT just_test.txt-rw-r--r--1 root root Apr 7 17:49 just_test.txt[[email protected] ~]# MV Just_test.txt Just_test.log[[email protected] ~]# ls-lrt just_test.log-rw-r--r--1 root root Apr 7 17:49 just_test. Log

3. Default parameter: Move directory.

[[email protected] ~]# ls world/[[email protected] ~]# ls hello/test.txt[[email protected] ~]# mv hello/world/. [[email protected] ~]# ls world/hello[[email protected] ~]# ls-lrt world/hello/total 4-rw-r--r--1 root root 7 13 : Test.txt


This article is from the "Yau Xin Zhai" blog, please be sure to keep this source http://mofei.blog.51cto.com/6840705/1762195

MV Command Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.