Linux shell command
What is a shell?
The Shell is the interface that connects the operating system kernel to the user.
The terminal is the representation of the shell.
What is Shell programming?
The Shell scripting language, together with the Linux command statement, forms the shell program. The advantage is that batch processing does not have to be manually entered by the user each time.
Bash is one of the shell program interpreters.
Common commands
Pwd:print working directory, print the working directory.
Cd:chang directory, change the working directory.
You can use absolute or relative commands.
Ls:list, view the contents of the catalog. -L to view more information
Clear: Clear the screen.
Echo: The specified string is displayed on the display.
Up and down arrows: historical commands.
Tab: Command Auto-complete.
Commands about disk space
Mount: Mount the file system. This command requires root user rights.
Umount: Removes the file system.
File backup and Compression commands
ZIP is compatible under Windows systems.
Tar: Backup files and directories as a file for easy access.
Shutdown
Shutdown: normal shutdown.
Reboot: Restart.
PS: View program execution.
Top: Review the previous program execution.
Kill: Terminates the process.
Date: Change, view dates.
Cal: Displays the Calendar or annual calendar (Cal 1992).
Authorization commands
chmod: Change file permissions (R-Read W-write X-Execute)
[email protected]:/home/cc# ls-l hi
-rwxrwxr-x 1 cc cc 18 May 16:43 hi
User (U,g,o,a) for CHOMD file (+,-,=) permission name (r,w,x) file
u user G Group O other A All
SU: Switch user. SU User name (if blank, default is root)
Usersadd: Only the root user can add other users
passwd: Change Password
Query and location
The name of the Man:man command, which is used by the system to help with the command. To scroll through the manual page, use page UP or PAGE down.
Locate: Locates files or directories.
Whatis: The meaning of the query command. As a result of Whatis chmod:
[email protected]: ~$ whatis chmod
chmod (1)-Change file mode bits
chmod (2)-Change permissions of a file
File Read command
Head
Tail
Less
More
Commands about the network
Ftp
Ping
Telnet
Netstat