Вы находитесь на странице: 1из 19

Unit 2

Using the System

Objectives
After completing this unit, students should be able to:
Log in and out of the system
State the structure of AIX commands
Execute basic AIX commands
Use AIX commands to communicate with other users

Logging In and Out


To Log in:
login: team01
team01's Password: (the password does not appear)
$ _

To Log out:
$ <ctrl-d>

(or)

$ exit

(or)

$ logout
login: _

Passwords
Creating or Changing:
$ passwd
Changing password for "team01"
team01's Old password :
team01's New password:
Enter the new password again:
$ _

Command Format
AIX commands have the following format:

command

mail -f

option(s)

newmail

argument(s)

Command Format Examples


RIGHT:

WRONG:

1. Separation:
$ mail -f newmail

$ mail - f newmail

$ who -u

$ who-u

2. Order:
$ mail -f newmail

$ mail newmail -f

$ mail team01

$ team01 mail

$ who -u

$ -u who

3. Multiple Options:
$ who -m -u

$ who -m-u

$ who -mu

$ who -m u

4. Multiple Arguments:
$ mail team01 team02

$ mail team01team02

THERE ARE EXCEPTIONS!!

date and cal Commands


Checking the date:
$ date
Fri Jan 14

10:15:00

GMT

2000

January 2000
Tue
Wed
Thu

Fri

Looking at a month:
$ cal 1 2000

Sun
2
9
16
23
30

Mon
3
10
17
24
31

4
11
18
25

Looking at a year:
$ cal 2001

5
12
19
26

6
13
20
27

7
14
21
28

Sat
1
8
15
22
29

The clear, echo, and banner Commands


clear: Clears the terminal screen

$ clear

echo: Writes what follows to the screen

$ echo Lunch is at 12:00


Lunch is at 12:00

banner: Writes character strings in large letters to the screen


$ banner Hello

Activity: Questions and Answers


1. What's wrong with the following commands?
$ du -s k
$ df-k
$ du -a-k
2. Which command ...
... changes your password ?
... clears the screen ?
... prints out the current system date ?
... exits the current shell ?

The who and finger Commands


Finding who is on the system:
$ who
root
team01

lft0
pts/0

Sept 4 14:29
Sept 4 17:21

Finding who you are:


$ who am i
team01
pts/0

Sept 4 17:21

(or)

$ whoami
team01

finger: Displays information about the users currently logged on


$ finger team02
Login name: team02
Directory: /home/team02
Shell: /usr/bin/ksh
On since Mar 04 16:17:10 on tty3
No Plan.

Sending Mail
$ mail team01
Subject: Meeting
There will be a brief announcement meeting today
in room 602 at noon.
<ctrl -d>
Cc: <Enter>

$ mail team20@sys2
Subject: Don't Forget!
Don't forget about the meeting today!
<ctrl -d>
Cc: <Enter>

Receiving Mail
[YOU HAVE NEW MAIL]
$ mail
Mail [5.2 UCB] [AIX4.1]

Type ? for help

"/var/spool/mail/team01": 2 messages 1 new


U 1 team05 Tues Jan 4 10:50 10/267 "Hello !"
>N 2 team02 Wed Jan 5 11:25 16/311 "Meeting"
?t 2
From team02 Wed Jan 5 11:25 2000
Date: Wed 5 Jan 2000 11:25
From: team02
To: team01
Subject: Meeting
Cc:

There will be a brief announcement meeting today in room 602 at noon.


?d

(Delete message)

?q

(Quit mail command)

write and wall


write: Send messages to other users on a system
$ write team01

(or)

$ write sarah@moon

write provides conversation-like communication with another


logged-in user. Each user alternatively sends and receives
messages.

The wall command writes to all terminals. This is useful to notify all
users of a system event:
For example:
$ wall The system will be inactive from 10 pm today.

talk With Another User


$ talk fred

(user fred will receive the following message)


Message from TalkDaemon@sys1 at 16:03 ...
talk: connection requested by john@sys1
talk: respond with: talk john

(to accept the invitation fred enters:)

$ talk john

mesg
The mesg command controls whether other users on the system
can send messages to you:

$ mesg n

Refuses messages

$ mesg y

Permits messages

Keyboard Tips
<Backspace>

Corrects mistakes

<Ctrl-c>

Terminates the current


command and returns to the
shell

<Ctrl-d>

End of transmission or end


of file

<Ctrl-s>

Temporarily stops output to


the screen

<Ctrl-q>

Resumes output (stopped


by Ctrl-s)

<Ctrl-u>

Erases the entire line

Next Step ...

Exercise 1

Unit 2: Checkpoint
What is the correct command syntax in AIX?
$ mail newmail -f
$ mail f newmail
$ -f mail
$ mail -f newmail
What command would you use to send mail items?
_____________________________________________________
What are other commands that can be used to communicate with
other users?
_____________________________________________________
What output would you expect from the following command: cal 8?
_____________________________________________________
Which command would you use to find out when a particular user
logged in?
$ who am i
$ who
$ finger everyone
$ finger username

Summary
AIX commands can use multiple options and arguments
and must follow proper syntax rules
There are many simple, yet powerful commands such
as:
date
cal
who, who am i
finger
echo
clear
banner
wc
Communicate with other UNIX users using commands
such as mail, write, talk, and wall

Вам также может понравиться