Quickstart for Unix
This past week I was suddenly thrown into doing some work in Solaris. My task was to install some server software. Solaris is a Unix based system so this meant that I had to learn Unix quickly.
I've taken courses in college related to Unix and Linux based systems but as with anything, in a classroom you only do enough to pass the course but not as much as you would in a real world environment.
Moving around the Unix command line and inspecting and modifying files was a bit painful but after a little bit of practice I was able to get through it.
Here are some of the hurdles I ran into and some of the resources that I found to get over them.
The Unix Command Line
In Solaris the command line is anything but unavoidable. Solaris has a GUI but if you want to do anything significant the command line is the way. The command line will help you move around the folder structure. It will help you move and manipulate files and execute shell scripts that may be part of software your need to install or run.
I found this tutorial: Unix in 10 Minutes invaluable. You can literally learn Unix in 10 minutes with this tutorial. After those 10 minutes, you can use it as a reference or cheat sheet.
The VI Editor
You can view the contents of text files right from the command line using commands such as cat, more and less. Those commands are good for reading but what if you need to modify a shell script or a code file? For that you will need to use the VI editor. My recommendation before you start modifying files in VI is this:
1. Back up the file that you will be modifying before you begin editing. If you don't back up your file you can really screw up the file and there will be no going back. To back up the file look up the copy command in the Unix command line tutorial. It goes something like this:
$:cp myfile.txt myfile.backup.txt
If you find that you did screw up the file, you can always recover it since you made a back up.
2. Take this course: Using the VI Basics on youtube and practice a significant bit before you start modifying any files. This was a very painful process for me until I started getting the basics of VI. I had to force quit out the file many times because I would screw up the file and not know what I had changed in the file.
3. Once you have taken the course you can use this Cheat Sheet to help you along once you start using the VI editor.
The resources above got me moving rather quickly. Hopefully the will the same for you. With these few tools you should know enough to get you moving quickly through the Unix command line.