Using SSH and Unix commands

Having some basic knowledge of SSH and Unix commands is very useful. Developed in 1995, SSH (Secure Shell) was created as a secure alternative to Telnet. Telnet is a protocol allowing for command line access to a Unix, Linux or FreeBSD based remote computer. I’ve listed some basic commands to get you familiar with them.

The cd command is used to move to a specific directory.

The cp command will copy the file or folder from the source, to the destination.

mkdir creates a directory.

The rmdir command deletes a directory.

The rm command deletes a file.

The mv command will rename or move a file stated in the first portion to the name or location stated in the second portion.

This command will tar zip the files in the directory specified in the second portion into a tar file specified in the first portion.

The tar -xvf will extract all files from the tarball specified into the directory you are currently in.

This will create a zip file, with the name specified in the first portion from the file or directory listed in the second portion.

This command will unzip or un pack the named zip file, into the directory you’re currently in.

The Ls command lists files, and folders within the directory you specify

This will add a forward slash to the directory names within the directory you specify

This will show “hidden” files in the directory you specify

This command shows detailed info about each file in the directory you specify.

Also, a lightweight, freeware application which supports SSH commands for windows isย PuTTYย if you aren’t on a MAC.

8 thoughts on “Using SSH and Unix commands”

  1. Hi,

    my two cents in your post:

    – cp: to copy also directories you must use the -r attribute, otherwise you get an error.

    – mkdir: a tip… if you use -p attribute you can create all the tree ๐Ÿ˜‰

    – rmdir: remove an empty directory… if you want to remove a not empty directory you’ll use the rm -Rf /path/to/remove.

    – Ls is a ‘typing error’… i think ๐Ÿ™‚

    I hope you find my comment useful ๐Ÿ™‚



  2. Wow, huge thanks! I’m still learning some Unix/terminal commands to get a better functionality out of my mac; I’m somewhat familiar with cp and cd as I’ve used them, but this is definitely getting a bookmark.

    Putty is nice too; I used it while I was still on Windows.

  3. Very good post! It will be helpful with the configuring I do of Ubuntu boxes for clients!

    Question though….I have some boxes that when I remotely run the ls -al command through SSH that return blank information. I have to log into the boxes to check the status of updates. All the boxes happen to be Ubuntu 8.10. Is there something in SSH and it’s key that may be causing it?

Leave a Reply

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