Command Line


cd ~/Desktop to enter the desktop
mkdir demo-1 creates a directory, then you can switch to the desktop and see the demo-1 directory
rm -rf demo-1 delete directory
touch 1.txt create file
mv 1.txt 2.txt In this way, we move 1.txt to 2.txt, that is, rename

Create directory make directory mkdir

delete remove rm

move/rename move mv

copy copy cp

list list ls

change directory change directory cd

Enter the directory cd

show current directory pwd

create directory mkdir

directory name create directory mkdir -p directory path

view path ls path

View path ls -a path

View path ls -l path

View path ls -al path

create file echo ‘1’ > file path

Force to create a file echo ‘1’ >! file path

Append file content echo ‘1’ >> file path

Create file touch filename

copy file cp source path target path

Make directory cp -r source path target path

Move node mv source path target path

delete file rm file path

Force delete file rm -f file path

Delete directory rm -r directory path

Force delete directory rm -rf directory path

View the directory structure tree Let Windows support tree

Create a soft link ln -s real file link

download file curl -L > baidu.html

Copy the web page wget -p -H -e robots=off does not support wget)

disk usage df -kh

Current directory size du -sh .

Each file size du -h

A path starting with / is an absolute path