Skip to content

Instantly share code, notes, and snippets.

@marianposaceanu
Created September 21, 2012 16:37
Show Gist options
  • Save marianposaceanu/3762529 to your computer and use it in GitHub Desktop.
Save marianposaceanu/3762529 to your computer and use it in GitHub Desktop.
unix_corner

Unix corner

Disk usage
df
Human readable file/folder size
du -hs /path/to/folder

-s: summary
-h: humanreadable
Recursive copy
cp -r source_DIR dest_DIR
Tar and untar
tar -zcvf prog-1-jan-2005.tar.gz /home/jerry/prog 

tar -zxvf prog-1-jan-2005.tar.gz or tar -zxvf prog-1-jan-2005.tar.gz -C /tmp

-z: Compress archive using gzip program
-c: Create archive
-v: Verbose i.e display progress while creating archive
-x: Extract files
-f: Archive File name
Change owner
chown username somefile 
chown username:usergroup somefile
chown -R username somedir
Symlink
ln -nfs [SOURCE] [DEST]
Crontab
crontab -l      View crontab file, if any
crontab -r      Remove crontab file, if any
crontab -e      Edit (or create) user's crontab file (starts the editor automatically)
crontab file    Replace existing crontab file (if any) with file
Find out where app or something is installed
locate java
which java
Simple SCP Command run from local linux
scp [email protected]:file_dump.sql /home/username/local/folder/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment