1. Linux basic commands
Who, which, basename, dirname, echo, type, hash, Whatis, Makewhatis, Mans, info, help, LS, cd,pwd, mkdir, RmDir, Touch, RM, Date, Hwcolck, Cal, shutdown, reboot, TTY
1 Who:show who was logged on, the print information about the users who was currently logged in.
Displays the logged on user.
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 substitution
": Strong references, variables are not replaced;
"": If the reference, the variable can be replaced;
": Command applied, 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, will be added to the hash database, then: Shutdown is hashed (/sbin/shutdown)
8 Hash:rember or Display program loacations, displays the hash database, the number of programs executed, and the location.
9 Whatis: A concise description of the function of a command, which is in the section of the manual document
Whatis shutdown, Output:
Shutdown (2)-Shut down part of a Full-duplex connection
Shutdown (3p)-Shut down socket send and receive operations
Shutdown (8)-Bring the system down
Ten makewhatis:create the Whatis datebase
Each shell command is divided into internal commands and external commands
Internal command assistance: Help command
External command help: Command--help, man command, Info command
Man:man [Section] command, Manual, command, configuration file format, library call and other help documents
[Section]:
1:user Commands
2:system Calls
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
Info: Get online Help documentation, using the same method as man
Help:shell internal Command Help documentation
Help LS
{A, B}: Expandable
{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
Ls:list Directory Contents
Ls/home/zhubiao
Cd:change the Shell working directory
Cd/home/zhubiao
CD ~: Back to the user home directory
CD ~zhubiao: Back to User Zhubiao home directory
CD-: Go back to the previous directory
Pwd:print working Directory
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}
Rmdir:remove Empty Diretories
Rmdir/mnt
Rmdir-p/a/b
Rm:remove Files or directories
Rm-rf/a/b/zhubiao
Touch: Create a file
Date:print or set the system date and time
Date [MMDDHHMM[[CC]YY][.SS]:
Date 10262318 Sets the system time to October 26 23:18,
Date 102623182016.33 Sets the system time to 2016-10-26 23:18:33
Date +%f, output:2016-10-26
Date +%t, output:23:18:33
Hwclock:query or set the Hadway clock (RTC)
Hwclock--set--date= "102616 23:12:10"
Hwclock-s (--hctosys)
Hwclock-w (--SYSTOHC)
Cal:display a calendar
Cal, Output:
October 2016
Su Mo Tu We Th Fr Sa
1
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
Shutdown:bring the system down
Shutdown-h now
Shutdown-r +5
Reboot:reboot, Halt, poweroff-reboot or stop the system
Ternial
A. Virtual Terminal tty#
B. Physical Terminal console
C. Pseudo Terminal pts/#
I. Summary of common LINUX commands