DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

Figure 2-7 UNIX Directory Structure


Whenever you call a file, you have to supply its path.
Everything you execute in UNIX is in relationship to
root. To execute a file in the directory you are in, you can
use ./filename.sh, where the leading. is simply an alias
for the current directory.


In addition to the root file system, each user has a home
directory that the user controls and that stores the user’s
individual files and applications. The full path to the
home directory often looks something like
/home/username on Linux and /Users/username on
Mac OS X, but you can also use the tilde shortcut (~/) to
reference the home directory.


The following sections describe some of the commands
most commonly used to interact with the BASH shell and
provide examples of their options and use.


cd


The cd command is used to change directories and move
around the file system. You can use it as follows:


$ cd / Changes directory to the root directory

$ cd
/home/usernam
e

Changes directory to the
/home/username directory
Free download pdf