Linux Common commands-File processing commands

Source: Internet
Author: User

1. command format and directory processing command LS

Command format: command [-options] [parameters] Example: ls-la/etc (Note: Individual commands do not follow this format; when there are multiple options, they can be written together; option parameters in brackets are generally ignored)

Command name: LS

Command English original: list

Command path:/bin/ls

Execute Permissions: All Users

Function Description: Display directory file

Syntax: LS [-options] [parameters] option:-A (All) displays all files;-L (long) displays details;-D view directory properties;-H to kb,mb display file size;-I file I node.

File types and Permissions

2. Directory processing commands

Command name: mkdir

Command English original: Make directories

Command path:/bin/mkdir

Execute Permissions: All Users

Syntax: mkdir-p [directory name]

Function Description: Create a new directory-P Recursive creation example: Mkdir-p/tmp/japan/boduo

Command name: CD

Command English original: Change directory

Command path: Shell built-in command

Execute Permissions: All Users

Syntax: cd[directory]

Function Description: Switch Directory example: Cd/tmp/japan/boduo switch to the development directory CD. /go to the top level directory

Command name: pwd

Command English original: Print working directory

Command path:/bin/pwd

Execute Permissions: All Users

Syntax: pwd

Function Description: Show current directory example: PWD

Command name: rmdir

Command English original meaning: remove emtpy directories

Command path:/bin/rmdir

Execute Permissions: All Users

Syntax: rmdir [directory name]

Function Description: Delete Empty directory example: Rmdir/tmp/japan/boduo

Command name: CP

Command English Original: copy

Command path:/BIN/CP

Execute Permissions: All Users

Syntax: CP-RP [Original file or directory] (can be multiple) [target directory]-r copy directory-p reserved File property

Command name: MV

Command English Intent: move

Command path:/BIN/MV

Execute Permissions: All Users

Syntax: MV [original file or directory] [target directory]

Function Description: Cut file, rename

Command name: RM

Command English original meaning: remove

Command path:/BIN/RM

Execute Permissions: All Users

Syntax: RM-RF [file or directory]-r Delete directory-F enforcement

Command name: Touche

Command path:/bin/touch

Execute Permissions: All Users

Syntax: touch [filename]

Function Description: Create empty file Example: Touch japanlovestory.list

Command name: Cat

Command path:/bin/cat

Execute Permissions: All Users

Syntax: cat [filename]

Function Description: Display file contents-N Display line number

Command name: more

Command path:/bin/more

Execute Permissions: All Users

Syntax: more [file name] (space) or F-page (Enter) line wrap Q or Q exit

Function Description: Page shows the contents of the file

Command name: Less

directory where the command is located:/usr/bin/less

Execute Permissions: All Users
Syntax: less [filename]

Function Description: Page shows the contents of the file (can page UP) example: less/etc/services

Command name: Head

Command path:/usr/bin/head

Execute Permissions: All Users

Syntax: head [filename]

Function Description: Display the first few lines of the file-n Specify the number of rows: Head-n 20/etc/services (not write-n default display first 10 lines)

Command name: Tail

Command path:/usr/bin/tail

Execute Permissions: All Users

Syntax: tail [file name]

Function Description: Display file After a few rows-n Specify the number of rows-F dynamic Display file End Content example: Tail-n 18/etc/services

Link command

Command name: LN

Command English original meaning: link

Command path:/BIN/LN

Execute Permissions: All Users

Syntax: ln-s [Original file] [target file]-s Create soft connection

Function Description: Generate link file

Ln-s/etc/issue/tmp/issue.soft

Create a soft link to the file/etc/issue/tmp/issue.soft

Ln/etc/issue/tmp/issue.hard

Create a hard link to the file/etc/issue/tmp/issue.hard

Note: Hard links can be identified through the I node, can not cross the partition, not for the directory use; The advantage of hard link: sync with new two files, one file deleted, another file still exists

Linux Common commands-File processing commands

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.