ក្រុមការងារយើងខ្ញុំនិងខិតខំសិក្សារស្រាវជ្រាវចំនេះដឹងបន្ថែមទៀតសំរាប់លោកអ្នក សូមអរគុណសំរាប់ការគាំទ្រ !

2.4 Linux File & Folder Commands

2.4 Linux File & Folder Commands

1. cat: create & show file ( create file )
    
  #cat > a.txt  =  create new file with content
                          pass Ctril + D: Save & Exit
  #cat a.txt     =  view content file "a.txt"

2. head: view first lines of file

  #head -3 a.txt = display first 3 lines of file 

3. tail: view last line of file

  #tail -3 a.txt  =  show last 3 lines of file

4. grep: Search character in file

  #grep 'abc' a.txt  =  find character  'abc' in file 

5. mkdir: create directory ( create folder )

  #mkdir test  =  create directory name: test

6. cd: change directory

   #cd test   = create directory name: Test
   #cd ..      =  go back one directory
   #cd ../..   =  go back two directory
   #cd ~      =  go to home directory
   #cd /       =  change current directory to root directory ( ចូល user root )
7. pwd: show current working directory

   #pwd      = show current directory to root directory 

8. cp: copy file / folder

   #cp -r test1 test2  =  copy directory test1 to test2
   #cp a.txt test1      =  copy file a.txt to directory test1

9. mv: move/rename file/folder

   #mv a.txt test  =  move file a.txt to directory test
   #mv a.txt b.txt  =  rename file a.txt to b.txt 
   #mv test1 test11  =  rename directory test1 to test11

10. rm: remove file / folder

   #rm a.txt       =   remove file a.txt
   #rm -r test     =  remove folder test
 



EmoticonEmoticon