Suite101

Unix Basics


© Robin Friedman

There's plenty of ducumentation available on how to use any Unix program or feature for those who know how to get it; that's what the links section is for. But often the hardest part of Unix is just starting. So here I'll try and gently introduce you into basic commands and the directory system.

Unix was designed from the start as a multiuser platform. You'll probably run into it first with a shell account, which is an account on a server, or host computer. This allows you to 'use' the server, running programs on it, and storing files on it. If you have Linux or another Unix installed on your home computer, you'll have access to the 'root' account. Root can read, change, delete, or controll any file or program on the computer, and is only used by the owner of the system.

When you first connect to or start up a Unix system, you'll recieve a prompt asking for your username and password. Since theoretically hundreds of people could be using the computer at the same time, each one needs his own id. Your password is stored with a one-way encryption function, meaning nobody can decrypt it, they can only guess at it.

Once you've logged in, you should see a prompt looking something like this:

[yourusername@localhost yourusername]#

The yourusername@localhost is your account name and the host that you're connected to. The second yourusername is the directory, or folder that you're working in. Type ls to see all the files and folders inside the directory you're working in. That's similar to the DOS dir command. To change the directory you're working in, type cd followed by the directory you want to switch to. To move up a directory, meaning exit the current folder, type cd ..

Let me take a little time out here to explain the Unix directory system. Directories or files within directories are separated by a forward slash ( / ). Home directories are stored in the /home directory, except for root, which is in /root. The main folders usually include /home, /bin, /dev, /lib, /etc, /usr, /boot, and more. All files and other folders are stored within these and a few other main directories. Most users only deal with /home, where in their home directory they can store their files, and /usr, where programs and other files are found. Although /bin contains most programs, the average user doesn't need to visit /bin to use them.

Go To Page: 1 2


The copyright of the article Unix Basics in Linux/Unix is owned by . Permission to republish Unix Basics in print or online must be granted by the author in writing.

Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo