Author's Foreword
Welcome little cuties to come and learn from my gtiee Qin Boss (qin-laoda) - Gitee.com
—————————————————— ————————————
Table of contents
- desktop operating system
-
server operating system
-
embedded operating system
-
mobile device operating system
-
Why You Should Learn Linux Terminal Commands
-
Commonly used Linux commands
-
Absolute and Relative Paths
-
command introduction
operating system
desktop operating system
server operating system
embedded operating system
mobile device operating system
Basic use of common Linux commands
Commonly used Linux commands
无论是谁的要求,在任何情况下,一定不要执行 rm -rf /* 的命令
这条命令表示从根目录下递归删除所有文件,且你的系统都会被删除,请一定要注意问题的严重性!!!
In order to let everyone see more clearly, I directly configured the desktop system
You can see that these files and folders (directories) are self-contained. I will demonstrate these commands one by one.
Absolute and Relative Paths
ls
ls
ls - a
ls -a
ls -a is to display the hidden files. It can be seen that the hidden files start with ".", and I simply found some
ls -l =====》ll
ls -l或者 ll
displayed in more detail
ls -hl
ls -hl
The -h parameter can be understood as converting the memory that matches the unit of k, that is, displaying the memory
That is, h must be matched with l to be clearly displayed
ls file (or directory) -parameters
ls 文件(或者目录) -参数
It can be seen that it is also possible to write
cd
cd 文件夹名
cp switch folder
pwd
pwd
Display the current file location with an absolute path
mkdir (create folder)
mkdir 文件夹名字
If you do not add parameters, you can only create folders one by one
-p
mkdir 文件路径 -p
Multiple folders can be created recursively
Remember that mkdir is used to create folders or directories
touch (create file)
touch 文件名
cp (copy paste files)
cp 要被复制的文件 粘贴的路径
-i generate prompt statement
cp 要被复制的文件 粘贴的路径 -i
This parameter is generally used to overwrite files. If it is used to copy and paste to a newly created file, there will be no prompt. It is generally used with the parameter v
-r
cp 要被复制的文件夹 粘贴的路径 -r
Recursively copy the files in the folder, that is, copy and paste a folder
-v
cp 要被复制的文件 粘贴的路径 -iv
Used to show from which file to copy and paste to hello file
mv (for moving files and directories)
mv 要被剪切的文件 移动到的路径
mv 要被剪切的文件 移动到的路径 -iv
This is the same as cutting
This command also has two parameters, which are -i and -v, which are similar to the parameters of the cp command.
It can be seen that when the file is moved to another file, it will be renamed, which can be understood as moving the a.py file to the directory of b, and then renaming it to c.py
The effect of this picture is obvious, we can use this effect to rename
rm (delete)
Some cuties also found that this command occasionally appeared in the previous introduction. This command should be used with caution. Improper use will cause serious things.
-i
rm 要删除的文件路径 -i
A prompt appears
-f
This is a parameter for mandatory deletion, no matter whether the file exists or not, it will not be demonstrated here
-r is used to delete all files in a folder (recursive deletion) without leaving an empty directory
General deletion will add a -i parameter to prevent serious effects
-d is used to delete an empty directory
not demonstrated here
Finally, let me introduce the meaning of rm -rf /*, which can be understood as deleting all things, which cannot be recovered
/*: match all the root directory
Summarize
Here is a brief introduction to the simple commands ls pwd cd rm mv cp and related parameters for the first-time database. If you don’t understand, you can chat with me privately.