Assignment 2 2025
Assignment 2 2025
FCS (TCS-495)
1. List five commonly used Linux commands for navigating the file system. [CO2]
2. Explain the purpose of the man command and provide an example of how you would use it
to find information about the ls command. [CO2]
4. Compare and contrast the functionality of the cp and mv commands in Linux. [CO2]
5. You need to add the text "Important information" to the beginning of an existing file named
"notes.txt". Evaluate two different Linux commands that could achieve this. [CO2]
6. Design a series of Linux commands to create a new user named "tester" with the password
"secure123", add this user to the "sudo" group, and then switch to the "tester" user. [CO2]
7. What are the three main categories of file permissions in Linux? What are the read, write,
and execute permissions represented by? [CO2]
8. Explain how the numerical representation of file permissions (e.g., 755) relates to the
symbolic representation (e.g., rwxr-xr-x). Provide an example. [CO2]
9. Write the Linux command to change the permissions of a file named "script.sh" so that the
owner has read, write, and execute permissions, the group has read and execute permissions,
and others have only read permission. [CO2]
10. What is the primary purpose of the grep command in Linux? Provide a basic example of its
usage. [CO2]
11. Describe the typical process of starting and stopping a system service in Linux. Provide an
example using a common service like ssh. [CO2]
12. Design a cron job that runs a script named "backup.sh" every day at 3:00 AM. Write the
corresponding entry in the crontab file. [CO2]
13. Write a Bash script that takes a filename as a command-line argument and checks if the file
exists. If it exists, it should print "File exists"; otherwise, it should print "File does not exist".
[CO2]
14. Write a Bash script that reads a list of filenames from a file named "files.txt" (one filename
per line) and creates a new directory named "processed" and moves each file from "files.txt"
into the "processed" directory. [CO2]
15. Explain the difference between a Python list and a tuple. When might you choose to use one
over the other? [CO2]
16. Write a Python function called calculate_average that takes a list of numbers as input and
returns their average. Then, demonstrate how to use this function with a sample list. [CO2]
17. You have a collection of student names and their corresponding scores stored in a Python
dictionary. Evaluate different ways to iterate through this dictionary and print each student's
name and score. Which method do you think is most readable and efficient for this task?
Explain your reasoning. [CO2]
Guidelines:
4. You need to include your Name, Class, Section, and Roll no., on the every page of your
handwritten assignment.