Unix Command

Today I want to share some basic Unix commands I use recently in Putty.



  1. Directory: Direct the path to a certain location
    cd /...
    cd - {home directory}
    pwd {show current working directory}
  2. Files: List current files 
    ls {path}
    ls -l {date,size, permission}
  3. Check/Change Access: Read is 4. Write is 2. Execute is 1.
    ls -lah
    xyz(u,group,everyone else)
    readonly: chmod 444 *(a.file)
    write: chmod 644 *(a.file)
    everyone can read/write/execute chmod 777*
  4. Move directory
    mv {folder/old} {folder/new}
    *certain file type
    mv oldfolder/*.log newfolder/
  5. Zip/Unzip files
    cd /folder
    zip -r x.zip dir1
    unzip x.zip
  6. Execute SAS/Python code
    cd /..
    sas a.sas
    python a.py
  7. Copy/Delete files
    Copy: cp {foler/a} {folder/b}
    Delete: rm {folder/a}


  8. Make New Folders: Regular folder vs Root Dated Folder ( prevent accident delete )
    mkdir folder
    emb_makeprot folder(main) SNAPSHORT:subfolder(main/a) AVEND: subsubfolder(main/a/1) AVENDDT:datefolder(1/time)


    Thanks Yajnes and Grace share the Unix Code with me 🙂

    Happy Studying!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social media & sharing icons powered by UltimatelySocial
%d bloggers like this: