0% found this document useful (0 votes)
19 views5 pages

Lab 05

The document outlines a lab assignment for an Operating Systems course, detailing three tasks involving directory and file management using command line operations. Tasks include creating and removing directories, copying and renaming files, and using the touch command to manipulate file timestamps. The lab is submitted by Muhammad Hammad to Ms. Tahreem Tajammal.
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)
19 views5 pages

Lab 05

The document outlines a lab assignment for an Operating Systems course, detailing three tasks involving directory and file management using command line operations. Tasks include creating and removing directories, copying and renaming files, and using the touch command to manipulate file timestamps. The lab is submitted by Muhammad Hammad to Ms. Tahreem Tajammal.
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/ 5

OPERATING SYSTEM

LAB 05

SUBMITTED TO:
MS.TAHREEM TAJAMMAL

SUBMITTED BY:
MUHAMMAD HAMMAD (RCF-30154)
Lab Tasks :
Task-1:
1. Use cd to go to your home directory, and create a new directory there called dog.
2. Create another directory within that one called cat, and another within that called mouse.
3. Remove all three directories. You can either remove them one at a time, or all at once.
4. If you can delete directories with rm -r, what is the point of using rmdir for empty
directories?
5. Try creating the dog/cat/mouse directory structure with a single command.

Task 2:
1. Copy the file /etc/passwd to your home directory, and then use cat to see what’s in it.
2. Rename it to users using the mv command.
3. Make a directory called programs and copy everything from /bin into it.
4. Delete all the files in the program’s directory.

5. Delete the empty programs directory and the user’s file


.Task 3:
1. The touch command can be used to create new empty files. Try that now, picking a name
for the new file: $ touch baked-beans.
2. Get details about the file using the ls command: $ ls -l baked-beans.
3. Wait for a minute, and then try the previous two steps again, and see what changes. What
happens when we don’t specify a time to touch?
4. Try setting the timestamp on the file to a value in the future. When you’re finished then delete
it

You might also like