Linux basic commands

Source: Internet
Author: User

First, the Directory Processing command
The path to the command:/bin/mkdir
Function Description: Create a new directory
-P Recursive creation
The catalogue must be planned, and the command should have meaning.
To make it easier to find
The path to the command:/bin/
Function Description: Switch directory
. Represents the current directory
.. Represents the top-level directory of the current directory
Cd.. Go back to the top level directory (command format strict specification)
CD plus directory name to switch to the specified location

The path to the command:/BIN/PWD
Function Description: Displays the current directory

The path to the command:/bin/rmdir
Function Description: Delete empty directory
rmdir [directory Name]
is not commonly used in practical applications, as knowing

The path to the command:/BIN/CP
Function Description: Copy files or directories
Syntax: cp-rp[original file or directory [target directory]
-R Copy Directory
-P Reserved File attributes
The path to the command:/BIN/MV
Function Description: Cut file, rename
Syntax: mv[original file or directory [target directory]
Can be renamed under the current directory

Change CRT Theme Options-session options-emulation, appearance

For file directory additions and deletions to search

The path to the command:/BIN/RM
Function Description: Delete file
Syntax: rm-rf[file or directory]
-R Delete Directory
-F Force Execution

In the course of learning, it is advisable to build your own files or files that you have copied in your system or create your own.
In the practice directory.

We recommend that you first delete any files before you better do the appropriate backup of the daily data to be backed up
Once the error is removed, try not to read and write to your hard drive, including finding and so on.
The more read and write operations you do, the less likely you will be to recover data in the future

RM Plus file name

1.mkdir You can create a new directory and use the-P option to create a recursive
2.CD can be used to switch directories
3.pwd can be used to view the current working directory
4.rmdir to delete an "empty" directory
5.CP is used to copy files, use the-r option to copy the directory, copy the file attributes and the-P option
6.MV to cut files and rename files
7.rm used to delete files deleted directory plus-R, delete the same time do not want to ask confirmation plus F

Email: [Email protected]
Job naming submission Format: [Name]+[Big Data Three]


Ii. File processing commands
The path to the command:/bin/touch
Function Description: Create an empty file
Syntax: touch [filename]
* ? Root directory:/
The special naming of the Linux system is legal.
In the Linux system Hollow lattice is used as a delimiter between the command and option options and parameters
It is not recommended to name in this way
The path to the command:/bin/cat
Function Description: Display file contents
-N Display line number (nunber)
Syntax: cat [filename]

The path to the command:/USR/BIN/TAC
Function Description: Display file contents (reverse list)
Syntax: tac[file name]

The path to the command:/bin/more
Function Description: Page shows the contents of the file
Syntax: more[file name]
Space or F page
Carriage return line break
Q or Q exits the browsing state

The path to the command:/bin/less
Function Description: page displays the contents of the file (can page up)
Syntax: less[file name]

The path to the command:/usr/bin/head
Function Description: Displays the first few lines of the file
-n Specifies the number of rows
Syntax: head[file name]

The path to the command:/usr/bin/tail
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]

1.touch Creating files
2. View file cat Browse a shorter file, line number plus cat-n
3. Reverse display content TAC does not support the-n option
4. Paging displays the contents of the file more space or F page return line Q or Q exit the browsing state
5.less PAGE Up
6.head shows the first few lines
7.tail shows the end of a few lines
Rights Management Command: chmod
The path to the command:/bin/chmod
Function Description: Change file or directory permissions
Syntax: chmod[{ugoa}{+-=}{rwx}][file or directory]
[mode=421] [File or directory]
-R Recursive modification

A file modifier: 1. Super Administrator Root 2. The owner of this file
The first type: authorization with +-=, chmod[{ugoa}{+-=}{rwx}][file or directory]
A means everyone.
+: Increase Permissions
-: Reduce permissions
=: that is, whatever it was before, it's all now unified.
G+w,o-r ibeifeng.list


X----2 of the 0-time Square
W----2 One-time square
X----2 of the 2-time Square

Owner Rwx 4+2+1 =7
Owning group Rw-4+2 =6
Other People r--4

rwxrw-r--: 764

532 4+1 r-x 1+2-wx-w-r-x-wx-w-

RW 6

Linux basic commands

Related Article

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: 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.