Linux basic commands (1)
Linux command
the execution of instruction or program commands for implement a certain class of functions depends on that interpreter
Command classification Internal commands: part of shell interpreter External commands: program files independent of shell interpreter
basic usage
Format:
Command word [option]... [Parameters]...
Options to regulate how commands are executed
Short options: -l, -A, -c, -d,... Long options: --color, --auther, --sort,... Compound options (i.e. multiple short options): -lh, -lA, -ld,...
parameter, the object of a command, such as a directory or file
directory structure
/ Root partition, the starting point of the Linux file system
/bin Normal users use commands
/sbin Administrator uses command
/home Home Directory for Regular Users
/root Administrator's Home Directory
/boot Linux boot files directory (kernel, grub)
/dev Device files, keyboard mouse
/proc Virtual file system (computer memory information, CPU...) No real hard disk space
The meaning of file color under Linux
Blue---> Contents
Green---> Executable
Red---> Compressed files
Light Blue--> Link Files
White---> Other documents
Black---> Text files
Function shortcut keys
ESC + . Alt + . Ctrl + w: Delete a word backwards Ctrl + u: Clear to the beginning of the line Ctrl + k: Clear to the end of the line Ctrl + l: Clear the entire screen Ctrl + c: Discard the currently edited command line
1、uname
Meaning: View system architecture and kernel information
Common command options
-a: Display all information such as host name/kernel/hardware platform
-r: Show only kernel version
2、hostname
Meaning: View the full name of the host (including host name, domain name)
3、ifconfig
Meaning: Check the local IP address (the address displayed on the first NIC is the local IP address)
4, shutdown (shutdown command has three ways to express)
shutdown -h nowpoweroffinit 0
shutdown -r nowrebootinit 6
Delayed shutdown or restart
Example://Restart after 15 minutes and prompt the logged in user
Cancel shutdown: Ctrl+c or shutdown -c
5、type
Meaning: See if the command is internal or external.
Common option-t: Displays what name means.
file: Indicates an external command.
alias: Indicates the name that the command is set for the command alias.
builtin: indicates that the command is a built-in command function of bash. - p: The full file name is displayed only if the name followed is an external command. - a: In the path defined by PATH variable, list all the name commands included, including alias.
6、help
Meaning: Get help with commands, see how commands are used. View Help Text for Internal Commands
help command name View usage and description of external commands
Command Name--Help
A manual page documentation mechanism in Linux Most programs/configuration files/library functions have manual pages
Format: man command name
Manual reading tool use operation press ↑, DOWN, PgUp, PgDn key scroll and page press q or Q key exit press? key forward, press/key backward search (n, N toggle)