Navigating klone
In this section we will discuss the klone
file system and navigating through drectories.
Important Concept: CLI vs. GUI
The command-line interface (CLI) allows for faster and more precise control over tasks through direct text commands, reducing the overhead of navigating graphical elements that accompany Graphical User Interfaces (GUIs). It also supports automation and scripting, enabling complex, repetitive tasks to be executed efficiently with minimal user intervention.
Here are some examples of GUIs which you interact with on your local computer as a regular user:
- Windows Explorer - a file management tool for Windows that visually represents files, folders, and drives, translating the command-based operations of Command Prompt or PowerShell into intuitive, clickable icons and windows.
- MacOS Finder - a file management tool for MacOS that visually organizes and allows navigation of files, folders, and applications, translating the command-based operations of the Terminal into an intuitive, icon-based environment.
That's right, everytime you click and icon or item in Windows Explorer or Finder, a program is running on the command line in the background to perform the action such as viewing a list of files, opening a file, or executing an application.
Visualize your Windows Explorer or Finder. As you click on directory or folder icons, you move through your local computer's file system to view items (documents, scripts, photos) inside. In this section we will use the CLI to move through directories and view their content on klone
. We will use commands to call programs that tell use "where we are" on klone
and what items we can access.
#
Location is KeyIn this section, we will introduce three commands that you should get into the habit of using if you are brand new to klone
. These commands will help you navigate around through klone
directories, know "where you are", and know what else is in the location or place in the klone
filesystem.
pwd
#
pwd
shows you "where you are" or more specifically which directory your shell is inside of on klone
.#
"print working directory" or For example, as the author of this documentation (username finchkn
), when I use pwd
after I login, I see:
/mmfs1/home/finchkn
is the "address" or absolute path of my Home directory on klone
. If you just logged in, yours will be /mmfs1/home/UWNetID
but showing your UW Net ID.
cd
#
cd
to move into a different directory on klone.#
"change directory" or In this example, we will use cd
and pwd
to move to the directory where our data for this tutorial is stored on klone
and then back to our Home directory.
Additionally, your new shell prompt will show your your new location in short form:
Now use pwd
to show your "address" or the absolute path to the directory with our tutorial data:
Now let's go back to our Home directory to complete this exercise.
And your prompt should once again show ~
as your location:
PRO TRIP - FYI
There are many shortcuts to get back to your Home directory from anywhere on klone
with cd
.
In this case, echo $HOME
does the same thing as pwd
when you execute pwd
from your Home directory.
The concept of "location" is important because where you are on klone
can determine what data you have access.
ls
#
ls
to show the contents of your current directory or "location" in the filesystem.#
"list" or If you have just started as a Hyak user, your Home directory might be empty.
Executing the command above may produce no result if you haven't logged in before. However, we can use ls
to explore the klone
filesystem and help us batter understand how to navigate it.
Let's use cd
to go to the base of the klone
filesystem, which is called the "root." Rather than being called "root" the root directory is referred to as /
. Let's move to the root directory and list its contents.
ls
in /
should produce the following:
You have just listed the contents of the root directory, and the items here are other directories or shortcuts.
Within the root directory are the directories listed above, including mmfs1/
. Use ls
to list the contents of mmfs1/
:
ls
in mmfs1
should produce the following:
Some of these names might be familiar to you. For example, every user on Hyak has a Home directory, which, like yours, is inside of the directory called mmfs1/
which has a directory inside of it called home/
which has a directory for each Hyak user. Similarly, above we changed directory to a directory inside of mmfs1/
called sw/
.
Picture the klone
filesystem as an upside down tree. The topmost directory is the root directory (/
) that holds everything else. The picture is a truncated view of the filesystem showing the root directory /
, a few directories within it, including mmfs1
and a few directories within mmfs1/
: home/
where the Home directories are, sw/
where we keep software and scripts, and gscratch/
where the lab groups that contribute to Hyak have their storage directories.
With Windows File Explorer and MacOS Finder, you can click on icons like those shown in the photo to navigate your filesystem, opening directories and listing contents, on klone
and most CLIs, we navigate the filesystem with these commands. You'll get the hang of it fast.
Let's practice a little now. Start in the root directory if you aren't there already:
note
Notice that there are two meanings for the / character. When it appears at the front of a file or directory name, it refers to the root directory. When it appears inside a path, it’s just a separator.
ls -l
lists contents showing their permissions (Learn more about permissions here.), date of last edit, and their owner. Most items within the root directory are owned by "root" our name for our administrator. There are many flags for ls
that can help you list contents in different ways, and many users have their favorite set of flags that they use regularly. Review all possible flags with the following command:
The man
command stands for manual pages and brings up the user guide for a command. Another way to learn what a command does is with the help pages. Activate ls
help pages with:
As you use cd
and ls
to explore klone
you might run into the message "Permission denied". Being a shared resource, not all locatations on klone
are open to you listing contents, etc.
#
Node vs. Directory PathAnother important aspect of location on klone
is the node or computer that you are using at any given time. Your prompt also shows you this location.
As mentioned in the last section, @klone-login01
indicates I am logged into or using one of the login nodes Hyak. Later when we learn how to start interactive jobs, this part of our prompt will change, indicating we are on a different node. Importantly, just because you are on a different node, your Home directory and working directories (for example, directories under your lab group's /gscratch
or under /gscratch/scrubbed
) will have the same absolute path across all computers in the klone
cluster.
In the next section, we will learn more commands to help you get used to klone
's Linux CLI.