Skip to main content
Copy edited (e.g. ref. <http://en.wikipedia.org/wiki/Mac_OS_X>, <http://en.wikipedia.org/wiki/Unix>, and <http://en.wikipedia.org/wiki/Raspberry_Pi>).
Source Link

To go into a bit more detail —

Whether you come from a Windows or Mac OSXOS X background, you will be used to external drives being independent places from your hard disk (more or less).

Part of UNIXUnix tradition is "avoid special cases wherever possible". For instance in UNIXUnix (and GNU/Linux), a keyboard is represented as a file that can be opened and read from just like a text file. So is a serial port (which can be written to as well). On a Raspberry PIPi even the GPIO pins can be controlled like this. There is a file called /dev/zero that produces a sequence of 0-bytes when you read it. etcEtc.

This was a brilliant idea as it allowed programs to be constructed without having all sorts of special cases.

Anyway, in a similar tradition, there is one directory structure for the entire system, starting at / (the root directory). No special cases, no "drive letters". Just /.

Drives can be "attached" somewhere in this structure using the mount command (an RPiRaspberry Pi is configured to do this automatically, but you can also do it manually).

Every file's path descends from / in some way (for example, /home/pi/test.txt). Because of this, a path starting with / is assumed to be an "absolute" path, starting from the root directory of the entire system. Without the / at the start, it is considered a "relative" path, i.e. it starts from the current directory.

Two other tricks—you probably know that a path starting with .. refers to the parent directory. A path starting with ~ starts from your home directory, e.g. ~/test.txt works the same no matter what your current directory is.

To go into a bit more detail —

Whether you come from a Windows or Mac OSX background, you will be used to external drives being independent places from your hard disk (more or less).

Part of UNIX tradition is "avoid special cases wherever possible". For instance in UNIX (and GNU/Linux), a keyboard is represented as a file that can be opened and read from just like a text file. So is a serial port (which can be written to as well). On a Raspberry PI even the GPIO pins can be controlled like this. There is a file called /dev/zero that produces a sequence of 0-bytes when you read it. etc.

This was a brilliant idea as it allowed programs to be constructed without having all sorts of special cases.

Anyway, in a similar tradition, there is one directory structure for the entire system, starting at / (the root directory). No special cases, no "drive letters". Just /.

Drives can be "attached" somewhere in this structure using the mount command (an RPi is configured to do this automatically but you can also do it manually).

Every file's path descends from / in some way (for example /home/pi/test.txt). Because of this, a path starting with / is assumed to be an "absolute" path, starting from the root directory of the entire system. Without the / at the start, it is considered a "relative" path, i.e. it starts from the current directory.

Two other tricks—you probably know that a path starting with .. refers to the parent directory. A path starting with ~ starts from your home directory, e.g. ~/test.txt works the same no matter what your current directory is.

To go into a bit more detail —

Whether you come from a Windows or Mac OS X background, you will be used to external drives being independent places from your hard disk (more or less).

Part of Unix tradition is "avoid special cases wherever possible". For instance in Unix (and GNU/Linux), a keyboard is represented as a file that can be opened and read from just like a text file. So is a serial port (which can be written to as well). On a Raspberry Pi even the GPIO pins can be controlled like this. There is a file called /dev/zero that produces a sequence of 0-bytes when you read it. Etc.

This was a brilliant idea as it allowed programs to be constructed without having all sorts of special cases.

Anyway, in a similar tradition, there is one directory structure for the entire system, starting at / (the root directory). No special cases, no "drive letters". Just /.

Drives can be "attached" somewhere in this structure using the mount command (an Raspberry Pi is configured to do this automatically, but you can also do it manually).

Every file's path descends from / in some way (for example, /home/pi/test.txt). Because of this, a path starting with / is assumed to be an "absolute" path, starting from the root directory of the entire system. Without the / at the start, it is considered a "relative" path, i.e. it starts from the current directory.

Two other tricks—you probably know that a path starting with .. refers to the parent directory. A path starting with ~ starts from your home directory, e.g. ~/test.txt works the same no matter what your current directory is.

Source Link
Artelius
  • 201
  • 1
  • 2

To go into a bit more detail —

Whether you come from a Windows or Mac OSX background, you will be used to external drives being independent places from your hard disk (more or less).

Part of UNIX tradition is "avoid special cases wherever possible". For instance in UNIX (and GNU/Linux), a keyboard is represented as a file that can be opened and read from just like a text file. So is a serial port (which can be written to as well). On a Raspberry PI even the GPIO pins can be controlled like this. There is a file called /dev/zero that produces a sequence of 0-bytes when you read it. etc.

This was a brilliant idea as it allowed programs to be constructed without having all sorts of special cases.

Anyway, in a similar tradition, there is one directory structure for the entire system, starting at / (the root directory). No special cases, no "drive letters". Just /.

Drives can be "attached" somewhere in this structure using the mount command (an RPi is configured to do this automatically but you can also do it manually).

Every file's path descends from / in some way (for example /home/pi/test.txt). Because of this, a path starting with / is assumed to be an "absolute" path, starting from the root directory of the entire system. Without the / at the start, it is considered a "relative" path, i.e. it starts from the current directory.

Two other tricks—you probably know that a path starting with .. refers to the parent directory. A path starting with ~ starts from your home directory, e.g. ~/test.txt works the same no matter what your current directory is.