Search Topics....

Monday, July 16, 2012

UNIX Commands


Directory and File Commands

    Command                     Description
    
    cd d                         Change to directory called "d"
    
    mkdir d                      Create new directory called "d"
    
    mv f1 [f2...] d              Move file "f" to directory called "d"
    
    mv d1 d2                     Rename directory d1 as d2
    
    ls                           List files in directory
    
    ls -1  filename              List files in detail
       -a  filename              Display of hidden files
       
    cat  filename                List contents of file
    
    more  filename               List file contents by screen
    
    chmod mode filename          Change permission(r/w/x) of file
    
    cp f1 f2                     Copy file f1 into f2
    
    sort filename                Alphabetically sort file called "f"
    
    mv f1  f2                    Rename file f1 as f2
    
    rm f                         Delete (remove) file f
       -r filename               Delete (remove) file f recursively
          dirname                Delete (remove) directory recursively
    
    rmdir dirname                Delete (remove) directory(if given 
                                 directory is empty)

No comments: