BASIC UNIX COMMANDS



Ex. No. :1
BASIC UNIX COMMANDS


AIM:

To implement the basic UNIX commands.


BASIC UNIX COMMANDS:

  1.  Command:         W

Syntax             : W

Description     : Tells you who's logged in, and what they're doing right at the moment.

Example          : W

            Output :[root@localhost student]# w

                   12:14:48  up  2:10,  3 users,  load average: 0.00, 0.00, 0.00
                    USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
                   student pts/1    192.168.11.87    10:21am  2:53   0.16s  0.06s  vim dirfile.sh
                    root     :0       -                11:36am   ?     0.00s  0.36s  /usr/bin/gnome-
                   student pts/2    192.168.11.86    12:03pm  0.00s  0.02s  0.00s  w

                   [root@localhost student]#

2.      Command:         Who

Syntax             :  who

Description     : Tells you who's logged on, and where they're coming from.

Example          : who

            Output             :          

                [root@localhost student]# who
                student pts/1        Nov 13 10:21 (192.168.11.87)
                 root     :0           Nov 13 11:36
                student pts/2        Nov 13 12:03 (192.168.11.86)
               
    [root@localhost student]#

               
Command:         Who am i

Syntax             :  who am i

Description     : returns your username.

Example          : who am i

Output :[root@localhost student]#  who am i
     
student  pts/2        Nov 13 12:03 (192.168.11.86)
     
[root@localhost student]#

Command:      finger       

Syntax             :  finger filename

Description     : gives you lots of information about that user, e.g when they last read their mail and whether they're logged in.

Example          : finger it staff
         
            Output                   :
                                         
                        [root@localhost student]#  finger student
                       
                        Login:student                         Name: (null)
                        Directory: /home/student                Shell: /bin/bash
On since Thu Nov 13 10:21 (IST) on pts/1 from 192.168.11.87
1 second idle
On since Thu Nov 13 12:03 (IST) on pts/2 from 192.168.11.86
1 second idle
No mail.
No Plan.
                    
                        [root@localhost student]#

Command:      passwd  

Syntax             :  passwd

Description     : lets you change your password, which you should do regularly.

Example          : passwd

Output:

           [root@localhost student]# passwd
Changing password for user student.
Changing password for student
(current) UNIX password:
New password:
Retype new password:
passwd: all authentication tokens updated successfully

Command: date
       
Syntax             :  date

Description     : Displays the date month and time.

            Example          : date

 Output            :

[root@localhost student]#  date

Thu Nov 13 14:54:42 IST 2008
[root@localhost student]#

Command:     cal   

Syntax             :   cal  [month]  [year]

Description     :

Example 1       : cal

Output :[root@localhost student]#  cal
   
November 2008

Su Mo Tu We Th Fr Sa
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30

Command:      id

Syntax             :   id

Description     : The id command is used to display the numerical value that corresponds to your login name.

Example          : id

Output :[root@localhost student]#  id

uid=539(student) gid=540(student) groups=540(student)


Command: clear   

Syntax             :   clear

Description     : clears the screen of your terminal.

Example          : clear

Output :[root@localhost student]#  clear


Command: tty

Syntax             : tty

Description     : let you know your terminal name.

Example          : tty

Output : [root@localhost student]#  tty

/dev/pts/1


Command:  bc

Syntax             :   bc

Description     : Can be used as calculator

Example          : bc

Output :

[root@localhost student]#  bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.

12+5
17

Command:  pwd

Syntax             :   pwd

Description     : Displays the absolute path name of the currtntly working directory.

Example          : pwd

Output :[root@localhost student]#  pwd

/home/student











RESULT:

                        Thus, the basic commands in UNIX are analyzed.

--
Hackerx Sasi
Don't ever give up.
Even when it seems impossible,
Something will always
pull you through.
The hardest times get even
worse when you lose hope.
As long as you believe you can do it, You can.

But When you give up,
You lose !
I DONT GIVE UP.....!!!

with regards
prem sasi kumar arivukalanjiam

Comments