I. Summary of common Linux commands and summary of common linux commands

Source: Internet
Author: User

I. Summary of common Linux commands and summary of common linux commands

1. Basic linux commands

Who, which, basename, dirname, echo, type, hash, whatis, makewhatis, man, info, help, ls, cd, pwd, mkdir, rmdir, touch, rm, date, hwcolck, cal, shutdown, reboot, tty

1 who: Show who is logged on, print information about users who are currently logged in.

The logon user is displayed.

2 which: Show the full path of (shell) commands

Which pwd, which shutdown

3 basename: Print name with any leading directory components removed.

Basename/usr/bin/sort, Output: sort

4 dirname: strip non-directory suffix from file name

Dirname/usr/bin/sort, Output:/usr/bin

5. Command replacement

'': Strong reference. The variable will not be replaced;

"": If referenced, the variable can be replaced;

'': Command application, similar to $ ()

6 echo: display a line of text, echo

Echo $ PATH, Output:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin: /usr/bin:/root/bin

Echo '$ path', Output: $ PATH

Echo "zhu biao", Output: zhu biao

Echo 'date + % f' (echo $ (date + % F), Output: 2016-10-26

7 type: Display information about command type

Type cd, Output: cd is a shell builtin

Type shutdown, Output: shutdown is/sbin/shutdown. If shutdown has been executed, it will be added to the hash database, then: shutdown is hashed (/sbin/shutdown)

8 hash: Rember or display program loacations. It displays the number and position of programs executed in the hash database.

9 whatis: briefly describes the functions of a command. This command is described in the manual document.

Whatis shutdown, Output:

Shutdown (2)-shut down part of a full-duplex connection
Shutdown (3 p)-shut down socket send and receive operations
Shutdown (8)-bring the system down

10 makewhatis: Create the whatis datebase

11 shell commands include internal commands and external commands.

Internal command help: help command

External command help: command -- help, man command, info command

12 man: man [section] command, manual, command, configuration file format, library call, and other help documents


1: User Commands
2: System CILS
3: C Library Functions
4: Devices and Special Files
5: File Formats and Conventions
6: Games et. Al.
7: Miscellanea
8: System Administrations tools and Deamons

13 info: Get online help documentation. The usage is similar to man.

14 help: shell internal Command help documentation

Help ls

15 {a, B}: Expand

{A, B}/{x, y}: a/x a/y B/x B/y

{A, B}-heburn-{x, y}: a-heburn-x a-heburn-y B-heburn-x B-heburn-y

16 ls: list directory contents


17 cd: change the shell working directory


Cd ~ : Return to the user's home directory

Cd ~ Zhubiao: Go Back To The zhubiao directory.

Cd-: return to the previous directory

18 pwd: Print working directory

19 mkdir: make directories

Create directories/mnt/linux/bin,/mnt/linux/sbin,/mnt/bin,/mnt/sbin can use the following commands:

Mkdir-pv/mnt {/linux/{bin/sbin}, bin, sbin}

20 rmdir: remove empty diretories



21 rm: remove files or directories


22 touch: create a file

23 date: print or set the system date and time

Date [MMDDhhmm [[CC] YY] [. ss]:

Date 10262318 sets the system time to, January 1, October 26,

Date 102623182016.33 sets the system time to 23:18:33

Date + % F, Output: 2016-10-26

Date + % T, Output: 23:18:33

24 hwclock: query or set the hadway clock (RTC)

Hwclock -- set -- date = "102616 23:12:10"

Hwclock-s (-- hctosys)

Hwclock-w (-- systohc)

25 cal: Display a calendar

Cal, Output:

October 1, 2016
Su Mo Tu We Th Fr Sa
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

26 shutdown: bring the system down

Shutdown-h now

Shutdown-r + 5

27 reboot: reboot, halt, poweroff-reboot or stop the system

28 terrix

A. virtual terminal tty #

B. Physical terminal console

C. Pseudo Terminal pts /#







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