WK3 Core commands for navigation and reading files Flashcards
The Filesystem Hierarchy Standard
The Filesystem Hierarchy Standard, or FHS, is the component of the Linux OS that organizes data. This file system is a very important part of Linux because everything we do in Linux is considered a file somewhere in the system’s directory. The FHS is a hierarchical system, and just like with a tree, everything grows and branches out from the root.
The root directory
The root directory is the highest-level directory in Linux. It’s designated by a single slash.
Subdirectories
The subdirectories branch out further and further away from the root directory. When describing the directory structure in Linux, slashes are used when tracing back through these branches to the root. For example, here, the first slash indicates the root directory. Then it branches out a level into the home subdirectory. Another slash indicates it is branching out again. This time it’s to the analyst subdirectory that is located within home
/home/analyst
pwd
pwd prints the working directory onto the screen. When you use this command, the output tells you which directory you’re currently in.
ls
ls (LS) displays the names of files and directories in the current working directory.
cd
cd navigates between directories. This is the command you’ll use when you want to change directories.
cat
cat displays the content of a file.
head
It displays just the beginning of a file, by default ten lines.