|
|
|
|
|
|
|
|
|
|
|
Getting Started
|
|
|
Before you can begin to use the system you will need to have a valid username and a password. Assignment of usernames and initial passwords is typically handled by the System Administrator. Your username, also called a userid, should be unique and should not change. Initial passwords can be anything and should be changed after your first login. |
|
|
|
|
|
Logging into Unix
|
|
|
When you connect to a UNIX computer remotely (using telnet) or when you log in locally using a text-only terminal, you will see the prompt: |
|
|
|
|
|
login: |
|
|
|
|
|
At this prompt, type in your usename and press the enter/return/ key. Remember that UNIX is case sensitive (i.e. ASIC and asic are all different logins). You should then be prompted for your password: |
|
|
|
|
|
login: deepak |
|
|
password: |
|
|
|
|
|
Type your password in at the prompt and press the enter/return/ key. Note that your password will not be displayed on the screen as you type it in. |
|
|
|
|
|
If you mistype your username or password you will get an appropriate message from the computer and you will be presented with the login: prompt again. Otherwise you should be presented with a shell prompt which looks something like this: |
|
|
|
|
|
$ |
|
|
|
|
|
To log out of a text-based UNIX shell, type "exit" at the shell prompt (or if that doesn't work try "logout"; if that doesn't work press ctrl-d). |
|
|
|
|
|
This days all the Unix systems are GUI based and are very easy to start with them. |
|
|
|
|
|
Changing password
|
|
|
Your password is important, it stops other users from gaining access to your account. Never give your password to anyone. You should change your initial password very soon after your first login. To change your password: enter the command passwd and then respond to the prompts by entering your old password followed by your new one. You are then asked to retype your password for confirmation. |
|
|
|
|
|
Note that what you type will not appear on the screen for security reasons. For example: |
|
|
|
|
|
%passwd
Old password: - enter your current password
New password: - enter your new password
Retype new password: - re-enter your new password
|
|
|
|
|
|
If you make a mistake, the message: Mismatch - password unchanged. is displayed and your password remains unchanged. Try again. |
|
|
|
|
|
General format of UNIX commands
|
|
|
A UNIX command line consists of the name of a UNIX command (actually the "command" is the name of a built-in shell command, a system utility or an application program) followed by its "arguments" (options and the target filenames and/or expressions). The general syntax for a UNIX command is |
|
|
|
|
|
$ command -options targets |
|
|
|
|
|
Here command can be though of as a verb, options as an adverb and targets as the direct objects of the verb. In the case that the user wishes to specify several options, these need not always be listed separately (the options can sometimes be listed altogether after a single dash). |
|
|
|
|
|
|
|
|
|
|
|
Special Characters
|
|
|
The UNIX shell interprets a number of characters in special ways. These characters are most often used with UNIX commands - as arguments and for other means. The following list contains most of UNIX's special characters |
|
|
|
|
|
Character
|
Description
|
NEWLINE
|
initiates command execution
|
;
|
separates commands on same line
|
( )
|
groups commands or identifies a function
|
&
|
executes a command in the background
|
|
|
pipe
|
>
|
redirects standard output
|
>>
|
appends standard output
|
<
|
redirects standard input
|
*
|
wildcard for any number of characters in a file name
|
?
|
wildcard for a single character in a file name
|
\
|
quotes the following character
|
'
|
quotes a string preventing all substitutions
|
"
|
quotes a string allowing variable and command substitution
|
`
|
performs command substitution
|
[ ]
|
denotes a character class in a file name
|
$
|
references a variable
|
{ }
|
command grouping within a function
|
.
|
executes a command (if at beginning of line)
|
#
|
begins a comment
|
|
|
|
|
|
|
Example : *
|
|
|
Use the * character in file names to match any number of characters. The following command: |
|
|
ls *.txt |
|
|
Will match the following files: |
|
|
chapter1.txt doc.txt memo.txt a.txt |
|
|
Will not match the following files: |
|
|
doctxt txt.memo |
|
|
|
|
|
Example : ?
|
|
|
Use the ? character in file names to match any single character. The following command: |
|
|
ls ???.txt |
|
|
Will match the following files: |
|
|
one.txt doc.txt two.txt |
|
|
Will not match the following files: |
|
|
chap1.txt doctxt |
|
|
|
|
|
Terminal Control Keys
|
|
|
Several key combinations on your keyboard usually have a special effect on the terminal. |
|
|
|
|
|
These "control" (CTRL) keys are accomplished by holding the CTRL key while typing the second key. For example, CTRL-c means to hold the CTRL key while you type the letter "c". |
|
|
|
|
|
The most common control keys are listed below: |
|
|
|
|
|
Keys
|
Description
|
CTRL-u
|
erase everything you've typed on the command line
|
CTRL-c
|
stop/kill a command
|
CTRL-h
|
backspace (usually)
|
CTRL-z
|
suspend a command
|
CTRL-s
|
stop the screen from scrolling
|
CTRL-q
|
continue scrolling
|
CTRL-d
|
exit from an interactive program (signals end of data)
|
|
|
|
|
|
|
Getting Information
|
|
|
The "man" command man gives you access to an on-line manual which potentially contains a complete description of every command available on the system. In practice, the manual usually contains a subset of all commands.man can also provide you with one line descriptions of commands which match a specified keyword |
|
|
|
|
|
man "command" |
|
|
|
|
|
Example : man
|
|
|
To display the manual page for the cp (copy files) command: |
|
|
|
|
|
man cp |
|
|
|
|
|
--More--11% at the bottom left of the screen means that only 11% of the man page is displayed. Press the space bar to display more of it or type q to quit. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|