Today I want to share some basic Unix commands I use recently in Putty.
- Directory: Direct the path to a certain location
cd /... cd - {home directory} pwd {show current working directory}
- Files: List current files
ls {path} ls -l {date,size, permission}
- 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*
- Move directory
mv {folder/old} {folder/new} *certain file type mv oldfolder/*.log newfolder/
- Zip/Unzip files
cd /folder zip -r x.zip dir1 unzip x.zip
- Execute SAS/Python code
cd /.. sas a.sas python a.py
- Copy/Delete files
Copy: cp {foler/a} {folder/b} Delete: rm {folder/a}
- 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!