Q & A Q & A Code

⨘ } Linux / Unix useful commands

1. compress and archive the directory / folder
tar -zcvf /home/folder.tar.gz /home/folder

z: compress archive using gzip program
c: create archive on linux
v: verbose, show progress on screen
f: archive file name

2. secure copy from remote server to local
scp user_name@ip_address:/home/folder/file /local_dir/copied_files/

3. secure copy from local to remote server
scp /local_dir/file user_name@ip_address:/home/folder/

4. disk usage
du -sh /home/folder/*
if you would like to sort the output
du -sh /home/folder/* | sort -h

 572 total views,  5 views today

Leave a Reply

Your email address will not be published. Required fields are marked *

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