Common Linux commands and how to use them

Problem Description

Common Linux commands and how to use them

Solutions

cd: switch directories, for example: cd /home/user1

ls: List all files and directories in the current directory, for example: ls

mkdir: Create a new directory, for example: mkdir new_dir

rm: Delete a file or directory, for example: rm file1 or rm -r dir1 (delete directory)

pwd: displays the current working directory, for example: pwd

cp: Copy files or directories, for example: cp file1 file2 or cp -r dir1 dir2 (copy directory)

mv: Move or rename a file or directory, for example: mv file1 newfile or mv dir1 newdir

cat: View file contents, for example: cat file1

grep: Find the specified string in the file, for example: grep "string" file1

ps: displays currently running processes, for example: ps aux

kill: end a running process, for example: kill pid (pid is the process ID)

top: Displays the running processes and system resource usage in the system, for example: top

ping: Test network connection, for example: ping www.baidu.com

ifconfig: Display network interface information, for example: ifconfig

ssh: Remote login to another computer, for example: ssh user@remote_host

Guess you like

Origin blog.csdn.net/weixin_50843918/article/details/133388070