Create directory mkdir

-p Recursive create
-m Set permissions when creating
-v Show the process when creating
mkdir /gong www #  Create in the root directory and the current directory www
mkdir -pv /gong{1/old{boy,man},2} #  If not, execute , If you have, just skip
{} and ASCII Code related
/gong/1
/gong/2
/gong/1/oldboy
/gong/1/oldman


create a file touch

touch  An existing file modifies the access time , Modification time , Creation time .


Look at the tree tree

-d Show only directories, not files
-L Show directory hierarchy 


File replication -cp

  or:  cp [OPTION]... SOURCE... DIRECTORY
  or:  cp [OPTION]... -t DIRECTORY SOURCE...
Unable to copy directory .
-a  # -r -p  recursive , Keep the properties of the file .
-i #  When copying, if there is a file with the same name , Tip whether to overwrite .
-r #  Recursively copying a folder , Will change the properties of the file .
-R #  Same as  r
-p #  Keep attributes when copying
-v #  Show the process when copying
-t #  Reverse the source and target  
-f #  Force copy 

Ways to mask aliases

unalias  command unalias cp
Using absolute paths /usr/bin/cp
\ command Use escape characters \cp
Escape character  \ :
Cancel symbols of special significance . 


mv- command

Usage: mv [OPTION]... [-T] SOURCE DEST
  or:  mv [OPTION]... SOURCE... DIRECTORY
  or:  mv [OPTION]... -t DIRECTORY SOURCE...
  
-i When a file with the same file name exists , Prompt whether to overlay the file .
-f mandatory
-t reverse
[[email protected] ~]# mv gong gong1
1、 If gong1 Directory exists , That's it gong File move to gong1 Under the table of contents .
2、 If it doesn't exist, change the name .
3、 If a file with the same name already exists, you will be prompted whether to overlay the file .
4、mv You can move the directory directly , No parameters required , Attributes don't change either .
5、 There is a directory and a file with the same name , You can't copy a directory to a file .


File deletion -rm

rm Delete directories and files
-d #  Delete directory is limited to empty directory
-r #  Recursive delete
-f #  Mandatory deletion
-i #  Ask when deleting , Every deleted file asks
-I #  Just ask once
-v #  Show the process of deletion
1、Linux There is no recycle bin , Pay attention when deleting .
2、 Don't add parameters when deleting files .
rm -f file
rm -fr /dir
rm -f file1*
rm -fr /tmp/
rm -fr /tmp*


System file view -cat

Usage: cat [OPTION]... [FILE]...
tac     #  You can display the file in reverse
-A # -vET.
-n #  According to the line Numbers .
-b #  Blank lines are not numbered
-e # -E -v
-E #  Show the ending with $  Mark .
-T # ^I  Mark... In the file tab key .
-t # -v -T
#  Write to a file
cat>>test.txt<<EOF
    AAA
    BBB
    CCC
EOF