![]() |
| Linux: Working with directories - Practice |
Working with directories: Test yourself
Module1 Module2 Practice
1) Display your current directory.
2) Change to the /etc directory.
3) Now change to your home directory using only three key presses.
4) Change to the /boot/grub directory using only eleven key presses.
5) Go to the parent directory of the current directory.
6) Go to the root directory.
7) List the contents of the root directory.
8) List a long listing of the root directory.
9) Stay where you are, and list the contents of /etc.
10) Stay where you are, and list the contents of /bin and /sbin.
11) Stay where you are, and list the contents of ~.
12) List all the files (including hidden files) in your home directory.
13) List the files in /boot in a human-readable format.
14) Create a directory testdir in your home directory.
15) Change to the /etc directory, stay here and create a directory newdir in your home
directory.
16) Create in one command the directories ~/dir1/dir2/dir3 (dir3 is a subdirectory from dir2,
and dir2 is a subdirectory from dir1 ).
17) Remove the directory testdir.
If time permits (or if you are waiting for other students to finish this practice), use and
understand pushd and popd. Use the man page of bash to find information about these commands.
man bash # opens the manual
/pushd # searches for pushd
n # next (do this two/three times)
Module1 Module2 Practice

Comments
Post a Comment