Practical 2 For AACS2284
Practical 2 For AACS2284
Practical 2 For AACS2284
YSTEMS (PRACTICAL)
Section A
At current location (e.g /home/student), perform the following operations:
1. Show the current path.
pwd
3. Give two commands which can list all the contents at the current directory.
ls
ll
5. Inside this “super” directory, create four files “apple.doc”, “april.doc”, “box.txt” and
“boxes.txt” using touch command.
touch apple.doc april.doc box.txt boxes.txt
ls ??p*
7. Go to root directory.
cd /
11. Copy “super” directory to home directory and rename it to “super2” in one command line.
cp -r super /home/super2
2
AACS2284 OPERATING SYSTEMS (PRACTICAL)
.
cd
p2
touch
samp
les.tx
t
15. Type the following contents into “sampleA.txt” and save the file.
“The shell is a program that takes keyboard commands and passes them to the operating
system to carry out. Almost all Linux distributions supply a shell program from the GNU
Project called bash.”
cat >
sampleA.t
xt
The shell
is a
program
that takes
keyboard
command
s and
passes
them to
the
operating
system to
carry out.
Almost all
Linux
distributio
ns supply
a shell
program
from the
GNU
3
AACS2284 OPERATING SYSTEMS (PRACTICAL)
Project
called
bash.
17. Type the following contents into “sampleB.txt” and save the file.
“When using a graphical user interface, we need another program called a terminal
emulator to interact with the shell.”
. cat > sampleB.txt
18. Open “sampleB.txt” again using vi command and add the following sentences.
“It’s likely called simply “terminal”.”
cat > sampleB.txt
When using a graphical user interface, we need another program called a terminal emulator to
interact with the shell.
20. Combine the two files “sampleA.txt” and “sampleB.txt” to a file named “sampleC.txt”.
23. Overwrite “sampleB.txt” by “sampleA.txt” and show the content of both files on the
4
AACS2284 OPERATING SYSTEMS (PRACTICAL)
terminal.
25. Go back to home directory and create a new directory named “backup”.
Section B True/False.
Explain the answer if it is false.
True/False
1. The structure of the file system in Linux can be depicted in a True
5
AACS2284 OPERATING SYSTEMS (PRACTICAL)
form of tree. It begins at the root (/), and branches out like the
branches of a tree.
3. When the terminal is opened the starting directory is the root (/) False: home directory
directory.
5. Windows separates directories using forward slash (“/”) while False answer: LINUX uses
LINUX uses back slash (“\”). forward slash
Section C
6
AACS2284 OPERATING SYSTEMS (PRACTICAL)
2. Using vi command, create a new file called “sonnet” that contains the first four lines of the
Shakespeare’s 80th Sonnet.