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

School of Engineering (TAFE)

ISYS5671C UNIX
Unix La 1 !oo"ing in"o a Lin#x S$%"e& an' U%ing !a%ic Co&&an'%
Aims:
To boot into a Linux system
To use basic commands in the command line interface to navigate the file system
o cd cd ..
To examine and use the help facility within Linux
o man
To find the path of the current directory
o pwd
To examine directory contents
o ls ls a ls -l
To obtain a calendar and the current date
o cal date
To change to the root user
o su user su user
To open and use multiple command windows
To identify the current user
o whoami
To shut the system down from the command line in an orderly way
o shutdown h now
1. Boot into Open!" using the Live #$
Do not install SUSE or any software to the hard drive
o %ou will run !" directly from the #$
o &ote: there is no password set with Open!" Live
'. "xamine and explore the user interface
(a)e a brief note of the facilities offered by this distribution
*. Open the command line terminal
The command prompt line shows linux@linux:~>
This means that user linux is logged on to a computer also named linux
The prompt ~> means a non root user is logged on
+. "xamine the directory structure:
To change to the parent directory of the current directory )ey in cd ..
o %ou will see command prompt line change to linux@linux:/home>
/home indicates that the directory home is situated under the root ,/ -directory
The root directory is the base directory of the Linux system
.ey in )ey in cd ..
o The prompt changes to linux@linux:/>
.ey in )ey in cd ..
o The prompt remains at linux@linux:/>
%ou have now reached the root ,/ -directory of the system and can go no further
To navigate bac) down the directory tree to your original location )ey in the following and observe
the effect:
o cd home
$ocument: '*/011*2*.doc
Author: 3eorge Listopad
ave $ate: 1'40*4'011
5(6T !niversity 7age 1 of +
School of Engineering (TAFE)
The command prompt line changes to linux@linux:/home
o cd linux
The command prompt line changes to linux@linux:~>
%ou are now at the original point when you first opened the command screen
To summarise:
o To move up one level from child directory to parent directory use cd ..
o To move down one level from parent directory to child directory use cd child_directory_name
To move directly to the root directory )ey in cd /. $o this
To move directly to the home directory of the current user )ey in cd. $o this
To move directly to any directory )ey in cd path_from_root_directory_to_desired_directory
o .ey in cd /home and observe the effect
To find your current location with respect to the root directory 8 ie the path to your current directory 8
)ey in pwd
o 6f you are in the user linux home directory you will see /home/linux
6n your lab 9ournal explain the meaning of /home/linux
Summarise the above commands clearly in your lab journal
1. !se the commands from step + to:
how the path from the root directory to the default user linux directory
5ecord this information in your lab 9ournal
:. The help facility within Linux may be accessed from the command line using the command man
.ey in man man to obtain help on the manual. The manual is a short form help file which may
appear cryptic and somewhat difficult to understand for the first time user. The best strategy in
learning to use it is to persevere over time.
o .ey in q to ;uit man
2. Listing the contents of a directory using the command ls:
5eturn to the default user<s home directory
o The command prompt line should show linux@linux:~>
.ey in the command ls
o 6n your lab 9ournal write the information that you see
To examine the function and the options for the command ls )ey in man ls at the command
prompt
o 5ead the effect of the switch a
man states: do not ignore entries starting with .
$irectory entries starting with ( indicate hidden files
The switch option ls a displays all files including hidden files
o 5ead the effect of the switch l
man states: use a long listing format
The file and directory attributes will be shown
=uit man and )ey in ls a
o 6n your lab 9ournal note and explain the effect ls a compared to ls
At the command prompt )ey in ls l
o 6n your lab 9ournal note and explain the effect ls l compared to ls
>. The calendar may be obtained using the command cal:
.ey in man cal to find the options for using cal
o cal will show the current month of the current year
o cal Y will show the calendar for all months of the year
$ocument: '*/011*2*.doc
Author: 3eorge Listopad
ave $ate: 1'40*4'011
5(6T !niversity 7age ' of +
School of Engineering (TAFE)
is a number that represents the year
&ote 10 will show the calendar for the year 10? not '010
o cal Y will show the calendar for the month ! ,where ! is a number that represents the
month- of the year
"xperiment with the cal command:
o how the calendar for the current month of the current year
o how the calendar for the year 1'
o how the calendar for @une of the 1>/1
/. The current date may be obtained using the command date:
.ey in man date to find the options for using date
"xperiment with the command
10. 6t is necessary to change users from time to time particularly when performing administrative tas)s
that can only be done by the root user. The command to do this is:
su user
o This changes the user to user and also changes the current directory to the user user home
directory
"xample )ey in su root
o The prompt will change to linux:~"
The " indicates the root user
o .ey in pwd
The screen will show /root which is the home directory of the root user
Ahat is the difference between the home directory of the root user and the root
directoryB Arite your response in your lab 9ournal.
.ey in su linux to change the user to linux and the current directory to the user linux home
directory.
o "xplain in your lab 9ournal how you would verify this is so
&ow )ey in su root
o "xplain in your lab 9ournal how this is different from the previous command
11. Ahen multiple users have access to the system it is helpful to be able to identify who is using the
current window. The command to do this is whoami
.ey in whoami at the command prompt
Arite the response in your lab 9ournal and explain what it means.
1'. 6t is often helpful to have multiple command windows open? particularly for debugging purposes.
Open a second command window
#hange user to the root user
&ote that both windows run independently of each other
1*. "xperiment with the above commands to commit them to memory
1+. hutdown Linux in an orderly way using the shutdown command:
!se man to find the options for the shutdown command
.ey in shutdown h now
The system will shut down
11. 5esearch assignment to complete this lab:
$iscuss the relationship between Linux and !nix
$ocument: '*/011*2*.doc
Author: 3eorge Listopad
ave $ate: 1'40*4'011
5(6T !niversity 7age * of +
School of Engineering (TAFE)
5esearch and explain:
o A short history of !"
o !" distributions currently available
o Cow you would obtain a copy of !" for yourself from the 6nternet
o Cow you would produce a usable #$ or $D$ for your own use
$ocument: '*/011*2*.doc
Author: 3eorge Listopad
ave $ate: 1'40*4'011
5(6T !niversity 7age + of +

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