Contents
Abstract
These days many people use computers with a graphical user interface (GUI) like KDE or GNOME. Although they offer lots of features, their use is limited when it comes to the execution of automatical tasks. Shells are a good addition to GUIs and this chapter gives you an overview of some aspects of shells, in this case Bash.
Traditionally, the shell is Bash (Bourne again Shell). When this chapter speaks about “the shell” it means Bash. There are actually more available shells than Bash (ash, csh, ksh, zsh, …), each employing different features and characteristics. If you need further information about other shells, search for shell in YaST.
A shell can be invoked as an:
interactive login shell. This is used when logging in to a machine,
invoking Bash with the --login option or when logging
in to a remote machine with SSH.
“ordinary” interactive shell. This is normally the case when starting xterm, konsole or similar tools.
non-interactive shell. This is used when invoking a shell script at the commandline.
Depending on which type of shell you use, different configuration files are being read. The following tables show the login and non-login shell configuration files.
Table 20.1. Bash Configuration Files for Login Shells
|
File |
Description |
|---|---|
|
|
Do not modify this file, otherwise your modifications can be destroyed during your next update! |
|
|
Use this file if you extend |
|
|
Contains system-wide configuration files for specific programs |
|
|
Insert user specific configuration for login shells here |
Table 20.2. Bash Configuration Files for Non-Login Shells
|
|
Do not modify this file, otherwise your modifications can be destroyed during your next update! |
|
|
Use this file to insert your system-wide modifications for Bash only |
|
|
Insert user specific configuration here |
Additionally, Bash uses some more files:
Table 20.3. Special Files for Bash
|
File |
Description |
|---|---|
|
|
Contains a list of all commands you have been typing |
|
|
Executed when logging out |
The following table provides a short overview of the most important higher-level directories that you find on a Linux system. Find more detailed information about the directories and important subdirectories in the following list.
Table 20.4. Overview of a Standard Directory Tree
|
Directory |
Contents |
|---|---|
|
Root directory—the starting point of the directory tree. | |
|
Essential binary files, such as commands that are needed by both the system administrator and normal users. Usually also contains the shells, such as Bash. | |
|
Static files of the boot loader. | |
|
Files needed to access host-specific devices. | |
|
Host-specific system configuration files. | |
|
Holds the home directories of all users who have accounts on the
system. However, | |
|
Essential shared libraries and kernel modules. | |
|
Mount points for removable media. | |
|
Mount point for temporarily mounting a file system. | |
|
Add-on application software packages. | |
|
Home directory for the superuser | |
|
Essential system binaries. | |
|
Data for services provided by the system. | |
|
Temporary files. | |
|
Secondary hierarchy with read-only data. | |
|
Variable data such as log files. | |
|
Only available if you have both Microsoft Windows* and Linux installed on your system. Contains the Windows data. |
The following list provides more detailed information and gives some examples of which files and subdirectories can be found in the directories:
/bin
Contains the basic shell commands that may be used both by root
and by other users. These commands include ls,
mkdir, cp, mv,
rm and rmdir.
/bin also contains Bash, the default shell in
openSUSE.
/boot
Contains data required for booting, such as the boot loader, the kernel, and other data that is used before the kernel begins executing user-mode programs.
/dev
Holds device files that represent hardware components.
/etc
Contains local configuration files that control the operation of
programs like the X Window System. The /etc/init.d
subdirectory contains scripts that are executed during the boot
process.
/home/username
Holds the private data of every user who has an account on the system.
The files located here can only be modified by their owner or by the
system administrator. By default, your e-mail directory and personal
desktop configuration are located here in the form of hidden files and
directories. KDE users find the personal configuration data for their
desktop in .kde or .kde4 .
GNOME users find it in .gconf.
For information about hidden files, refer to
Section “Key Features” (Chapter 6, Basic Concepts, ↑Start-Up).
![]() | Home Directory in a Network Environment |
|---|---|
If you are working in a network environment, your home directory may
be mapped to a directory in the file system other than
| |
/lib
Contains the essential shared libraries needed to boot the system and to run the commands in the root file system. The Windows equivalent for shared libraries are DLL files.
/media
Contains mount points for removable media, such as CD-ROMs, USB sticks
and digital cameras (if they use USB). /media
generally holds any type of drive except the hard drive of your system.
As soon as your removable medium has been inserted or connected to the
system and has been mounted, you can access it from here.
/mnt
This directory provides a mount point for a temporarily mounted file
system. root may mount file systems here.
/opt
Reserved for the installation of additional software. Optional software
and larger add-on program packages can be found here. KDE3 is located
here, whereas KDE4 and GNOME have moved to /usr
now.
/root
Home directory for the root user. The personal data of root
is located here.
/sbin
As the s indicates, this directory holds utilities
for the superuser. /sbin contains the binaries
essential for booting, restoring and recovering the system in addition
to the binaries in /bin.
/srv
Holds data for services provided by the system, such as FTP and HTTP.
/tmp
This directory is used by programs that require the temporary storage of files.
/usr
/usr has nothing to do with users, but is the
acronym for UNIX system resources. The data in
/usr is static, read-only data that can be shared
among various hosts compliant with the Filesystem Hierarchy Standard
(FHS). This directory contains all application programs and establishes
a secondary hierarchy in the file system. KDE4 and GNOME are also
located here. /usr holds a number of
subdirectories, such as /usr/bin,
/usr/sbin, /usr/local, and
/usr/share/doc.
/usr/bin
Contains generally accessible programs.
/usr/sbin
Contains programs reserved for the system administrator, such as repair functions.
/usr/local
In this directory the system administrator can install local, distribution-independent extensions.
/usr/share/doc
Holds various documentation files and the release notes for your
system. In the manual subdirectory find an online
version of this manual. If more than one language is installed, this
directory may contain versions of the manuals for different languages.
Under packages find the documentation included in
the software packages installed on your system. For every package, a
subdirectory
/usr/share/doc/packages/
is created that often holds README files for the package and sometimes
examples, configuration files or additional scripts.
packagename
If HOWTOs are installed on your system
/usr/share/doc also holds the
howto subdirectory in which to find additional
documentation on many tasks related to the setup and operation of Linux
software.
/var
Whereas /usr holds static, read-only data,
/var is for data which is written during system
operation and thus is variable data, such as log files or spooling
data. For an overview of the most important log files you can find
under /var/log/, refer to
Table “Log Files” (↑Start-Up).
/windows
Only available if you have both Microsoft Windows and Linux installed on your system. Contains the Windows data available on the Windows partition of your system. Whether you can edit the data in this directory depends on the file system your Windows partition uses. If it is FAT32, you can open and edit the files in this directory. For NTFS, openSUSE also includes write access support. However, the driver for the NTFS-3g file system has limited functionality. Learn more in Section 34.4, “Accessing Files on Different OS on the Same Computer”.