Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Exploring the Linux Filesystem

A familiarity with the structure of the SUSE Linux filesystem and how to navigate it is critical for any system administrator or user. One of the challenges that those using text-only or command-line systems often complain of is the apparent lack of ways to visualize files, directories, and their structure from the console. In this lab look at ways to experience the files and directories on a filesystem in relation to each other, and from different perspectives.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 30m
Published
Clock icon Nov 27, 2019

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Use Command-Line Tools to Visualize Filesystem Structure

    NOTE: The tree command is installed as the system comes live, it may be more than a minute before it's installed and ready for use!

    Use the tree command to visualize the structure of the SUSE Linux filesystem, limiting the depth of queries and using alternative display and searching methods. From our home directory, we can run tree with no options. We'll see all of the directories in ~/, in a tree format. Now, if we run the command against the root of the filesystem, we'll get way more output than we can handle. But try it and see, just to say you did:

    tree /
    

    Remember that you can hit Ctrl +C to stop it. If we want to see that in bite-sized chunks, we can run the same command, but pipe it into less:

    tree / | less
    

    There's still a lot of information there, but we can at least paginate through the results. But even better than that is redirecting all of the tree output to a file:

    tree / > root_file-listing.txt
    

    But do we necessarily need all that? What if we just want to see the directories, and not all of the files in them all? Well, there's an option for that:

    tree -d /
    

    That's still a lot of information. What if we just want the / and its immediate subdirectories (only one level down)? Let's run this tree command:

    tree -L 1
    

    If we change that 1 to a 2, we'll get two levels down from /. We'll notice that we're getting files in our output. What if we only want to see directories? Well, run this:

    tree -L 2 -d
    

    Let's sweeten the deal. Now we're going to show just subdirectories, but we're also going to show permissions. And this time we'll just run it on a directory that's smaller than /:

    tree -d -p /usr/share/doc/release-notes
    

    This will list out /usr/share/doc/release-notes, then all of the subdirectories and their permissions, in a tree view.

    There's one last option we ought to see in action, -f. This will show the path of each of the directories/files in the tree output:

    tree -d -p -f /usr/share/doc/release-notes
    

    Note: We can redirect the output from any of these commands to a text file, for later study.

  2. Challenge

    Use the Graphical File Manager to Create a Directory and Copy Files into that Directory

    Logging into the GUI

    1. Launch your VNC client
    2. Copy the remote lab/playground server public IP address
    3. Enter the following on your VNC Server field: Your_Public_IP:5901
    4. The SLE Server will then load the GUI, and we can log into the desktop using cloud_user and the password available under the lab credentials

    Click on Activities in the upper left of the screen. Click on the Files icon (the blue file cabinet) Click Documents on the left.

    Click on the icon (in the upper right of this window) that looks like three horizontal lines. Click the icon with a folder next to a + sign Enter a name like my_dir and click Create.

    Create a new tab in the window.Ctrl + T With the right-hand Documents tab highlighted Click on + Other Locations Click on Computer Right click on config.bootoptions Select Copy to.... Navigate to Documents and my_dir Click the Select button in the top right of the window.

    In that same right-hand tab, navigate again to + Other Locations, Computer, then usr -> share -> bash -> helpfiles. Click on one, any one, and then drag it up to the left-hand tab and hover The tab will turn green, and display that directory. drag the file and put it in our my_dir directory

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans