Learn Linux Quickly
上QQ阅读APP看书,第一时间看更新

Knowledge check

For the following exercises, open up your Terminal and try to solve the following tasks:

  1. Display the inode number of the /var/log directory.
  2. Display the number of hard links for the /boot directory.
  3. Create a new directory named coins in your home directory.
  4. Create a soft link to coins named currency.
  5. Inside the coins directory, create two files – silver and gold.
  6. Create a new file bronze inside currency.
  7. List the contents of both directories – coins and currency.
  8. Create a new file beverages with the line "coffee is awesome" in your home directory and create a hard link named drinks to beverages.
  9. Add the line "lemon is refreshing" to the drinks file and then remove the beverages file.
  10. Display the contents of your drinks file.

True or false

  1. The File Name is a part of the inode data structure.
  2. The File Size is a part of the inode data structure.
  3. You can create soft links to directories.
  4. You can create hard links to directories.
  5. The minimum number of hard links for a directory is 2.
  6. Soft links have the same inode number as the original file.
  7. Hard links have the same inode number as the original file.