Linux commands (1)-ls, pwd, tree, clear, file related operations

ls command

View current directory information

Note: ls can be followed by several options -l is displayed as a list, -h can display the file size in bytes, -a displays hidden files or directories, and can also be used in any combination of the three

pwd

The path of the current directory
Insert picture description here

tree command

Draw a tree diagram and view multi-level directory information
Insert picture description here

Clear command line command

Enter clear at the terminal

File related operations

touch command plus the desired file name
mkdir command plus the desired directory name
rm command can delete the specified file or directory, if you delete the directory, you must add the **-r** option after the command
Insert picture description here

rmdir can delete empty directories.
cp can copy files and directories, but the -r option should be added when copying directories.
Note: cp can be followed by multiple options,
such as: -i adds interactive operations
Insert picture description here
-v can display path operations
Insert picture description here

Insert picture description here
The above command can move the folder AAA to the 42 directory.
mv can move files and directories, and can also rename. The
Insert picture description here
above command can change the folder name AAA to BBB

Guess you like

Origin blog.csdn.net/weixin_48445640/article/details/108817154