Common commands for Linux

Source: Internet
Author: User

Common commands for Linux 、、、

If you say Linux is just for the sake of faking it, it proves that you are really good at food. Do not rule out the factors, which also accounted for a very small proportion, can be ignored.
------------------------------
The biggest benefits and purposes of summarizing these commonly used Linux commands are actually only one: to practice the speed of their own knocks and to familiarize themselves with the Linux system


Sometimes when I am bored, I will, open the RHEL7, according to the command in this document, or directly knock some of the first impression of the Linux command, this command summarizes only the role of reference exercises,
------------------

Man (Help command)
Info (same as man)
Whatis (query basic information, equivalent to man-f)
Help (Assist)
--help (Get option Information "common")
Alias (aliases)
File management, File search commands
CD (Switch directory)
PWD (show current directory)
Special Catalogue
LS (show directory file)
Touch (Create empty pieces)
mkdir (Create new directory)
CP (copy files or directories)
MV (move file or rename)
RM (delete files)
Cat (show file contents)
More (page shows the contents of the file)
Less (paged query, more powerful than more)
Head (view the first few lines of the file)
Tail (view the following lines of the file)
ln (resulting linked file)
Which (displays the directory where the system commands are located)
Find (locate file or directory)
Locate (looking for files or directories)
grep (search for matching rows in the file contents and output)
Other
Input/Output redirection
History (show historical commands)
| Pipeline
Command connector
Command substitutions
Netstat
Load Information
Firewall firewall
Other
====================
Some shortcut keys:
Shift + Insert #粘贴
Ctrl + Insert #复制
====================
Some of the common Linux commands:
Man (Help command)
Original intention: Manual
Syntax: Man [command or configuration file]
Example:
Man 1 passwd # 1 View command Help, 1 default can be omitted
Man 5 passwd # 5 View configuration file Help
====================
Info
Original intention: Information
A help command similar to man
-----------------------
Whatis (query basic information, equivalent to man-f)
-----------------
Help (Assist)
Can query some shell built-in command help
---------------
--help (Get option information
Example:
Cat--help
------------------
Alias (aliases)
The alias is valid only in the current window, if the command is valid for a long time, modify the configuration file. BASHRC, under the/root directory.
This makes it very convenient for us to customize our own personality commands. such as restarting Supervisorctl reload this command can't remember, too long. We can nickname alias Reloadsupervisorctl= ' Supervisorctl reload '. So we just have to remember the reload and press the TAB key to complete the auto-completion.
-------------------
CD (Switch directory)
Original intention: Change Directo
-----------------
PWD (show current directory)
Original intent: Print working directory
---------------
LS (show directory file)
-Original: List
-------------------
Touch (Create empty pieces)
Syntax: touch [filename]
----------------
mkdir (Create new directory)
Syntax: mkdir [directory name]
-----------------
CP (copy files or directories)
Syntax: cp-r [Original file or directory] [destination directory]
---------------
MV (move file or rename)
Intent: Move
Syntax: MV [source file or directory] [destination directory]
-----------------
RM (delete files)
Original intent: Remove
Syntax: RM-RF [file or directory] #r是删除目录 f Yes no need to confirm
-----------------
Cat (show file contents)
Original intention: Concatenate
Syntax: cat [filename]
---------------
More (page shows the contents of the file)
Syntax: more [filename]
Space or F to display the next page
Enter to display the next line
Q exit
----------------
Less (paged query, more powerful than more)
More can only turn to the next page, less can page up and down.
-------------------
Head (view the first few lines of the file)
Syntax: head-num [file name]
-------------
Tail (view the following lines of the file)
Syntax: tail-num [file name]
-------------
ln (resulting linked file)
Original intent: Link
Syntax: ln-s [source file] [target file]
-----------------
Which (displays the directory where the system commands are located)
Syntax: which [command name]
Example:
# which ifconfig

-----------------
Find (locate file or directory)
Syntax: Find [Search path] [search keyword]
------------
Locate (looking for files or directories)
Usage: Locate [search keywords]
---------------
grep (search for matching rows in the file contents and output)
Usage: grep [Specify string] [source file]
---------------
Input/Output redirection
-> Output redirection
Example: ls-l > Mytest.txt #将当前目录的所以文件信息写入mytest. txt file.
-< input redirection
Example: Wall < Mytest.txt #将mytest content broadcast inside a. txt file (Wall broadcast command)
-------------------
History (show historical commands)
------------
| Pipeline
Using pipeline Commands
Ls-l/etc | More #分页查看etc目录下的文件
Ls-l/etc | grep Init #查看etc目录下文件名包含init的文件
Ls-l/etc | grep init | Wc-l #查看etc目录下文件名包含init的文件的个数
----------------
Command connector
;
Example: Cd/home; LS #跳转到home目录并且查看里面的文件 (even the wrong command will continue to execute the following command.) )
&&
Example: GGG && ls #不会查看目录下的文件 (there is an incorrect command in the middle that does not execute the subsequent command)
||
Example: GGG | | LS #会执行查看目录下的文件 (a command that can execute successfully will stop executing the following command)
---------------------
Netstat
Port for NETSTAT-LNTP #查看监听 (Listen)
NETSTAT-ANTP #查看所有建立的TCP连接
NETSTAT-TUNLP #查看端口使用情况 (e.g. NETSTAT-TUNLP | grep 3306 to see if Port 3306 is being used)
Netstat-n | grep TCP | grep 80 | Wc-l #监控网络客户连接数
----------------
Firewall firewall
-----------------
Su #用户切换
Graphical interface and character interface switching
Init 5 #切换到图形界面
Init 3 #切换到命令行界面
----------------------------------
Jobs View current background tasks

----------------will continue to be updated and modified in the future--------------------------

Common commands for Linux

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.