0% found this document useful (0 votes)
109 views4 pages

Activity 4 Working With Files and Directories

This activity aims to have students navigate and manage files and directories using command line. It includes procedures to use commands like pwd, cd, ls, cp, rm, mkdir and touch to change directories, list files, copy, remove, create directories and files. Screenshots of command outputs are required. Supplementary tasks involve creating directories and files in Documents and copying or deleting their contents. The analysis questions cover mv, permission errors, and the -r option of cp.

Uploaded by

Melon Trophy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views4 pages

Activity 4 Working With Files and Directories

This activity aims to have students navigate and manage files and directories using command line. It includes procedures to use commands like pwd, cd, ls, cp, rm, mkdir and touch to change directories, list files, copy, remove, create directories and files. Screenshots of command outputs are required. Supplementary tasks involve creating directories and files in Documents and copying or deleting their contents. The analysis questions cover mv, permission errors, and the -r option of cp.

Uploaded by

Melon Trophy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Activity No.

4
Working with Files and Directories
Course Code: CPE231 Program:
Course Title: SYSTEM ADMINISTRATION FUNDAMENTALS Date Performed:
Section: Date Submitted:
Name: Instructor:
1. Objective(s):

This activity aims to navigate and manage files and directories using command line interface.

2. Intended Learning Outcomes (ILOs):


The students should be able to:
2.1 Demonstrate how to navigate home and system directories
2.2 Demonstrate how to how to list files and directories.
2.3 Demonstrate how to use globbing to manipulate files and directories.
2.4 Demonstrate how to create, move and delete files and directories.

3. Discussion :

<create a discussion about navigating file system and managing files and directories >

4. Resources:
Personal Computer with installed Virtual Box
Ubuntu Server or Desktop virtual machine

5. Procedure:

1. Login using your username and password.


2. Use terminal emulator application (if you are using desktop version)
3. Execute the following commands to navigate files and directories. Copy a screenshot as output after you
execute the given command. Create a brief explanation of the command.

Command Screenshot Explanation


1. pwd
2. cd /
3. pwd
4. cd
5. pwd
6.cd /home
7.pwd
8.cd ~
9.pwd
10.
echo ~
~sysadmin ~root
~mail ~nobody
where sysadmin is your
username
11. cd ~root
12. cd /usr/bin
13. pwd
14. cd /usr
15. pwd
16. cd
/usr/share/doc
17. pwd
18. cd bash
19. pwd
20. cd ..
21. pwd
22. cd ../dict
23. pwd
24. cd
25. ls
26. ls -a
27. ls -l /etc/hosts
28. ls -R /etc/udev
29. ls -d /etc/s*
30. ls -d /etc/????
31. ls –d /etc/[abcd]*

4. Execute the following commands to manage files and directories. Copy a screenshot as output after you
execute the given command. Create a brief explanation of the command.

Command Screenshot Explanation


1. echo *
2. echo D*
3. echo P*
4. echo *s
5. echo D*n*s
6. echo ??????
7. echo D????????
8. echo ?????*s
9. echo [DP]*
10. echo [!DP]*
11. echo [D-P]*
12. echo [!D-P]*
13. ls
14. cp /etc/hosts hosts
15. ls
16. rm hosts
17. ls
18. cp –v /etc/hosts
hosts
19. ls
20. rm hosts
21. ls
22. cp –v /etc/hosts .
23. ls
24. rm hosts
25. ls
26. cd /etc
27. ls -l hosts
28. cp –p hosts
/home/sysadmin
29. cd
30. ls –l hosts
31. rm hosts

32. cp -p /etc/hosts ~

33. cp hosts newname

34. ls –l hosts newname


35. rm hosts newname
36. mkdir Myetc
37. cp –R /etc/udev
Myetc
38. ls –l Myetc
39. ls –lR Myetc
40. ls
41. rm -r Myetc
42. ls
43. touch premove
44. ls
45. mv premove
postmove
46. ls
47. rm postmove

7. Supplementary Activity:

Copy screen shot(s) of the following tasks:

1. Create a directory CPE231 in the Documents directory.


2. Create a directory <lastname> and <firstname> under CPE231 directory.
3. Create two text files: (1) A.txt and (2) B.txt in the <lastname> directory.
4. Copy the content of <lastname> directory to <firstname> directory.
5. Delete the content of <lastname> directory.
6. Create a directory CPE231_backup in the Documents directory.
7. Copy the content of CPE231 to CPE231_backup directory.
8. Remove the CPE231 directory.

7. Problem Analysis:

1. Explain the –i, -n, -v options of mv command.


2. Explain how to solve the Permission denied error when moving or removing files.
3. Explain the –r option of cp command.

8. Conclusion

8. Assessment (Rubric for Laboratory Performance):

You might also like