A rookie to learn programming techniques, record and share knowledge to everyone, hope you can enjoy.
Today to write an article on the basis of learning Linux commands - Bowen working directory commands, but also a lot of practice, summed up for everyone to learn together!
When using the following commands, you can use the alias
command to view the Properties command you want to use.
file命令
Check the type of file;
touch命令
Used to create a blank file or set of files of time;
-d "YYYYMMDD HH:mm:SS 文件名"
: Time to modify the filetouch test
: Create a directory of a testtouch *
: Modification time is the current system time (all files in the current directory)
mkdir命令
Used to create a blank directory, mkdir command may be combined -p
parameters recursively create the file directory having nested superposed relationship, mkdir is make directory
abbreviation;
-p
: Cycle to create the directorymkdir /a1
: Create a new file a1mkdir /a2
: Create a new file a2mkdir -p /a3/a4
: Create a file cycle a3, a4
rmdir命令
To delete the directory (deleted directory is empty directory, that directory without any files), use the same mkdir
command the same, rmdir
is the remove directoy
abbreviation;
The following figure deleted directory is not empty, it prompts to remove failed!
cp命令
For copying a file or directory cp [选项] 源文件 目标文件
, cp
it is the copy
abbreviation;
-r
: Copy the directory, if the directory exists tips-v
: Displays detailed information copied-f
Or--force
: forcibly copy files or directories, regardless of whether the destination file or directory already exists-i
Or--interactive
: before overwriting existing files or directories to ask the user-u
Or--update
: when the source file date than the destination file, or when the name of the corresponding destination file does not exist, just copy the files-p
Or--perserve
: keep the source file or directory attributes
using thealias
command to view the properties of the command, the following figure default attributes arecp -i
, how to retaincp
command of the original intent of it?
use\ Cp commandCan retain command of intent, below is using thecp
command to copy the files to a home folder, the file name is still a;
rm命令
Used to delete a file or directory, you need to add the rm command "-r"
can only be parameters, or deleted can not afford, rm
is remove
an abbreviation;
-r
Or-R
: all parameters listed in directories and subdirectories are recursively deleted-f
Or--force
: forcibly remove files or directories, ignore non-existent file or directory-i
Or--interactive
: Before deleting existing files or directories to ask the user
on the new icon of a file tt1, force removal
prompt:rm -rf/*命令
: Remember to be careful, this command is to delete all the files in the root directory of the Internet has been popular circle the word: delete from library to run away, do with caution! If you use this command, produces all the consequences and the author has nothing to do! ! !
mv命令
For cutting file or rename the file mv [选项] 源文件 [目标路径] [目标文件]
, mv
it is the move
abbreviation;
-f
: Whether the target file exists, not prompted to overwrite the target file or directory
will fff file in the root directory of the move to the home folder
for files to be renamed folder test1
End of the article resource sharing
on Linux learning resources are uploaded to a network disk, if required, can open the download Oh!
Links: https://pan.baidu.com/s/1BB5xbQU7jEI3sRKtkIWfqA
extraction code: 8gut