Navigating the Linux Filesystem - page 2
Let's go back to that filesystem in Figure 1, where we'd gotten as far
as /home. But you can string together more than one directory in a
pathname. You know that /home gets you one level below the root;
but if you add another directory, you can refer to useful places
/home/sue. On most systems, that's where the user
named sue would have her home directory. So when Sue first
logs in, her working directory is her home directory,
Remember I said how important it is whether you start with a slash? Suppose Sue has a directory of her own called "home", where she keeps all the records related to her house. If she's in her home directory and types "ls home", that's very different from "ls /home", as Figure 2 illustrates.
$ ls /home fred sue $ ls home mortgage.ods paintcodes.odf photosSee the difference?
Now let's say, going back to Figure 1, that Sue wants to
share a photo of her dog with Fred, who has an account on the same
system. All she has to do is tell him the full pathname to the photo
There's a shortcut, though. You can use the tilde character, ~, to
refer to home directories. A tilde by itself means your own home
directory: if Sue wants to edit the Fido photo in GIMP, she can say
The ~ stands for /home/sue in any command Sue types.
When Fred types a ~, though, Linux will look in /home/fred instead.
If Sue wants to tell Fred where to find her Fido photo, she should
use the slightly longer form "~sue", which means "the home directory of
user sue", or /home/sue. So she gives Fred the pathname:
~sue/Pictures/pets/fido.jpg, and Fred can use that from
Of course, Fred can't necessarily read Sue's files, and vice versa -- there are ways of protecting your files so no one else can see them. But that's a topic for another day!
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: GNOME 3.12 and New Betas for Ubuntu 14.04 and OpenMandriva Lx 2014.0
- 2Linux Top 3: Linux 3.10 Goes Long, Linux 3.11 Advances as LXDE Merges
- 3Linux Top 3: Linus Lashes out, Linux 3.14 Gets PIE and Ubuntu One is Done.
- 4Why Linux is Super (Computing)
- 5Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic