Skip to content

Linux Assignment ‐2

Sayan Bhattacharya edited this page Nov 7, 2025 · 4 revisions

1. Run a command to display your current working directory path.

Screenshot 2025-11-07 175909

2. Move to /etc and verify your location.

Screenshot 2025-11-07 180807

3. Change your directory from /etc to /usr/bin and confirm using pwd.

image

4. Move one level up from your current directory.

image

5. Return to your home directory from anywhere in the filesystem using a single command.

image

6. List all files and directories (including hidden ones) in your home directory.

image

7. Display files in long format, showing file permissions, size, and date.

image

8. List all files in /var/log sorted by modification time, with the newest first.

image image

9. Create a directory named backup_files inside home directory.

image

10. Create a nested directory structure home directory/projects/java/src in a single command.

image

11. Create three empty files: log1.txt, log2.txt, and log3.txt in the current directory.

image

12. Update the modification timestamp of log1.txt without changing its contents.

image

13. Display the content of the file /etc/oratab on the terminal.

image

14. Combine the content of part1.txt and part2.txt into a new file named final.txt.

image

15. Count the number of lines, words, and characters in a file named /var/log

image

16. Display only the number of lines in /etc/services.

image

17. Find all lines containing the word “error” inside /var/log.

no idea

18. Search recursively for the keyword “error” inside /var/log.

image image

19. Count how many times the word “failed” appears in auth.log.

no idea

20. Copy a file named part1.txt from home location to /backup /.

image

21. Copy an entire directory /scripts (including its contents) to /backup/scripts/.

image

22. Rename the file part1.txt to data_old.txt.

image

23. Move all .txt files from home directory tohome directory/backup.

image

24. Display the full calendar for the year 2026.

image

25. Show the calendar for the current month along with the previous and next month.

image

Clone this wiki locally