0% found this document useful (0 votes)
14 views4 pages

Faris Shaya Aljaber 2237106 - Cpis 222 Lab 3

Uploaded by

sfsggdgful
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

Faris Shaya Aljaber 2237106 - Cpis 222 Lab 3

Uploaded by

sfsggdgful
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Faris shaya aljaber

2237106 – cpis 222


Lab 3

Exercise 1: practice the following commands and then answer the next
questions.

Command Purpose / Description

ls

Show all files and directories

ls -a

Show all files and directories ,even if it`s hidden

mkdir

This command makes a new directory

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

display the content of the file


more
file
display the content of the file

head
file

Display first 10 lines of a file by default

tail
file

Display last 10 lines of a file by default

grep
'keyword
' file
looking for the word in a file and display it
wc file

Print the number of lines, words, and characters in a file


faris: 0 lines , 0 words , 0 char

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.

If the file content is 1 word it will give the same output

You might also like