You will do this assignment on your local Linux system; it is a “discovery exercise.“
In a terminal window, type script filesystem.script to record your results.
fuser command, see what files are in use
on the /home filesystem.
If you have the
lsof utility on your system, see what
files are in use by user root by typing
lsof -u root. (I didn’t want you to have to plow
through the entire
man page, which
seems to go on forever.)
Is /dev/null a block device or a character device? Put your answer into the script as a comment. (At the shell prompt, type a # followed by your answer, then press ENTER.) Hint: use ls -l
Is /dev/hda1 a block device or a character device? Put your answer into the script as a comment. (If you do not have /dev/hda1, try /dev/sda1 instead. The device name depends on what kind of hardware you have installed on your system.
Type a command that will show the the major and minor device numbers for /dev/null, /dev/zero, and /dev/random.See the appropriate Wikipedia entries for /dev/zero, /dev/null, and /dev/random if you don’t know what they do.
Confirm that the sticky bit is set on /tmp by typing ls -ld /tmp
As yourself, create a file named /tmp/myfile
Create another user on the system (see how to add another user). Make sure you become yourself (exit from superuser status) before continuing.
Become the other user via su other (where other is the name of this other user)
Try renaming /tmp/myfile to /tmp/otherfile
Try to delete file /tmp/myfile
Type exit to become yourself again.
Remove file /tmp/myfile
Type exit to save the filesystem.script file.
Change the name of the filesystem.script file to the form lastname_firstname_filesystem.script and email it to the instructor.
Become the root user. In this example, the new user’s name is guest.
Add the new user and create a home directory for that user by typing:
Give the new user a password by typing:
When you are ready to get rid of the user, type: