Thursday, September 26, 2013

Useful Linux commands

De/Compress


If you want to compress all the content in your current directory use:

zip -r  <zip_file_name>   .

If you want to decompress all the content in your zip file to given directory use:

unzip <zip_file_name>  -d <directory_name>


SCP

If you want to copy a file from your machine to remote machine specific directoy

scp <path_to_the_file_to_be_copied> <remote_machine_username>@<remote_machine_ip>:<full_path_to_destination>

If you want to copy a file from remote machine to your machine

scp <full_path_to_destination_in_local_machine> <remote_machine_username>@<remote_machine_ip>:<path_to_the_file_to_be_copied>


Share local files with others via simple HTTP Server with python

Go to directory where there is the file to be shared from terminal and type:

python -m SimpleHTTPServer

Now share local ip with others and they can download the file you shared with below link:

http://<ip>:8000/

No comments: