Getting Started

1.1 Logging in

Before you can log into any of the systems you must have an “account.” You can use one of the terminal programs (e.g., Terminal.app on macOS, putty on Windows, ssh in Cygwin, Linux terminal, etc, not a web browser!).

   % ssh ladera.eecs.uci.edu -l yourUserName

If you connect to the server without providing a user name, it will prompt you for it:

   userName@ladera.eecs.uci.edu's password:

or simply (if you log on to newport.eecs.uci.edu)

   password:

the userName part will be substituted with the user name of the account on your local machine.  It may or may not be the same as your user name on the server.  That is why you may need to specify your user name on the server explicitly using the -l userName flag.

Your password will not be echoed on the terminal as you type it.

If you have entered either your login name or your password incorrectly, a login incorrect message will appear on your terminal, and you will have to repeat the login/password sequence.

When you have entered both your login name and password correctly, you will see a message giving the time of your last login.

 

This is what you may see when you log on to ladera:

Welcome to Ladera

                           N O T I C E
                           -----------

   Long running jobs (more than 10 minutes) OR CPU intensive processes
   must be run with "DQS" or "nice -19'.

   Large, resource intensive (memory, CPU) can only be run one at a
   time.  Examples include synopsis, spectre, icfb.exe, hspice, virtuoso.

   *NOTE* DO NOT RUN LARGE PROCESSES ON MORE THAN ONE EECS SERVER

   Consequences of not following this include having them reniced,
   stopped, or killed.

   Please report problems with this system to Distributed Computing
   Support (DCS), at extension 8383 or via e-mail to DCS@UCI.EDU.

   SERVER INFORMATION: https://newport.eecs.uci.edu/

   SYSTEM RULES: http://newport.eecs.uci.edu/server-pages/rules.html

If this system is busy, consider a less loaded one below:

Sun SPARC servers:
vivian.eecs.uci.edu      up  18 days, 13:07,    load average: 0.06 0.04 0.04
malibu.eecs.uci.edu      up  47 days, 16:28,    load average: 0.44 0.37 0.47

Linux Intel servers:
crystalcove.eecs.uci.edu up  18 days, 13:57,    load average: 0.81 0.34 0.22
zuma.eecs.uci.edu        up  18 days, 14:52,    load average: 0.00 0.02 0.12
ladera.eecs.uci.edu      up  19 days,  6:46,    load average: 1.00 1.00 1.00

ladera% _

If you log on to a Sun Sparc server, you may see the following:

                           N O T I C E
                           -----------

   Long running jobs (more than 10 minutes) OR CPU intensive processes
   must be run with "DQS" or "nice -19'.

   Large, resource intensive (memory, CPU) can only be run one at a
   time.  Examples include synopsis, spectre, icfb.exe, hspice, virtuoso.

   *NOTE* DO NOT RUN LARGE PROCESSES ON MORE THAN ONE EECS SERVER

   Consequences of not following this include having them reniced,
   stopped, or killed.


   Please report problems with this system to Distributed Computing
   Support (DCS), at extension 8383 or via e-mail to DCS@UCI.EDU.

   SERVER INFORMATION: https://newport.eecs.uci.edu/

   SYSTEM RULES: http://newport.eecs.uci.edu/server-pages/rules.html


                           N O T I C E
                           -----------

   Long running jobs (more than 10 minutes) OR CPU intensive processes
   must be run with "DQS" or "nice -19'.

   Large, resource intensive (memory, CPU) can only be run one at a
   time.  Examples include synopsis, spectre, icfb.exe, hspice, virtuoso.

   *NOTE* DO NOT RUN LARGE PROCESSES ON MORE THAN ONE EECS SERVER

   Consequences of not following this include having them reniced,
   stopped, or killed.


   Please report problems with this system to Distributed Computing
   Support (DCS), at extension 8383 or via e-mail to DCS@UCI.EDU.

   SERVER INFORMATION: https://newport.eecs.uci.edu/

   SYSTEM RULES: http://newport.eecs.uci.edu/server-pages/rules.html

system -- 62 items unseen
If this system is busy, consider a less loaded one below:
vivian.eecs.uci    up 18 days, 13:11,    load average: 0.03, 0.04, 0.04
malibu.eecs.uci    up 47 days, 16:32,    load average: 0.23, 0.29, 0.42
newport.eecs.uc    up 47 days, 16:32,    load average: 0.23, 0.29, 0.42

malibu%

 

   malibu%

The culmination of your login efforts is a “prompt character,” a sign that indicates that the system is ready to accept commands from you. The prompt character is the percent sign, %, unless you’ve customized it. If you are running bash, then the prompt character is $ by default. 

1.2 Typing Commands

Once you’ve seen the prompt character, you can type commands, which are requests that the system do something.

Commands are practically always typed in lower-case. Typing “date” followed by the Return key will produce something like

    % date
    Mon Sep 16 13:57:55 PST 2015

After any system command, you must press Return . The Return key won’t be mentioned again, but it has to be there at the end of each line.

If you make a mistake typing the command name, and refer to a non-existent command, you will be told. For example, if you type “daze” you will be told

    % daze
    daze: Command not found.

Of course, if you inadvertently type the name of some other command, it will run, with more or less mysterious results.

Unix commands usually take the form:

    command -options ‘filename’

where “-options” is a list of the options as shown on the manual page, and ‘filename’ is the name of the file upon which you want the command to act. The list of options is usually preceded by a “-”. You will not have to specify options or file names with all commands. Options are usually single letters which will change the default behavior of a program.

1.3 Mistakes in Typing

If you make a typing mistake, and see it before Return has been entered, there are two ways to recover. The

Del

 (Delete) key (sometimes labeled RUBOUT ; PC users should use the Backspace key) erases the last character typed; in

fact, successive uses of Del erase characters back to the beginning of the line (but not beyond). If you want to erase ALL the characters you have entered on the current line, press CTRL-U (which signifies the simultaneous depression of the Ctrl and U keys) and start the line again. Typing CTRL-W will erase one word at a time.

1.4 Strange Terminal Behavior

Sometimes, particularly when you first log in, your terminal may act strangely. For example, each letter may be typed twice, or Return may not cause a line feed or a return to the left margin. This might well be caused by your having designated the wrong terminal type while logging in. The easiest way to remedy the situation is to log out and log back in again. If your terminal is so messed up that you cannot even type a “logout”, press the Line Feed key, type “reset”, and press Line Feed again (don’t worry if you can see “nothing” on the terminal while you are doing this). If you don’t have a Line Feed key on your terminal, type CTRL-J .

1.5 Read-ahead

Unix has full read-ahead, which means that you can type as fast as you want, whenever you want, even when some command is typing at you. If you type during output, your input characters will appear intermixed with the output characters, but they will be stored away and interpreted in the correct order. So you can type several commands one after another, without waiting for the first to finish or even begin.

1.6 Stopping a Program

You can “abort” most programs by typing CTRL-C . In a few programs, like the vi text editor, CTRL-C stops whatever the program is doing but leaves you in that program.

1.7 Logging Out

You log out of a terminal session by typing “logout”.
If your logout is successful (see below), you will see a message indicating that, a message inviting you to login (again), some garbage or even nothing at all (that is, no familiar %). There are two “hindrances” to logging out that you may encounter. Both appear as a message after you have typed “logout”. The first of these is

    % logout
    There are stopped jobs.
    % _

This message occurs when you attempt to “logout” or “exit” a shell and have one or more suspended jobs. The system doesn’t want you to log out or exit the shell and kill the jobs unless you mean to. You can do a couple of things in response to this message. Use of the “jobs” command will tell you what job(s) you have suspended. You can choose to continue the job(s) in the foreground or background, and then log out, or, if you don’t care if they terminate, you can just type “logout” again. Typing “logout” a second time with or without an intervening “jobs” command will result in logout and the termination of all suspended jobs.

A second possible message at logout is

    % logout
    Not login shell.
    % _

As the shell can be invoked recursively, you can be “in” an instance of the shell that is not the one that was started when you first logged in. You must, however, be executing this login shell to log out. To terminate a shell execution, enter a CTRL-D sequence or type “exit”. An additional “%” prompt character will appear on the terminal for every shell termination you effect by a CTRL-D or “exit”. When you are in your original login shell, a CTRL-D will result in the message Use “logout” to logout. At this point, simply do what the message says! If you type “exit” when you are in your login shell, you will be logged out! 

1.8 Password Maintenance

The “passwd” command can be used to change the password associated with your login name. To invoke it, type “passwd”.

“passwd” will prompt you for your existing password, and then for the new one. The new password must be typed twice. Passwords must be at least six characters long. You should be very careful when choosing a password. It should never be something that would be easily guessed such as your name, your phone number, or the name of your best friend. Choose a “word” that is not in the dictionary. People have been known to write programs to guess passwords by trying every word in the on-line dictionary. Your best bet is to take two short words, such as “blue” and “cat” and put them together to make the password bluecat. This is relatively easy to remember, yet not vulnerable to a dictionary attack. To be extra secure, throw in a random upper-case character: bluEcat. This will be next to impossible to guess. You can also use numbers and non-alphanumeric characters such as * % $ # etc. Also:

  • Never tell your password to anyone else.
  • Never write your password down.
  • If you suspect that someone knows your password, change it immediately.

1.9 On-line Manual

Volume 1 of the UNIX Programmer’s Manual is kept on-line. This is a collection of files (one for each program) that tell you how to use all the different Unix programs. If you get stuck on something, you can look at some manual sections which might help. This is also useful for getting the most up-to-date information on a command. To print a manual section, type “man command-name”. Thus to read up on the “comp” command, type:

    % man comp

and, of course,

    % man man

tells about the “man” command. 2.1.10 Files

A file can be thought of as something which contains data. This “data” can be the source of a program you’re writing, the text of a document like this one, or any other collection of characters (such as directory information or executable code). A file always has a name associated with it which can be up to 255 characters long. Files are usually created with text editors.

A directory is a file containing information about other files and directories. A directory which is found “within” another directory is called a “subdirectory” and can contain even more subdirectories. A Unix file system is like a tree with a root (the “/” directory) and many branches (subdirectories).

When an account is created for you, you are assigned a “home directory”. This is where you will find yourself every time you log in. If you were to type “pwd” (print working directory) after you logged in, you would see something like this:

    % pwd /users/admin/jsmith

which is the name of your “working directory” and the full “pathname” to your files. In this example, directory names are separated by “/”s. The pathname describes where your files are in relation to the total file system. When you create files, they will be “under” your home directory and their pathnames will look like this:

    ‘/users/admin/jsmith/mklogin.c’
    ‘/users/admin/jsmith/junk’

​The “ls” (for list) command lists the names (not contents) of all the files in the current directory. (more on

directories later)
The names are sorted into alphabetical order automatically, but other variations are possible. For example, the

command “ls -t” causes the files to be listed in the order in which they were last changed, most recent first. The “-l” option (that’s the letter l, not the digit 1) gives a long listing. “ls -l” will produce something like:

% ls -l
total 2
-rw-r--r-- 1 jsmith 205 Jan 30 11:24 myfile -rw-r--r-- 1 jsmith 76217 Jan 31 11:23 temp
%_

The date and time are of the last change to the file. The number before the date indicates the number of characters. The owner of the files, that is the person who created them, is jsmith. The -rw-r--r-- tells who has permission to read and write the file; in this case, the owner can read and write the files, but everyone can read them. 

Options can be combined: “ls -lt” gives the same thing as “ls -l”, but sorted into time order (i.e., the most recently modified files are listed first). You can also name the files you’re interested in, and “ls” will list the information about only them.

The use of optional arguments that begin with a minus sign, like “-t” and “-lt”, is a common convention for Unix programs. In general, if a program accepts such optional arguments, they precede any filename arguments. It is also vital that you separate the various arguments with spaces: “ls-l” is not the same as “ls -l”.

The “ls” command doesn’t normally list files whose names begin with a dot (or period), such as ‘.login’, ‘.cshrc’, and ‘.bash_profile’. If you want these files listed, include the “-a” option, as in “ls -a”.

So far we have used filenames without ever saying what’s a legal name, so it’s time for a couple rules. First, filenames are limited to 255 characters, which is enough to be descriptive. Second, although you can use almost any character in a filename, common sense says you should stick to ones that are visible, and that you should probably avoid characters that might be used with other meanings. We have already seen, for example, that in the “ls” command, “ls -t” means to list in time order. So if you had a file whose name was “-t”, you would have a tough time listing it by name. Besides the minus sign, there are other characters which have special meaning. To avoid pitfalls, you would do well to use only letters, numbers and the period until you’re familiar with the situation. Note that there is a difference between upper- and lower-case letters in filenames. In this document, all filenames will be in lower-case.

There are special files, usually in your home directory, whose names start with a period (.). These files are not listed when you use the “ls” command unless you use the “-a” option. Filenames which begin with a comma (,) are removed automatically every night. Files beginning and ending with a sharp sign (#) are created by the GNU Emacs editor as temporary files and are deleted after three days.

1.11 Subdirectories

It is a good idea to create your own subdirectories in which to organize your files. This will make managing your files much easier. Let’s say you want to make a directory ‘src’ in which to put all the files containing sources of programs you have written. You type

    % mkdir src

to create the subdirectory named ‘src’, and move the files into it by typing

    % mv *.c src

which will move all the files with a ‘.c’ extension to the ‘src’ area. Now if you type “ls -l” you should see something like this:

% ls -l total 3 -rw-r--r-- 1 jsmith -rw-r--r-- 1 jsmith drwxr-xr-x 2 jsmith
56732 Apr 1 14:51 junk 1684 Apr 2 14:50 temp
24 Apr 2 14:50 src

If you wish to move to your source directory, you can use the “cd” (change directory) command:

    % cd src

Now your current directory is ‘/users/admin/jsmith/src’. Any files you create will be in this directory. You can move to the directory immediately above you by typing:

    % cd ..

If you use the “cd” command without any argument, you will be put back into your home directory. Another time saver in naming files is the use of the tilde (~). You can use this to prefix a user’s home directory instead of typing out his full pathname. For example, to get a listing of the files under Fred Rated’s directory, you can type “ls ~frated” rather than “ls /users/admin/frated”.

A tilde without a username refers to your own home directory, so you can type “ls ̃” to get a list of the files in your own home directory no matter what directory you may be in.

To remove the directory ‘src’ (assuming that your current working directory is /users/admin/jsmith) type:

% rm src/*
% rmdir src

The first command removes all files from the directory; the second removes the now-empty directory. (You can’t delete a directory unless it’s empty.) 

Scholarly Lite is a free theme, contributed to the Drupal Community by More than Themes.