Home > Article > Computer Tutorials > A collection of simple shell commands.
The following are some commonly used Shell commands:
File and directory operations:
ls
: List files and subdirectories in a directory. cd
: Switch to the specified directory. pwd
: Display the path of the current working directory. mkdir
: Create a new directory. rm
: Delete files or directories. cp
: Copy files or directories. mv
: Move or rename files or directories. Text file processing:
cat
: Display file content. grep
: Search the file for the specified pattern. sed
: Use regular expressions for text replacement and conversion. awk
: Text processing tool for extracting and processing text data. sort
: Sort the lines of the text file. head
: Display the first few lines of the file. tail
: Display the last few lines of the file. System Information and Management:
ps
: Display currently running processes. top
: Display system resource usage in real time. kill
: Terminate the running process. uname
: Display system information. df
: Display disk space usage. free
: Display system memory usage. du
: Display the disk usage of a directory or file. Network Tools:
ping
: Test the connection to the specified host. nslookup
: Query the IP address of the domain name. curl
: Send HTTP request and display the return result. wget
: Download file. Permissions and user management:
chmod
: Modify the permissions of a file or directory. chown
: Change the owner of a file or directory. chgrp
: Change the group to which a file or directory belongs. useradd
: Create a new user. usermod
: Modify user attributes. passwd
: Change user password. This is just a small selection of commonly used Shell commands, there are many others available for different tasks and operations. You can use the man
command to view the detailed usage and options of the command. For example, man ls
will display the help documentation for the ls
command.
The above is the detailed content of A collection of simple shell commands.. For more information, please follow other related articles on the PHP Chinese website!