Chapter 1: Exploring Linux Command-Line Tools Flashcards
shell
A program that interprets text commands and provides an interface to the system, e.g. bash in terminal.
Environment Variables
Placeholders for for data that may be useful to many programs
bash
Most common default shell
sh
The original Bourne shell which bash is based off of, and not often used
tcsh
Based on the C shell (csh), fairly popular
ksh
The Korn shell, designed to combine the best features of sh and csh
zsh
Tries to extend ksh
Default Interactive Shell
The shell a user uses to enter commands, run run programs, run shell scripts, etc., from command line.
Default System Shell
Used to run system shell scripts, typically at startup
/bin/sh
A file that points to the system’s default system shell (normally bin/bash)
uname -a
Shows the operating system being run, along with hostname and kernel version
Built-In Commands
Commands built into the shell program, AKA internal commands
time
Command that tells you how long commands take to execute, e.g. time pwd tells you how long pwd takes to execute
set
Displays options relating to bash shell operation.
Can also change options if specified.
exit and logout
exit terminates any shell, and logout terminates only login shells
type ____
Checks if a command is internal or external
type -a ____
Same as type, but checks to see if there are both internal and external versions of the command
path
A list of directories in which commands can be found
How to Search for a Previously Done Command
Ctrl+R then type what you’re looking for.
Ctrl+S to search forward if you pass what you were looking for
If Ctrl+S not working when searching for a command, what command should you use to fix it?
stty -ixon
How to exit searching for a command?
Ctrl+G
How to move to beginning of line?
Ctrl+A
How to move to end of line?
Ctrl+E
How to move through a line one word at a time?
Ctrl+Left or Right Arrow