How can you locate something in the filesystem with the least amount of work? You might be tempted to use a graphical (GUI) file manager, but in many cases the command line is faster. If you do a lot of work with your system, learning some pathname power tools can save you a lot of time.
How can you locate something in the filesystem with the least amount of work? You might be tempted to use a graphical (GUI) file manager, but in many cases the command line is faster. If you do a lot of work with your system, learning some pathname power tools can save you a lot of time.
This is the second in a pair of columns about locating things in the filesystem. Last month’s column, “A Very Valuable Find,” (available online at http://www.linux-mag.com/2001-09/power_01.html) explained how to use the find utility to perform sophisticated searches and operations on a collection of files. This month we’ll see what’s really behind pathnames and the current directory, and see tips for working smarter with the Linux filesystem.
Two Paths to the Very Same Place
Let’s start with a few basic definitions.
The directory that holds all other directories (as its subdirectories) is called the root directory, also referred to as / (”slash”).
Every Linux user has a home directory, which typically stores the user’s files.
Every Linux process — including your login shell process — has its own current directory, which it can change at any time. You can think of the current directory as the directory where the process is “located” in the filesystem hierarchy.
A pathname is the location of something (a file, a directory, a FIFO, etc.) in the filesystem. There are two types of pathnames: absolute pathnames (also called full…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: