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:
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
Hello!
Welcome to ECET.
[plin@ecetlin plin]$ pwd
/home/plin
[plin@ecetlin plin]$
Logoff the system:
2. Understanding Basic LINUX
Commands (case sensitive)
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
drwxrwxr-x 2 plin plin
4096 Sep 30
-rw-rw-r-- 1 plin plin
27 Sep 30
-rw-rw-r-- 1 plin plin
746 Sep 30
-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
$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
drwxr-xr-x 2 lin lin
4096 Nov 18
-rwxrw-r-- 1 lin lin 85 Nov 18
-rw-rw-r-- 1 lin lin 84 Nov 18
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
drwxr-xr-x 3 root root 1024 Jan 12
drwxr-xr-x 6 root root
34816 Jan 12
drwxr-xr-x 31 root root 3072 Jan 18
drwxr-xr-x 3 root root 1024 Oct 31
drwxr-xr-x 25 root root 4096 Jan 12
drwxr-xr-x 4 root root 3072
drwxr-xr-x 2 root root
12288
drwxr-xr-x 5 root root 1024
drwxr-xr-x 2 root root 1024
dr-xr-xr-x 48 root root 0 Jan 12
drwxr-x--- 17 root root 1024 Jan 22
drwxr-xr-x 3 root root 3072
drwxrwxrwt 11 root root 2048 Jan 23
drwxr-xr-x 22 root root 4096
drwxr-xr-x 18 root root 1024
drwxr-xr-x 2 root root
1024 Nov 13
$mkdir webprog <Make a new directory called webprog under your own directory>
$rmdir webprog <Remove or delete webprog directory>
III. Questions