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

ITU UNIX Operating System

Assignment #4
1. In the root directory create a file called mars.t!t. "rom yo#r home
directory$ copy the file to yo#r home directory
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&. Translate 'tr( the mars file into )A*S #sing the mapping+ ,a-./ ,A-0/
and pipe it into more %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1hat happens2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3. Another translation con4ert5s capital letters into 6iff-spea78$ a
comp#ter-ese loo7ing reado#t. The appropriate translation is A9IOS to
431:; 'A5s 6ecome 45s$ 95s 6ecome 35s etc(. )hain t<o translations
together 'lo<ercase to #pper case$ then #pper case to 6iff-spea78(
#sing pipes and also pipe the final o#tp#t into more
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
is this cool2 %%%%%%%%%%%%%%%%%%%
3. Type man ls8 and e!periment <ith the 4ario#s options. 1hich option
sho<s si.e2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;. 1hat happens <hen yo# type ls -lA"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'Interpret each option( Is the follo<ing 'rearranged options( any different2
ls -"lA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
=. Use cat to display 3 files on the screen at once '6io$ foods$ mars.t!t(+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>. No< #se redirection to p#t the same three files into a single file named
file%all %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
?. Add yo#r foods file to the file%all file again #sing the append @@
redirection %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A. 1hich of the follo<ing commands can 'or cannot( 6e #sed <ith inp#t
redirection2 9!plain the rationale for yo#r ans<er.
a( cal d( cp
6( date e( <ho
c( echo f( pass<d
1:. 1hich of the follo<ing commands can 'or cannot( 6e #sed <ith o#tp#t
redirection2 9!plain the rationale for yo#r ans<er.
a( cal d( cp
6( date e( <ho
c( echo f( pass<d
11. Ass#ming file1 is a te!t file$ <hat is the error 'if any( in each of the
follo<ing commands2
a( date B more d( more B sort
6( more B date e( <ho B man
c( date B file1 f( file1 B date
1&. If <e #se the follo<ing chained command+
command1 B command&
a( 1hat is the necessary reC#irement for command12
6( 1hat is the necessary reC#irement for command&2
13. Do# ha4e the follo<ing files in yo#r home directory+

file1 file& file33 file4 f; f= f>
N"ile1 Nfile& Nfile441 file1a file&a file&6
1hich of them <o#ld 6e selected 6y each of the follo<ing patterns2

a( file2
6( file22
c( fileE
d( Nfile2
e( 2file2
11. 1rite a <ildcard pattern '#se E$ 2$ or ,/( to refer to all the files in the
lines 6elo<+
a( file1$ file&$ file3FfileA 9!ample+ file2
6( file: F fileAA %%%%%%%%%%%%%%%%
c( file&:$ file&1$ file&&Ffile&A
'6#t not file11 or file33 etc( %%%%%%%%%%%%%%%%
d( All files ending <ith .c %%%%%%%%%%%%%%%%
e( All files in the parent directory %%%%%%%%%%%%%%%%
f( All files starting <ith a letter %%%%%%%%%%%%%%%%
1&. Open another <indo< and log in$ then start 4i on a G#n7 file '4i G#n7(.
If yo# don5t ha4e 4i start any program that yo# ha4e.
13. In yo#r first <indo<$ find o#t <hat the process IH n#m6er is for the 4i
or the program yo# stared. *rocess IH ______________________
14. Iill the process from yo#r first <indo< %%%%________________

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