 |
|
Oracle Tips by Burleson |
Directory Structure
As mentioned, Linux stores files in directories (folders) which
are arranged in a hierarchical or tree structure. The base
(lowest level) directory is called root and is identified by a slash
character. All other directories in Linux stem from the root
directory. It is admittedly easier to envision the overall
structure of your server’s directories using a GUI interface such
as Gnome. The following is an example GUI display of the
directory structure of a Linux server. You’ll notice that we are
in the /boot directory which contains two sub-directories (/grub
and /lost+found) displayed as folders and numerous files
displayed as icons depending upon file type.
Please zoom-in, crop and make black and white
Figure x - xzzz
Again, this book assumes that a GUI environment is not
available and that you are limited to command line entry of
commands. You can use the tree command to display the
directory tree from the command line, but the displayed output
can be rather cumbersome to decipher. By default, the tree
command starts in the current working directory and creates a
graphic display of all child directories and the files in each
directory. Depending on where you are in the directory tree,
the output can be expansive. If you would like to limit the
display to just directories without the files contained in each
directory, then use the –d option. The following is an example
of the output from the tree command with and without the –d
option.
$ tree without –d
option
.
|-- System.map -> System.map-2.4.9-e.25
|-- System.map-2.4.9-e.25
|-- System.map-2.4.9-e.3
|-- boot.b
|-- chain.b
|-- grub
| |-- device.map
| |-- e2fs_stage1_5
| |-- fat_stage1_5
| |-- ffs_stage1_5
| |-- grub.conf
| |-- menu.lst -> ./grub.conf
| |-- minix_stage1_5
| |-- reiserfs_stage1_5
| |-- splash.xpm.gz
| |-- stage1
| |-- stage2
| `-- vstafs_stage1_5
|-- initrd-2.4.9-e.25.img
|-- initrd-2.4.9-e.3.img
|-- kernel.h -> kernel.h-2.4.9
|-- kernel.h-2.4.9
|-- lost+found [error opening dir]
|-- message
|-- module-info -> module-info-2.4.9-e.25
|-- module-info-2.4.9-e.25
|-- module-info-2.4.9-e.3
|-- os2_d.b
|-- vmlinux-2.4.9-e.25
|-- vmlinux-2.4.9-e.3
|-- vmlinuz -> vmlinuz-2.4.9-e.25
|-- vmlinuz-2.4.9-e.25
`-- vmlinuz-2.4.9-e.3
2 directories, 31 files
$ tree –d with –d option
.
|-- grub
`-- lost+found [error opening dir]
2 directories
The above book excerpt is from:
Easy Linux
Commands
Working Examples of Linux Command Syntax
ISBN:
0-9759135-0-6
Terry Clark
http://www.rampant-books.com/book_2005_1_linux_commands.htm |