$HOME or ~//user root CD//switch directory CD: /Switch to Parent directory PWD//view current directory MV //rename or move files and directories touch ~/testfile//create file ls ~//view file list CP ~/testfile ~/testnewfile//Copy file RM ~/test File//delete files cat ~/.bash_history//view file contents The Cat command is used to read the contents of the specified file and print to the terminal output grep ' root '/etc/passwd//filter out the/etc/passwd file containing the root record g Rep-r/var/log///recursively filter out records containing Linux in the/var/log/directory | The role of pipelines in Linux is to use the output from the previous command as input to the next command cat/etc/passwd | grep ' root '//cat and grep two commands combined with a pipe ls ' ssh ' | grep ' ssh '//filter out directories in/etc directory with SSH in the directory echo ' Hello leyi ' > ~/hello.txt//Use > or < redirect the output of the command to a file Ping-c 4 www.baid u.com//Send 4 ping packets, check for connectivity netstat-lt//list all listening TCP ports NETSTAT-TULPN//View all port information, including PID and process name Ps-aux | grep ' ssh '//filter to get the SSH process information in the current system WHOAMI//view current logged in account Su adduser leyi//Add user su leyi//switch User sudo <cmd> can run cmd command at privileged level
Linux Basic Command Memo