"Linux learning is not difficult" file directory Management (9): MV command file and directory renaming, moving files and directory path

Source: Internet
Author: User

7.9 "Linux learning is not difficult" file directory Management (9): MV command file and directory renaming, moving files and directory path

Use the MV command to change the names of files and directories and to move the paths of files and directories.
Command syntax:

MV [options] [Source Files | directory] [target file | directory]

The meanings of the options in the command are as shown in the table.

Options

option meaning

-I.

Ask before overwriting

-F

do not ask before overwriting

-N

do not overwrite files that already exist


Example: Move all files with the suffix ". png" under the/root/pic directory to the/usr/local/share/pic directory.

[Email protected] ~]# mv-f/root/pic/*.png/usr/local/share/pic

Example: Renaming the/root/pic/kpic.png file to/root/pic/life.png.

[Email protected] ~]# mv/root/pic/kpic.png/root/pic/life.png

Example: Change the/root/pic directory name to/root/mypic.

[Email protected] ~]# Mv/root/pic/root/mypic


This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .



Linux learning is not difficult "file directory Management (9): MV command file and directory renaming, moving files and directory paths

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.