Linux CRUD and other basic commands

whoami View the currently logged
in user who View which users are logged in
date View the date
cal View the calendar
clear Clear screen = Ctrl + l
useradd Add user
passwd Change password
su Substitute user
man Help option, view the usage instructions of Linux commands (man su)
hlep help (the command to view the ls command help is: ls --help)

cd . Indicates the current directory
cd .. returns to the previous directory

pwd displays the current directory
pw+'Tab' can complete the command
cp copy

mv moves and modifies file and directory names (mv root/ /boot/ moves root to boot)
(mv aaa bbb changes aaa to bbb)

mkdir + directory name creates a directory (mkdir directory name (mkdir -p /dir1/dir2 recursively creates multiple directories)
touch + file name creates a file
rm deletes a file
rm -f deletes a file forcibly, without access to determine whether
rm -r deletes a directory [Super reminder! Don't use this command, you can use mv move instead of delete]


cat to view the file (show all contents)

head -10 /dir1/a.txt View the first 10 lines of the a.txt file in the
dir1 directory tail -10 /dir1/a.txt View the last 10 lines of the a.txt file in the dir1 directory
more View the file (in percentage page view)
less view file (up and down keys to page view)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325789202&siteId=291194637