UNIX Introduction

Unix Introduction

 

Table of Contents


Getting Started with UNIX

UNIX basics

Unlike many personal computing environments you may be used to, UNIX is case sensitive. That is, lowercase and uppercase letters are distingushed from one another. If you have problems logging in or entering commands you may have accidently inserted uppercase letters. Also, make sure your CAPS LOCK key is not engaged.

UNIX is a multi-user environment.

Logging In

To access your UNIX account from a Windows machine, locate, and double-click the “SSH” icon.

First, you’ll have to click on the computer icon or select Quick Connect from the File menu. An example of the actual login procedure is as follows:

Host Name: machine@cs.fsu.edu
User Name: yourusername
Authentication: Password

When you press Connect you will be prompted for your password. Enter it here, now.

Remember that both your userid and password are case sensitive. A list of machines may be found here.

Logging Out

To log out of a UNIX machine type “logout” or press CONTROL-d at the prompt

% logout

OR

% CTRL-d

UNIX Directories

To change directory, use the command “cd”. If you type “cd” with no arguments, you will be put in your home directory. The command “pwd” will display the name of the current directory.

UNIX Commands

Listing Files and Directories
When you login, you will be placed in your home directory. To get a listing of the files and directories contained within, type

ls

To list the contents of another directory, you can either “cd” to it and type “ls”, or you can simply supply the directory name as an argument. For example: “ls /etc”, would list the contents of the directory /etc.

Creating a Directory
If you are in a directory for which you have write permission, you can create one or more sub-directories using the “mkdir” command. Examples:

mkdir thesis
mkdir private.stuff letters milkdud

Erasing Files
The command “rm” is used to erase files and sometimes directories. By default, it does not ask for conformation before wiping out exactly what you tell it to. For example, this command would erase all files ending in `.o’, and `.out’:

rm *.o *.out

But be careful, the following command would remove all files in the current directory:

rm *.o * .out

You can remove a directory that you own with the “rmdir” command. The directory must be empty before it can be removed. Use the “ls -a” command to make sure you have removed any hidden files.

File Manipulation

Most of the operating system commands in UNIX manipulate files; some of the most common ones are:

more     view file(s), stopping for each page
cp       copy file(s)
mv       move file(s)

Viewing Files
The command “more” will display a file or files one video page at a time. Use the space bar to move on to the next page; use the return key to scroll one line at a time. There are a bunch of other useful functions built into “more”, such as searching for the next occurrence of a string, and scrolling backwards. Note that many programs will automatically use “more” to display files to the user. Examples:

more /etc/motd
more /usr/lang/pascal/docs/readme

Copying, Moving, and Renaming Files
You can copy a file with the “cp” command. You can move a file with the “mv” command. You can also use these commands recursively, to copy and move directories (see their man pages for details). Note that the “mv” command is also used to rename files (by `moving’ them to their new name). Examples:

cp .login .login.backup
mv .cshrc /tmp/mybackups
mv first-try.c bad-idea.c

Online Manuals

The command “man ” will display the man page for that command. By default, “more” will be used to display it, so you can use any of the movement and searching options it offers.

Email: A Section for Everyone

The CS department has three mail programs which can be used from the machine in which your home directory is stored (e.g. shell). Both Pine and Elm are menu-driven and fairly simple but if problems arise, consult the email information page, or the man pages. Also, the ACNS webpage has both Pine and Elm tutorials.