linux-Common commands (1) directory, file processing commands

Source: Internet
Author: User

Directory processing command: LS

Command name: LS

Command English original meaning:list

Command location:/bin/ls

Execute Permissions: All Users

Function Description: Display directory file

Syntax: LS option [-ald][file or directory]

-a displays all files, including hidden files

-L Detailed information display

-D View Directory properties

-rw-r--r--

-File type (-file d directory l soft link file)

rw-r--r--

U g o

U owner G-owned group O other person

R Read W write X Execute

----------------------------------------------------------------------------------

Directory Processing command: mkdir

Command name: mkdir

Command English original:makedirectories

Command location:/bin/mkdir

Execute Permissions: All Users

Function Description: Create a new directory-P recursive creation

Syntax: mkdir-p[directory name]

-----------------------------------------------------------------------------------

Directory Processing commands: CD

Command name: CD

Command English original meaning:changeDirectory

Command path: Shell built-in commands

Execute Permissions: All Users

Function Description: Switch directory

Syntax: CD [catalog]

Example: $ cd/usr/lib Switch to the specified directory

$ CD: Go back to the top level directory

$ cd/switch to the root directory

-----------------------------------------------------------------------------------

Directory processing command: PWD

Command name: pwd

Command English original meaning:printworking directory

Command location:/bin/pwd

Execute Permissions: All Users

Function Description: Displays the current directory

Syntax: pwd

-----------------------------------------------------------------------------------

Directory Processing command: rmdir

Command name: rmdir

Command English original meaning:remove emPtydirectories

Command location:/bin/rmdir

Execute Permissions: All Users

Function Description: Delete empty directory

Syntax: rmdir[directory name]

-----------------------------------------------------------------------------------

Directory processing command: CP

Command name: CP

Command English original:copy

Command location:/BIN/CP

Execute Permissions: All Users

Function Description: Copy files or directories

Syntax: cp-rp[original file or directory [target directory]

-R Copy Directory

-P Reserved File attributes

-----------------------------------------------------------------------------------

Directory processing commands: MV

Command name: MV

Command English original meaning:movE

Command location:/BIN/MV

Execute Permissions: All Users

Function Description: Cut file, rename

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

-----------------------------------------------------------------------------------

Directory Processing Commands: RM

Command name: RM

Command English original meaning:remove

Command location:/BIN/RM

Execute Permissions: All Users

Function Description: Delete file

Syntax: rm-fr [file or directory]

-R Delete Directory

-F Force Execution

-----------------------------------------------------------------------------------

file processing commands: Touch

Command name: Touch

Command location:/bin/touch

Execute Permissions: All Users

Function Description: Create an empty file

Syntax: touch [filename]

-----------------------------------------------------------------------------------

file processing commands: Cat

Command name: Cat

Command location:/bin/cat

Execute Permissions: All Users

Function Description: Display file contents

Syntax: cat [filename]

-N Display Line number

-----------------------------------------------------------------------------------

file processing command: TAC

Command name: TAC

Command location:/bin/tac

Execute Permissions: All Users

Function Description: Display file contents (reverse list)

Syntax: cat [filename]

-N Display Line number

-----------------------------------------------------------------------------------

file processing command: more

Command name: more

Command location:/bin/more

Execute Permissions: All Users

Function Description: Page shows the contents of the file

Syntax: more [filename]

(space) or F page

Carriage return line break

Q or Q exit

-----------------------------------------------------------------------------------

file processing command: Less

Command name: more

Command location:/usr/bin/less

Execute Permissions: All Users

Function Description: page displays the contents of the file (can page up)

Syntax: less [filename]

-----------------------------------------------------------------------------------

File Processing command: Head

Command name: Head

Command location:/usr/bin/head

Execute Permissions: All Users

Function Description: Displays the first few lines of the file

-n Specifies the number of rows

Syntax: head [filename]

Example: $ head-n 20/etc/services

-----------------------------------------------------------------------------------

File Processing command: Tail

Command name: Tail

Command location:/usr/bin/tail

Execute Permissions: All Users

Function Description: Displays the following lines of the file

-n Specifies the number of rows

-F Dynamic display of file end content

Syntax: tail [file name]

Example: $ tail-n 20/etc/services

-----------------------------------------------------------------------------------

File Processing command: LN

Command name: LN

Command English original meaning: link

Command location:/BIN/LN

Execute Permissions: All Users

Function Description: Generate link file

Syntax: ln-s[original file [target file]

-S Create soft links








linux-Common commands (1) directory, 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.