Common Commands of Linux System

date # Display the current system time and date
cal # Display the calendar of the current month
df # View the current free space on the disk drive
free # Display the available memory
exit # Close the terminal

pwd # View current working directory
cd # Change directory, "." working directory, parent directory of ".." working directory
ls # View directory content, file and directory attributes; ls -a can see hidden directory
ls: View current working directory A series of files and subdirectories contained in the directory;
ls /usr: view a specific directory, here is /usr
ls ~ /usr: view multiple directories
ls -l: view detailed information

cp: Copy files and directories.
mv: Move or rename files and directories.
mkdir: Create a directory.
rm: remove files and directories.
in: Create hard links and symbolic links.

type: Displays the type of command. type command
which: Displays the location of the executable program. which command
help: Obtain the help document of the built-in command of the shell, and display the usage information of the command. help command or command --help
man: Displays the man page for the command.
apropos: Displays a list of appropriate commands.
info: Displays the info entry for the command.
whatis: Display a brief description of the command
alias: Create an alias for a command.

The "manual document" displayed by the man command is divided into multiple parts (section), which includes not only user commands, but also system management commands, program interfaces, file formats, etc.

 $man 5 passwd # This command will display the file format description manual of the file /etc/passwd.

The coolest feature of the command line - I/O redirection.
This function can redirect the input of the command line to get the content from the file, and also redirect the output of the command line to the file. If we associate multiple command lines, it will form a very powerful command-pipeline.

The idea of ​​"everything is a file" in UNIX


The I/O redirection function can change the destination of the output content and also change the source of the input content.

cat: Merge files.
sort: Sort lines of text.
uniq: Report or delete duplicate lines in a file.
wc: Print the number of newlines, words and bytes in the file.
grep: print matching lines.
head: output the first part of the file.
tail: output the last part of the file.
tee: Read data from standard input and output its contents to standard output and to a file.

echo: Display a line of text.
clear: Clear the screen.
history: Display the records of the history list.

Guess you like

Origin blog.csdn.net/qq152521766/article/details/119345853