Practice in using UNIX utilities:
1) Create the directory structure presented in the figure below. Use mkdir command and relative pathnames from your home directory. Try both: no option and –p option, for the command.
w2-1 1level3
w2
2level3
Your home
w2-2 3level3
4level3
2) Change to the 1level3 directory by one step using a relative pathname.
3) Practice in changing directories in your directory structure by one
command using relative pathnames, e.g., from 1level3 to 2level3, from
2level3 to 4level3, from 4level3 to w2, etc. Use names of parent and child Directories (‘.’ and ‘..’) as well.
4) Change to 1level3 and create a text file by any tool (e.g., by cat or cal like last tutorial).
5) Copy this text file from 1level3 to 1level3 (with the name file1), 2level3,
and to 3level3 changing its name. Show that there are these files in
corresponding directories.
6) Move this file to 4level3. Show that there is this file in 4level3 and there
is not in 1level3.
7) Print the following texts each in one echo or print command:
· Hello! I can do it
· 5 > (20 : 8) < (30 * 2)
· a-b, A-B, –, +,
· <, >, #, $, %, &.
1) Give the ls command (without options and with a, d, g, l, R options) in your home, w2, w2-1, and 1level3 directories. Explain for yourself the results received.
2) Change to the w2 directory. Remove the directory files w2-2, 3level-3, 4level3 and all ordinary files in them. Use the option –i of the rm and rmdir commands. Show that there are not these ordinary and directory files in your file structure.
3) Change to w2-1.
Task 1:
· Display access permissions for the file file1 in 1level3.
· Remove all access permissions for this file.
· Display access permissions for this file.
· Try to read this file using any utility (e.g.,cat).
· Try to write into this file using any utility (e.g., cat with the sign >> –
append).
· Add read and write access permissions for yourself for this file.
· Display access permissions for this file.
· Try to read this file using any utility.
· Try to write into this file using any utility.
Ans:
· Display access permissions for 1level3.
· Remove all access permissions for the 1level3 directory.
· Display access permissions for 1level3.
· Try to read a file from 1level3 using any utility.
· Try to put a file into 1level3 using any utility.
· Try to search in 1level3 using any command (e.g., the ls command).
· Add read, write, and execute access permissions for yourself for the
1level3 directory.
· Display access permissions for 1level3.
· Try to read a file from 1level3 using any utility.
· Try to put a file into 1level3 using any utility.
· Try to search in 1level3 using any command (e.g., the ls command).