SPL Lab1 Assignment
SPL Lab1 Assignment
Instruction: Assume you are in your home directory unless mentioned otherwise. For each of
the programs, create a separate x.txt file where x signifies the question No. In each file, write
separate comments for separate subparts (a,b,..). Finally, put all the files in a folder, make a zip
file, and upload in the teams link. Folder Format: Roll No_firstname_date. Without a proper
folder name, the assignment will not be counted for evaluation.
3. a. Create three files named file1.txt, file2.txt, and file3.txt in the myWork
directory. 10
b. Copy the content of file1.txt to file1_backup.txt.
c. Move file2.txt to the myAssignments1 directory.
d. Delete file3.txt.
4. a. Create a file named sample.txt with the following content in myWork directory: 10
Hello, Linux learners!
Welcome to the System Programming Lab Day 1!
Happy learning!
b. Display the first two lines of the file.
c. Display the last line of the file.
d. Display the entire file content to the console.
5. a. Search for the word Linux in the sample.txt file. 10
b. Ignore case sensitivity while searching.
c. Save lines that do not contain the word Linux to a file named
non_matching_lines.txt.