Mohsin Sumar Zend Certified Engineer, PHP Professional, Designer & Web Developer

24Nov/090

How do I extract a tar file?

Using the following command in SSH, you will be able to extract files from your tar file.

tar -xf file.tar 

22Nov/090

How to tar a file using SSH?

Use the following command if you want to create a tar and compress a file (or folder).

tar -czf /path/to/save/file.tar folder_or_file_name

The options used in the above command are outlined below for your understanding.

-c = create
-z = compress a file
-f = use the file mentioned instead of tape drive

14Nov/090

SSH ls pagewise or limit long output

If your SSH ls command output is really long, and cannot be viewed on screen - you can use the following command to part of it with a more command to continue down the list.

ls [options here] | more

Example:-

ls -l | more

27Sep/090

SSH Commands to find files on Linux Server

If you have a dedicated server or a VPS - or any Linux machine with SSH access, the following commands may be useful to you if you are looking to find some files quickly. PuTTY is a good telnet/SSH client if you don't already have one. Let's get started.

#1: If you are looking for a particular file in /home directory

find /home -name filename

#2: If you are looking for files whose name is starting with "filename" in public_html directories only, you can use the following command:-

find /home/*/public_html -name filename* 

#3: Instead of viewing your search results in command line, you can write it to file by using this:

find /home/*/public_html -name filename* > /home/filename_search.txt

#4: Alternatively, you can send it via e-mail directly from server using the command below. Don't forget to replace "Subject Here" with your email subject, and "email.address@domain" with your email ID.

find /home/*/public_html -name filename* |mail -s "Subject Here" e-mail.address@domain

I hope this was useful.