Table of contents
(1) cd command
The main function of this command is to change the working directory. When the input does not specify
"
directory path
"
, return to the user 's home directory.
The operation syntax format is
cd <
Directory path
>
, the operation effect is as shown in the figure.
(2) pwd command
The main function of this command is to display the absolute path of the current working directory. The operation syntax format is
pwd
, and the operation effect is as follows
picture.
(3) mkdir 命令
The main function of this command is to create a directory. The operation syntax is
mkdir [
options
] <
Directory name
, its operation effect is as follows
>
Figure
. Use the
mkdir
command to create the folder
test_folder_xxx
.
(4) ls commandment
The main function of this command is to list the contents of the directory. The operation syntax is
ls [
options
] [
directory name
…]
, its operation effect is as follows
图
.
(5) touch 命令
The main function of this command is to create files or change file or directory time attributes.
Operation instructions
touch [
selection
] [
text Name...]
, Its operation effect is
.
使用
touch
命令,在
test_folder_xxx
创建
test_file_xxx.txt
(6) cp commandment
The main function of this command is to copy a given file or directory to another file or directory, or to copy multiple source files
files are copied to the target directory. The operation syntax is
cp [
options
] <
source file name or directory Name
> <
Destination file name or directory name
name
>
, its operation effect is as follows.
ls
cp test_folder_xxx/test_file_xxx.txt test_file.txt
ls
(7) mv commandment
The main function of this command is to rename files or directories or move files from one directory to another. Operation syntax
is
mv [
options
] <
source file or directory
> <
destination file or directory
>
, its The operation effect is as shown in the figure.
mv test_file.txt test_folder_xxx/
ls
cd test_folder_xxx/
ls
(8) rm commandment
The main function of this command is to delete one or more files or directories in a directory. It can also delete a directory and its
All files and subdirectories under are deleted. For linked files, only the link is deleted, and the original files remain unchanged. operative words
method is
rm [
options
] <
file Name or directory name
…>
, the operation effect is as shown in the figure.
ls
rm test_file.txt
ls
(9) sudo command
The main function of this command is to execute instructions as an ordinary user. The operation syntax is
sudo [
options
>][
command
, its operation effect
]
As shown in the picture.
I will continue to share with you when I learn new things later.