0% found this document useful (0 votes)
35 views6 pages

Name: Prajapati Priya Roll No: 2239 Div: C Subject: OST Practical Assignment

This document contains the details of an OST practical assignment completed by Prajapati Priya. It includes 25 questions covering basic Linux commands like mkdir, cd, cp, mv, rm, ls, grep, sort, tail, head, cut and touch. Many of the questions involve manipulating files and directories, copying, moving, deleting and appending files, extracting patterns from files using grep, sorting and listing files.
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)
35 views6 pages

Name: Prajapati Priya Roll No: 2239 Div: C Subject: OST Practical Assignment

This document contains the details of an OST practical assignment completed by Prajapati Priya. It includes 25 questions covering basic Linux commands like mkdir, cd, cp, mv, rm, ls, grep, sort, tail, head, cut and touch. Many of the questions involve manipulating files and directories, copying, moving, deleting and appending files, extracting patterns from files using grep, sorting and listing files.
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/ 6

Name : Prajapati Priya

Roll No : 2239

Div : C

Subject: OST Practical Assignment(2)

------------------------------------------------------

Q1.

mkdir Priya

cd Priya

cat > college (write content of 10 lines)

------------------------------------------------------

Q2.

(a) mkdir prac1

cd prac1

mkdir prac2

(b) cp ./Priya/college./peac1/prac2/Priya2

(c) mv college study

------------------------------------------------------

Q3. mv ./prac1/move ./Priya

------------------------------------------------------
Q4. mkdir .RAAZ

------------------------------------------------------

Q5. touch .secret

------------------------------------------------------

Q6. ls -a

------------------------------------------------------

Q7. rm college

------------------------------------------------------

Q8. car > datafile

------------------------------------------------------

Q9. ln -s ./datafile txt

------------------------------------------------------

Q10. cp datafile data1

------------------------------------------------------
Q11. cat > arescode

cat areacode >> data1 (This will append the content of file areacode into data1)

------------------------------------------------------

Q12. grep -o -e <"pattern">filename

Where, -o : used to print only matched part

-e : used to patterns

grep -o -e "[a-zA-Z0-9._]\+@[a-zA-Z]\+.[a-zA-Z]\+" datafile2 > data2

------------------------------------------------------

Q13. cat areacode data2 > data3

------------------------------------------------------

Q14. sort -r data3 > data4

------------------------------------------------------

Q15. tail -5 data1 > data6

------------------------------------------------------

Q16. mkdir result

cp ./*result (this will copy files only)

cp -r./*result (this will copy both files & directory)

------------------------------------------------------
Q17. check

------------------------------------------------------

Q18. check

------------------------------------------------------

Q19. check

------------------------------------------------------

Q20. head -n 20 name1 | tail -11 OR head 20 name1 | tail -11

(Ending point) (strting

point)

------------------------------------------------------

Q21. cat > name5

Priya

Meet

Manisha

Kamil

Jeel

Gatha

Abhee

cut -c 1-3 name5


------------------------------------------------------

Q22. (1) ls a* : art artist apple

(2) ls a? :--

(3) ls pa* : paint painter

(4) ls *\? : 'how?' 'when?' 'where?' 'why?'

(5) ls *[1-9] : example1 : example2 : example3 : example4 : example5 :

(6) ls ?[1-9] :--

(7) ls *[2-4] : example2 : example3 : example4 :

(8) ls example[2-5] : example2 : example3 : example4 :

(9) ls wh* : 'when?' 'where?' 'why?'

(10) ls h?* : 'how?'

------------------------------------------------------

Q23. 2+2 | 2-2 | 2*2 | 2/2

4 |0 |4 |1

------------------------------------------------------

Q24. grep -o "[a-z]" name5

check

------------------------------------------------------

Q25. touch -t 200708120630 name5

ls -l name5

------------------------------------------------------
The End

You might also like