File Management command on Linux what are its common usage and its associated example shows

Directory management command
ls: list the contents of the specified directory format:
 LS [the OPTION] ... [the FILE] ...   
  -a: Show hidden files include all files   
  of all files except the display and the ..: -A.   
  -l, - long: displays detailed property information file   
  -h: file size unit conversion, may affect the accuracy   
  -d: look at a directory, rather than its internal file   
  -r: reverse display file   
  -R: recursively display files
  example: ls -lah / - detailed display all files in the / directory (including hidden files)   
  LS -ldh / etc - detailed display / etc directory itself   
  ls -lhv / - reverse displays all files / directories (including hidden file)   
  LS -R & lt / etc - recursively all the files in / etc
  
mkdir: Create directory format:
 mkdir [the OPTION] dIRECTORY ... ...  
  -p: parent directory is automatically created on demand   
  -m: when creating the directory given permissions
   example: mkdir -p / data / test / A / B - recursively create / test / A / B three directory under / data directory   
      mkdir -m 711 -p / data / MODE / A - in / data directory a specified directory permissions recursively at the same time create MODE / a directory for the two 711
rmdir: Delete directory format:
 rmdir [the OPTION] DIRECTORY ... ...   
   -p: After deleting parent directory if the directory is empty, be deleted
    Example: rmdir -p / data / test / A - Delete Directory A after, test directory is empty, be deleted
    
cd: Change directory
 examples: cd ..: switch to the parent directory   
    cd ~: switch back to your home directory   
    cd -: a directory in the current directory with direct switching back and forth
pwd: Displays the current directory
(2) file management commands -
cp: copy
 formats: single-source copy: cp [OPTION] ... [-T ] SOURCE DEST ( DEST if it does not exist to create, there is the cover)
    multi-source copy: cp [OPTION] ... SOURCE ... dIRECTORY (DEST must directory)
        -i: interactive replication, i.e., to remind the user to confirm the front cover   
        -f: force overwrite the destination file  
        -r, -R: recursive copy directories
        example: cp -if / data /[1-3].txt / data / test --test must be a directory, copy the three files together into the Test   
        cp -r / data / practice - to copy content to practice together in the data directory and directory
      
Music Videos: cut
 format: single copy source: mv [OPTION] ... [-T ] sOURCE DEST ( DEST does not exist if created, the presence of the cover)   
 multi copy source: mv [OPTION] ... sOURCE ... dIRECTORY (DEST must directory)   
         -i: interactive replication, i.e., to remind the user to confirm the front cover   
      -f: mandatory coverage destination file
      example: mv -i /data/[1-3].txt / practice - the / data directory txt file to cut down three / practice at
     
rm: delete
 Format: RM [OPTION] ... FILE ...   
        -i: interactive copy, to remind the user to confirm before Overwrite   
     -f: Force overwrite the destination file   
     -r, -R: recursive processing, will develop all the files in the directory include directory be deleted
     example: rm -rf / practice - recursively delete / practice directory
    
(3) text management command
cat: forward to see what text
 format: CAT [OPTION] ... [FILE] ...   
     -n: number of lines of text to display   
     -E: display symbol $ end of line
     example: cat -n / etc / fstab - View / etc / fatab content and display line numbers
    
tac: flashback to see what text
 format: tac [OPTION] ... [the FILE] ...
 example: tac / etc / passwd - flashback See text
 
head: displaying text, the line head 10 is the default display
 format: head [the OPTION] ... [the FILE] ...   
    -n #: display text header row of content #
    example: head -5 / etc / passwd - display / etc / passwd file header row of content 5
    
tail: displaying text, line 10 after the default display
 format: tail [OPTION] ... [fILE ]. ..   
    -n #: # line after text display content   
    -f: view the file contents do not quit after the end of the tail, the new line-following display
    examples: tail -8 / etc / passwd - after / passwd file shows / etc 8-line content
    
more : split-screen display text content, each screen displaying a complete stop display
 format: More [Options] File [...]   
   Space key: the text next screen   
   Enter key: displays the next line of text content   
   b key: the text on a screen content   
   q key: quit
   
less: split-screen display text content, do not take the initiative to quit
 the format: less [Options] File [...]   
 Space key: the text next screen   
 Enter key: displays the next line of text content   
 b key: text displayed on a screen content   
 q key: exit

Guess you like

Origin www.cnblogs.com/mwd-123/p/11832283.html