Deep understanding of mkdir rmdir cp mv touch stat 3

Source: Internet
Author: User

1. mkdir

-P

-V

Mkdir/tmp/p/a/B

/Tmp/q/a/B

Mkdir/tmp/{q, q}/a/B-pv



/Tmp/p/a/B

/Tmp/q/

Mkdir/tmp/{p/a/B, q/a}-pv



Job:

Mkdir/tmp

Etc/init. d, etc/sysconfig, usr/lib, usr/bin, usr/sbin,/usr


/Include, var/log, var/spool, proc, sys


2. rmdir: remove, delete the empty directory

/Tmp/m/n

Rmdir-p/tmp/m


3. file:

Cp

Mv

Touch

Stat


Cp/etc/passwd/tmp/abc copy, renamed

If abc does not exist, copy and rename it;

If abc exists:

If abc is a file, it will overwrite it and a prompt will be displayed;

If abc is a directory, the passwd file will be copied to the abc directory;

-R recursive replication;

-I interactive reminder;

-P retains the original permissions, owner and timestamp; mkdir

-

4. mv SOURCE... DEST

/Tmp/sysconfig/root

The directory cannot overwrite the file;

5. rm

-R recursive deletion;

-F force Delete, no prompt;


6. touch: manually change the timestamp

Three times:

Last access time;

Last modification time: modify, file content change;

Last change Time: change, change of file metadata;

-T;

-C if the file does not exist, do not create it;


File data:

Data

Metadata Property Information)

7. stat: view the File Attribute timestamp, file type, and so on );



This article is from the blog "Nick Liu's blog", please be sure to keep this source http://zkhylt.blog.51cto.com/3638719/1299057

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.