ch2: Basic Commands and Directory Hierarchy Flashcards
(45 cards)
Globbing
the shell matches simple patterns to file and directory names.
The glob character
*
footnote: tells the shell to match any number of arbitrary characters
instructs the shell to match exactly one arbitrary character
?
When does expansion occur?
Before a command is run
Command used to assign an environment variable
export
PATH variable
A special environment variable that contains the command path, a list of system directories that the shell searches when trying to locate a command.
Standard Error (stderr)
An output stream for diagnostics and debugging
Stream ID of stderr?
2
How to redirect standard error?
2>
What is a downside of the bg command?
A backgrounded process may need to read from STDIN, causing the process to freeze.
How to redirect the output of a backgrounded process
bg > /dev/null
File permission mode user order
User (owner of the file), Group, Other
A file that points to another file or directory
symbolic link
How to create a symbolic link?
target = directory to the symbolic link points to
linkname = the name of the symbolic link
ln -s target linkname
One common use case of _____ _____ is when
a program expects to find a particular file or directory that already exists
somewhere else on your system. You don’t want to make a copy, and if you
can’t change the program, you can just create a _____ _____ from it to the
actual file or directory location.
symbolic links
What is the file extension for a compressed archive?
.tar.gz
What does the /bin directory contain?
Ready-to-run programs (executables), including basic Unix commands such as ls and cp
Most programs in /bin are in binary format created by a C compiler, but some are shell scripts.
What is the purpose of the /dev directory?
Contains device files
You’ll learn more about these in Chapter 3.
What type of files does the /etc directory hold?
User password, boot, device, networking, and other setup files
This directory is core to system configuration.
What is stored in the /home directory?
Home (personal) directories for regular users
Most Unix installations conform to this standard.
What does the /lib directory contain?
Library files containing code that executables can use
There are static and shared libraries; /lib should only contain shared libraries.
What is the function of the /proc directory?
Provides system statistics through a browsable directory-and-file interface
Contains information about currently running processes and some kernel parameters.
What type of data is found in the /run directory?
Runtime data specific to the system, including process IDs, socket files, and status records
This is a recent addition to the root directory.
How is the /sys directory similar to /proc?
Both provide a device and system interface
More details will be discussed in Chapter 3.