Linux Learning-File management (2)

Source: Internet
Author: User

Nine, move, rename files

MV Moving Files

Format: mv+ source file + target

-I Interactive, pre- overwrite hints

-F forced override

rm Delete files and directories

- I. Interactive

-F Mandatory

-R Recursive Delete directory common commands rm-rf

Rename changing file names in bulk with string substitution (wildcard characters are supported)

Format: rename+ original string + target string + file list to change filename

Example: Rename. txt. doc *.txt

X. Directory Operations

mkdir Create a directory

- p recursive creation of multi-level directories, if the directory to be set up in the upper directory is not yet established, will be set up the upper directory

- v Show details when creating a directory

- m + target attribute set permissions directly when creating directory

rmdir Delete only empty directories

- p recursive delete multilevel empty directory

- v Displays the details of the deletion

case

(1) How to create/testdir/dir1/x,/testdir/dir1/y,/testdir/dir1/x/a,/testdir/dir1/x/b,/testdir/dir1/y/a,/testdir/dir 1/y/b

mkdir-p/testdir/dir1/{x/{a,b},y/{a,b}}

(2) How to create/testdir/dir2/x,/testdir/dir2/y,/testdir/dir2/x/a,/testdir/dir2/x/b

mkdir-p/testdir/dir2/{x/{a,b},y}

Finally, you can view the created directory with the tree command


Linux Learning-File management (2)

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.