Activity 1:  Exploring LINUX Systems

 

I. Introduction:

This lab gives you an exercise on how to login and exercise commands of a LINUX system.

 

II. Procedures:

 

1. Entering and Leaving LINUX

 

Login the system:

  • From a remote client PC, you start the TELENT client program through START  --> RUN, and then enter TELNET 149.164.36.10 to connect to the ECET LINUX machine.
  • You then enter your login name, and your password.
  • After you login to the system, you type the command pwd to examine your present working directory.

 

An Example:

Red Hat Linux release 6.2 (Zoot)

Kernel 2.2.14-5.0 on an i586

login: plin

Password: xxxxxxxxx

Last login: Thu Jan 18 16:53:20 from dyn069225

Hello!

    Welcome to ECET.

[plin@ecetlin plin]$ pwd

/home/plin

[plin@ecetlin plin]$   

 

 

Logoff the system:

  • You enter Ctrl-d (holding Ctrl key and enter d key) to end the input to the system and log you off the machine.
  • You may also enter exit to logoff the machine.

 

2. Understanding Basic LINUX Commands (case sensitive)

  • TELNET to the LINUX and Login to the system one more time
  • Exercise the following commands and interpret the displays:

            ls      (view files information)

            ls - l  (view files information in a long listing format)


 

An example:

-rw-rw-r--    1 plin     plin       29 Sep 30 12:46 date.txt

drwxrwxr-x    2 plin     plin     4096 Sep 30 13:10 localsite

-rw-rw-r--    1 plin     plin       27 Sep 30 12:50 names

-rw-rw-r--    1 plin     plin      746 Sep 30 13:06 pingfile.txt

-rwxr-xr-x    1 plin     plin      101 Nov 16 16:39 printex.pl

drwxr-xr-x    2 plin     plin     4096 Nov 18 12:51 public_html

-rw-rw-r--    1 plin     plin       27 Sep 30 12:59 reversenames

-rw-rw-r--    1 plin     plin       27 Sep 30 12:56 sortnames

-rw-rw-r-x    1 plin     plin       34 Nov 21 17:09 test.pl

-rwxr-xr-x    1 plin     plin       81 Nov 18 08:48 test1.pl

-rwxrw-r--    1 plin     plin       83 Nov 15 14:56 test2.pl   

 

  • Recognizing file permissions

 

  • Enter the following commands, copy TELNET screen, and paste them in a MS Word file for preparing lab report (without $ and the commands are all in lower case):

            $date                                        <Display system time and date>

            $who                                         <Check to see who are you>

             $cat > namefile  <hit enter key, and them type three names: Susan, Jeff, Henry;

                                     and remember to hit return key after each name entering; and then hit

                                    Crtl-d to exit the name entering>

            $ls -l                                         <View all files>

           

-rw-rw-r--    1 lin      lin          21 Sep 30 12:59 names

drwxr-xr-x    2 lin      lin        4096 Nov 18 09:09 public_html

-rwxrw-r--    1 lin      lin          85 Nov 18 08:48 test1.pl

-rw-rw-r--    1 lin      lin          84 Nov 18 08:46 test21.pl

 

Three levels of permissions:

            r           - Read the file or directory

            w          - Write the file or directory

            x          - Execute the file

associated with three classes of user groups:

            User (u) - the owner of the file or directory. The owner's name can be seen                          in the display.

            Group (g) - the group that owns the file.

            Others (o)- the public (any users)

 

For example, the public_html is a directory file (d), and the owner can read, write, and execute (rwx), the group can read and execute (r-x), and public can read and execute (r-x).

 

            $sort namefile                            <Sort the name file>

            $cat namefile                             <Screen dump of name file>

            $sort -r namefile                         <Sort file in reverse order>

            $cat namefile                             <Display the file>

            $cp namefile namefile_new         <Copy a file>

            $ls -l                                         <View all files>

            $mv namefile_new namefile_1   <Rename a file>

            $ls -l                                         <View all files>

            $rm namefile_1                          <Remove or delete a file>

            $pwd                                         <Examine present working directory>

 

            For example:

                  [plin@ecetlin plin]$ pwd

            /home/plin    

 

            $cd ..                                        <Change or move one directory up>

 

            For example:

      [plin@ecetlin plin]$ cd ..

      [plin@ecetlin /home]$ pwd

      /home  

            $ls -l home                                <View all user directories under home directory>

            $cd lin                                       <Enter the command with your name to change back to                                                                previous directory>

            $cd ..                                        <Change or move one directory up>

            $cd ..                                        <Now you are in root directory>

            $ls -l                                         <View and understand all directories in the root>

 

drwxr-xr-x    2 root     root         2048 May  1  2000 bin

drwxr-xr-x    3 root     root         1024 Jan 12 18:04 boot

drwxr-xr-x    6 root     root        34816 Jan 12 18:04 dev

drwxr-xr-x   31 root     root         3072 Jan 18 18:05 etc

drwxr-xr-x    3 root     root         1024 Oct 31 23:35 groups

drwxr-xr-x   25 root     root         4096 Jan 12 12:06 home

drwxr-xr-x    4 root     root         3072 May  1  2000 lib

drwxr-xr-x    2 root     root        12288 May  1  2000 lost+found

drwxr-xr-x    5 root     root         1024 May  2  2000 mnt

drwxr-xr-x    2 root     root         1024 Aug 23  1999 opt

dr-xr-xr-x   48 root     root            0 Jan 12 13:03 proc

drwxr-x---   17 root     root         1024 Jan 22 21:24 root

drwxr-xr-x    3 root     root         3072 May  1  2000 sbin

drwxrwxrwt   11 root     root         2048 Jan 23 04:03 tmp

drwxr-xr-x   22 root     root         4096 May  1  2000 usr

drwxr-xr-x   18 root     root         1024 May  1  2000 var

drwxr-xr-x    2 root     root         1024 Nov 13 10:44 ~aung   

 

 

            $mkdir webprog                         <Make a new directory called webprog under your own                                                                  directory>

            $rmdir webprog                          <Remove or delete webprog directory>

 

 

III. Questions