Linux: Common shell commands

Often see the current directory listing

ls

To delete a file or directory

rm file path
-rf rm file path (if you are not prompted to confirm the deletion, not recommended)

Copy the file or directory

cp file path of the destination file path

Mobile directory or file

mv file path of the destination file path

create a new file

touch the file path

New Directory

mkdir directory path

Check end position

tty

View the full path of the current directory

pwd

Enter the user

su username

Exit the current user

exit // exit the current user, return to the previous user, root user exit terminal

Restart

reboot

Guess you like

Origin www.cnblogs.com/yanlzy/p/11870543.html