Tutorial 2 - Tutorial 2 In this tutorial, we are going to...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Tutorial 2 In this tutorial, we are going to learn some basic commands of Unix. We have two Unix servers to login: cs1.utdallas.edu cs2.utdallas.edu To login to any of these servers remotely, we can use any of the following two programs: For detail instructions on login, please refer back to Tutorial 1 . Some useful commands: The commands we will see in this tutorial are: which whereis type uname man printf script who lp od 1 . Locating commands: 1.1 The PATH: The shell maintains a variable named PATH in its own environment. PATH is set to a list of colon-delimited directories. We can view it by evaluating the $-prefixed variable with echo command: {cs2:~} echo $PATH /usr/local/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/usr/openwin/bin:/usr/dt/bin:/opt/bin:/us r/xpg4/bin: There are eight directories in the list. When we enter a command, the shell looks in each of these directories to locate the file with that name.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1.2 Three commands to get the clues: There are three commands that provide clues to the location of another command. 1.2.1 which: The which command tells us the directory that contains the command, and displays its pathname or alias: {cs2:~} which date Querying terminal. .. Terminal recognized as vt100 (Generic VT100) /usr/bin/date 1.2.2 whereis: The whereis command essentially does the same thing, but it locates the binary, source and manual page files for a command: {cs2:~} whereis date date: /usr/bin/date /usr/man/man1/date.1 The "whereis" command looks up a larger list than "which" command which just searches the PATH. 1.2.3 type: The command "type" can give us more clues about the command. Sometimes it may be the case that there is a file which has the same name as a command but when we execute the command the shell uses its built-in function. This is the case with "echo". {cs2:~} type echo
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/12/2009 for the course CS 3375 taught by Professor Kendracooper during the Fall '08 term at University of Texas at Dallas, Richardson.

Page1 / 6

Tutorial 2 - Tutorial 2 In this tutorial, we are going to...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online