Tuesday, October 22, 2013

Linux File Handling Commands

Linux File Handling Commands

MAN Command 

 • man <command>  ­ shows all information about the  command  

• <command> --­­help  ­ shows the available options  for that command  

File Handling commands 

• mkdir – make directories                                                                           

  Syntax: mkdir [OPTION] DIRECTORY...
  eg. mkdir divakar

• ls – list directory contents                                                                          

Syntax: ls [OPTION]... [FILE]...                                                        
eg. ls, ls ­l, ls  divakar

• cd – changes directories                                                                          

Syntax: cd [DIRECTORY]  
eg. cd divakar

• pwd ­  print name of current working directory                                      

Syntax: pwd    

• vim – Vi Improved, a programmers text editor                                       

Syntax: vim [OPTION] [file]...                                                           
eg. vim file1.txt  

• cp – copy files and directories                                                        

Syntax: cp [OPTION]... SOURCE DEST                               
eg. cp sample.txt sample_copy.txt                                              
      cp sample_copy.txt target_dir   

•mv – move (rename) files                                                            

Syntax: mv [OPTION]... SOURCE DEST                            
eg. mv source.txt target_dir                                                        
       mv old.txt new.txt

• rm ­ remove files or directories                                               

Syntax: rm [OPTION]... FILE...   
eg. rm file1.txt , rm -­rf some_dir  

• find – search for files in a directory hierarchy                         

Usage: find [OPTION] [path] [pattern]                             
eg. find file1.txt, find -­name file1.txt 

• history – prints recently used commands                                   

Usage: history 


No comments:

Post a Comment