Faris Shaya Aljaber 2237106 - Cpis 222 Lab 3
Faris Shaya Aljaber 2237106 - Cpis 222 Lab 3
Exercise 1: practice the following commands and then answer the next
questions.
ls
ls -a
mkdir
cd
director
y
Change the directory to the specified directory
cd
Change directory to the home directory
cd ~
Same as cd command
cd ..
Go back one step from the directory
pwd
Print the directory
cp file1
file2
copy the file and paste it to another file
mv file1
file2
move the file to another place
rm file
remove files from the directory
rmdir
director
y removes directories
cat file
head
file
tail
file
grep
'keyword
' file
looking for the word in a file and display it
wc file
Lab Assignment:
After experimenting the previous commands answer the
following:-
Under what conditions:
1-head and tail have the same output on the screen:
When the file content is 10 or less lines the output will be the same
2-cat and less give the same display for a file.
Cat and Less will display the same file if it small
3-head and tail give completely different outputs for the same
file.
When the file has 10 lines or more
4-grep and wc give the same output for a certain file.