Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

s Incident report made by assigned proctoets is suicient ground for disdiplinary

ID: 3729655 • Letter: S

Question

s Incident report made by assigned proctoets is suicient ground for disdiplinary acions 6. Use blue or black pen only 7, Use calculator for 8. Getting out while the exam is going on is strictly prohibited . Do not write anything on the test questionnaire, write the answers in the test bookde 10. Read and follow the instruction of each type of test very carefully al skils. No borrowing of caloulator (for Math and other applicable sutbije I. Perform the following in Linux environment and write the commands which y in the provided answer sheet. (10 x 2 = 20 Marks) 1. Create the following LECTURE 2. Copy the contents of Lecture.tct to new file Notes.tct 3. Display the contents in lab.txt and notes.txt 4. List all files in Prelim. 5. Delete Lecture.bxt 6. Delete the folder Final. 7. Display all files which starts with L from the folder Prelim. 8. Display all files having a five letter name and the starting three the last three are es.txt from the folder Prelim. 9. Copy the folder Prelim to another folder PrelimNotes. 10. Clear the screen. Dr. Dr. ama th, Date Date

Explanation / Answer

1. Create the Following

Ans) step-1: mkdir Folder1
step-2: cd Folder1
step-3: mkdir Prelim
step-4: mkdir Mid
step-5: mkdir Final
step-6: cd Prelim
step-7: cat > Lecture.txt
     
This is Lecture file
step-7.1: After typing text file, then press
^z (Ctrl+z) save this file
step-8: cat > Lab.txt
This is Lab file
step-8.1: After typing text file, then press
^z (Ctrl+z) save this file

2. Copy the contents of Lecture.txt to new file Notes.txt
Ans) step-1: suppose you in Home Directory, then goto Prelim Directory
using this,
cd Prelim
step-2: cp Lecture.txt Notes.txt
(OR)
cp ~/Folder1/Prelim/Lecture.txt ~/Folder1/Prelim/Notes.txt

3) Display the contents in Lab.txt and Notes.txt
Ans) pr -m -t Lab.txt Notes.txt
Description: pr means columnates files for printing
-m (merge) print all files in parallel
-t omit page header

4) List all files in Prelim
Ans) step-1: Suppose you are in Home Directory goto Pelim Direcotory using cd (Change Directory) Command, then
step-2: type ls [ENTER] (list of files)
(OR)
ls ~/Folder1/Prelim

5) Delete Lecture.txt
Ans) rm Lecture.txt
(OR)
rm ~/Folder1/Prelim/Lecture.txt

6) Delete the folder Final
Ans) rm -r Final
(OR)
rm -r ~/Folder1/Final

7) Display all files which starts with L from the folder Prelim
Ans) ls L*.* ~Prelim
(OR)
ls ~/Folder1/Prelim

8) Display all files having a five letter name and the starting three the
last three are es.txt from the folder Prelim
Ans) ls ???es.txt ~Prelim
(OR)
ls ???es.txt ~/Folder1/Prelim

9) Copy the folder Prelim to another folder PrelimNotes.
Ans) cp -R Prelim PrelimNotes
(OR)
cp -R ~/Folder1/Prelim ~/Folder1/PrelimNotes

10) Clear the screen
Ans) clear