Saturday, October 8, 2011

Unix Tutorial Eight

8.1 UNIX Variables                   Variables are a way of passing information from the shell to programs when you run them. Programs look "in the environment" for particular variables and if they are found will use the values stored. Some are set by the system, others by you, yet others by the shell, or any program that loads another program.                    Standard UNIX variables are split into two categories, environment variables and shell variables. In broad terms, shell variables apply only to the current instance of the shell and are used...

Unix Tutorial Seven

7.1 Compiling UNIX software packages                We have many public domain and commercial software packages installed on our systems, which are available to all users. However, students are allowed to download and install small software packages in their own home directory, software usually only useful to them personally. There are a number of steps needed to install the software. Locate and download the source code (which is usually compressed) Unpack the source code Compile the code Install the resulting executable Set paths to the installation directory Of the above steps, probably the most difficult...

Unix Tutorial Six

Other useful UNIX commands quota                All students are allocated a certain amount of disk space on the file system for their personal files, usually about 100Mb. If you go over your quota, you are given 7 days to remove excess files. To check your current quota and how much of it you have used, type % quota -v df                 The df command reports on the space left on the file system. For example, to find out how much space is left on the fileserver, type % df . du                 The du command outputs the...

Unix Tutorial Five

5.1 File system security (access rights)            In your unixstuff directory, type % ls -l (l for long listing!)            You will see that you now get lots of details about the contents of your directory, similar to the example below.             Each file (and directory) has associated access rights, which may be found by typing ls -l. Also, ls -lg gives additional information as to which group owns the file (beng95 in the following example): -rwxrw-r-- 1 ee51ab beng95 2450 Sept29 11:52 file1 In the left-hand column is a 10 symbol string consisting...

Unix Tutorial Four

4.1 Wildcards            The characters * and ? The character * is called a wildcard, and will match against none or more character(s) in a file (or directory) name. For example, in your unixstuff directory, type % ls list* This will list all files in the current directory starting with list.... Try typing % ls *list This will list all files in the current directory ending with ....list The character ? will match exactly one character. So ls ?ouse will match files like house and mouse, but not grouse. Try typing % ls ?list 4.2 Filename conventions                  ...

Unix Tutorial Three

 3.1 Redirection                Most processes initiated by UNIX commands write to the standard output (that is, they write to the terminal screen), and many take their input from the standard input (that is, they read it from the keyboard). There is also the standard error, where processes write their error messages, by default, to the terminal screen. We have already seen one use of the cat command to write the contents of a file to the screen. Now type cat without specifing a file to read % cat Then type a few words on the keyboard and press the [Return] key. Finally hold the [Ctrl] key down...

Unix Tutorial Two

2.1 Copying Files cp (copy) cp file1 file2 is the command which makes a copy of file1 in the current working directory and calls it file2 What we are going to do now, is to take a file stored in an open access area of the file system, and use the cp command to copy it to your unixstuff directory. First, cd to your unixstuff directory. % cd ~/unixstuff Then at the UNIX prompt, type, % cp /vol/examples/tutorial/science.txt . (Note: Don't forget the dot (.) at the end. Remember, in UNIX, the dot means the current directory.) The above command means copy the file science.txt to the current directory, keeping the name the same. (Note: The directory...

Unix Tutorial One

1.1 Listing files and directories ls (list)                       When you first login, your current working directory is your home directory. Your home directory has the same name as your user-name, for example, ee91ab, and it is where your personal files and subdirectories are saved.                      To find out what is in your home directory, type % ls (short for list)                      The ls command lists the contents of your current working directory. There may be no files visible in your home directory, in which case, the UNIX prompt will be returned. Alternatively, there may already be some files inserted by...
Page 1 of 3123Next
 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Hostgator Discount Code