Brother Bird's Linux private dish Linux file permissions and directory management (i) __linux

Source: Internet
Author: User
Tags mkdir touch command file permissions

One, directory related Operations
is a special directory:
. Represents the top-level directory
-represents the previous working directory ~ represents the current user's Live folder
~accout representative account The home folder for this user (account is a username)
1, CD: Switch directory: CD directory name
2, pwd: Display the current directory: PWD
3, mkdir: Create a new directory: mkdir [-mp] Directory name
-m : Configuration file Permissions mkdir-m 744 test
-P: Create a multilevel catalog eg: enter command mkdir-p TEST1/TEST2/TEST3
4, rmdir: Delete a directory: RmDir [-p] Directory name
- P: Create a multilevel list eg: enter command rmdir-p TEST1/TEST2/TEST3
5, CP: Replication: CP [-ADFILPRSU] source file destination file
-A: equivalent to-PDR (common)
-I: If the target file exists, overwrite The cover will ask for the action (commonly used)
-R: Recursive continuous replication, for directory replication behavior (Common)
6, RM: Delete files or directories: RM [-fir] File or directory
7, MV: Move file or directory: MV [-fir] source target File
8, get the path of the file name and directory name
A, filename: input command: basename path
B, directory: input command: dirname path

Second, file content lookup
1, Cat: Display file contents starting with the first line: Cat [-abentv] File
-N: Print travel numbers, along with blank lines there will be line numbers
-B: Print travel numbers, blank lines do not print
2, TAC: Starting from the last line, it's just the opposite of the Cat command: TAC
3, nl: Show time, by the way output line number: NL [-bnw] File
4, more: One page display content: More file
5, Less: one page, one page Shows, similar to more, you can page forward: less file
6, head: Data selection, select the first few lines (the default display of 10 lines): Head [-N number] file
-n followed by numbers, representing the meaning of a few lines
7, Tail: Data selection, Select the last few lines (10 rows by default): Tail [n-number] file
8, od: Read file contents in binary mode: OD [t type] file
-T followed by various types: A is the default, C is ASCLL character, d[size] decimal, f[ Size] floating-point number, o[size] octal, x[size] hexadecimal
9, touch: Modifying file time or creating a new file: Touch [-acdmt] File
-A: Modify access time only;
-C: Modify file time only, if the file does not exist Do not create a new file;
-D: After the modified date
-M: Modify only the mtime;
-T: Follow the modified time, in the form [YYMMDDHHMM]
Note: The touch command is used primarily to create an empty file or to modify a file date to the current date.

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.