Your Turn

Before you move on to creating and managing your own files and directories, make sure you’re comfortable navigating around the filesystem. Once you are, you’ll be able to use absolute and relative paths with many other commands without having to stop and think. Do the following exercises to practice moving around your filesystem:

  1. Navigate to your home directory.

  2. Use the ls command to list the contents of the /var/log directory.

  3. In a single command, switch to the /usr/local/bin folder.

  4. Switch to the /var/log folder in a single command using double-dot syntax.

  5. Switch to the home directory in a single command by using double-dot syntax.

  6. Use the pushd command to navigate to /opt. Use pushd again to navigate to /var/log. Then use popd to return to your home directory.

  7. Using man find, figure out how to find all the files your user has changed in the last 24 hours. Try to do this without looking on the Internet or other resources. Learning to read the built-in documentation is helpful when exploring more advanced features.

See if you can answer these questions before moving on:

  1. What’s the difference between the /usr/bin and /usr/local/bin directories?

  2. What kind of data is usually stored in the /var directory?

  3. Explain the difference between the following commands:

    • cd
    • cd ..
    • cd .
    • cd /

     

  4. Explain the difference between pushd +2 and cd ~2.

  5. Explain the difference between the df and du commands.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.101.178