Introduction to some basic Linux common commands and tips
Bibliography: Brother Bird's Linux private cuisine
Switch machine
Data synchronously written to disk: Sync
Restart: Reboot (restart immediately) Shutdown-r now (restart now) Shutdown-r +x (restart after x minutes)
Shutdown: Poweroff (perform sync before shutdown) shutdown-h now (shut down immediately) Shutdown-h +x (shut down after x minutes) shutdown-h xx:xx (Power off at Xx:xx)
Command-line Tips
Exit command line: Exit
Command completion: Any character before any action + press [Tab][tab] to appear prompt all complete commands
ls+ for two consecutive times [Tab][tab] ls lsblk lscp lsinitramfs lslogins lspci lssubsys lsar lsb_release Lscpu lsipc lsmod lspgpot lsusb lsattr Lscgroup lshw lslocks LSNs lssu
File completion: The first n characters of any file or folder + press [Tab][tab] to complete the file name (IBID.)
Stop running: [ctrl]+c
End input: [ctrl]+d
Operating instructions: man [command]
man-f [command]: Lists all the file descriptions associated with the command:
man-k [command]: Contains all the description files for the command keyword
[Email protected]:~$ man ls
ls (1) User Commands ls (1)
The number on the right of the command shows:
1: Commands or executables that the user can manipulate in the shell environment
2: Functions and tools that the system kernel can invoke
3: Some commonly used functions or function libraries
4: Device file description, usually files under/dev
5: Format of configuration files or some files
6: Game
7: Conventions and protocols, such as Linux file system, network protocol, Ascall code and other instructions
8: System administrator Commands available
9: Documents related to Kernel
Man page Description:
Name //short command, data name Description
Synopsis//Command basic Syntax
DESCRIPTION//A more complete command description
Options //For synopsis, the list of all available option descriptions
COMMANDS//When the program (software) executes, commands that can be executed inside
files/Documents used or referenced by or connected to the program or data
See ALSO//related other instructions
EXAMPLE//reference Example
BUGS
Other
Display date and time: Date +[%y/%m/%d%h/%m] ("+" plus any parameters, respectively "month and Day Hours")
Show Calendar: Cal [[month] year] (parameter is year or month)
Calculator: BC (+-x%/Five basic operations, quit away)
2018-01-01
17:02:03
Basics of Linux Commands