1/36
Flashcards covering key terms and definitions related to UNIX shells, shell choices, history, environment variables, prompts, and aliases, based on the provided lecture notes.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Shell
A Unix program that acts as an interface between the user and the system, running other Unix commands; essentially, the command line itself.
sh
The Bourne Shell, one of the different types of Unix shells.
csh
The C shell, one of the different types of Unix shells.
tsch
The Turbo C Shell, one of the different types of Unix shells.
ksh
The Korn shell, one of the different types of Unix shells.
bash
The Bourne Again Shell, one of the different types of Unix shells, and the most commonly used.
Shell Differences
While all shells run programs the same way, they differ in features, such as 'bells and whistles' and shell programming capabilities.
printenv SHELL or echo $SHELL
Commands used to check which shell you are currently using.
chsh
A program used to permanently change your default shell every time you login.
.login or .profile
Startup files that get read only once when you login to a Unix system.
.bashrc or .tcshrc
Startup files that get run every time a new shell is created.
HOSTNAME
An environment variable that indicates the name of the host machine.
TERM
An environment variable specifying the terminal type.
SHELL (environment variable)
An environment variable that specifies the path to the user's login shell.
HISTSIZE
An environment variable that defines the number of recent commands Bash will keep track of in its history.
USER
An environment variable indicating the current logged-in user's username.
PWD
An environment variable indicating the current working directory.
HOME
An environment variable indicating the path to the user's home directory.
VISUAL or EDITOR
Environment variables that typically specify the default text editor to be used.
PS1
An environment variable that determines the appearance and content of your command prompt.
\H or \h
Special prompt symbols that display the hostname.
\T, \t, or \@
Special prompt symbols that display the current time.
\u
Special prompt symbol that displays the current username.
\w or \W
Special prompt symbols that display the current working directory.
!
Special prompt symbol that displays the command line number.
Backtick (`)
Used in the PS1 environment variable to execute a program and embed its output directly into the prompt.
Bash History
A feature where Bash keeps track of the most recent commands entered, configurable by HISTSIZE.
.bash_history
A hidden file in the user's HOME directory where Bash history is stored, updated after logout.
history [NUMBER]
A command that prints out all of your most recent commands, assigning a number to each.
!!
A Bash shortcut to repeat and execute the last command.
!NUMBER
A Bash shortcut to execute a command from history based on its assigned number, e.g., !123.
!CHARS
A Bash shortcut to execute the most recent command that starts with the specified characters, e.g., !m.
!*
A history shortcut that gets everything but the first word of the previous command, useful for running a different command with the same arguments.
!$
A history shortcut that gets just the last word of the previous command.
Aliases
User-defined shortcuts that create an alternative name for a specific command or sequence of commands, useful for consistently applying flags.
alias NAME="COMMAND"
The command syntax used to set an alias, e.g., alias ll="ls –l".
unalias NAME
The command syntax used to remove a previously set alias, e.g., unalias cp.