Linux instructions (i) File/directory operations

Source: Internet
Author: User

1. Create a Directory

mkdir format  mkdir [OPTION] ... DIRECTORY ... Option-    p recursive creation-    v creation prompt example: [email protected]:/home/eko/x# mkdir-pv a/b/cmkdir:created directory ' a ' mkdir:created dir Ectory ' A/b ' mkdir:created directory ' a/b/c '

2. Create a file

Touch is meant to change the file time touch [OPTION] ... FILE ...
Cases:
[Email protected]:/home/eko/x# Touch Abc.txt

3. Delete files/directories

RMRM [OPTION] ... [FILE] ... Option:-    f  ignores nonexistent files and parameters-    r  Recursive Delete example: [Email protected]:/home/eko# rm-rf x

4. Copying files

CP (allow only one file to be copied to another file  or copy multiple files to a directory)       CP [OPTION] ... [-T] SOURCE DEST       CP [OPTION] ... SOURCE ... Directory       CP [OPTION] ...-t DIRECTORY SOURCE ... Option-       R  Recursive copy-       F if the  target file has a  forced overwrite
-P Reserved file owner
-A archive replication, commonly used for backup example: Copy one file to another # CP/ETC/PASSWD/HOME/EKO/X/PASSWD copy multiple files to a directory # cp/etc/passwd/etc/issue/home/ eko/x/

5. Move File/rename

MV              MV [OPTION] ... [-T] SOURCE DEST       mv [OPTION] ... SOURCE ... Directory       mv [OPTION] ...-t DIRECTORY SOURCE ... Option:   -F If the target exists, Force override example: Move File # mv./a.txt. /y/Rename # mv A.txt abc.txt

6. View the directory structure

Tree Dictory
Cases:
# Tree/home/eko

7. View text files

1.  Cat connects and displays (can connect multiple files)     cat [OPTION] ... [FILE]    ... Option:  -N Displays line    number  -e displays line terminator 2 per line.  TAC Flashback Display

Linux instructions (i) File/directory operations

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.