Commands Flashcards
pwd
print the working directory
echo STRING
display text from stdin
time COMMAND
times how long COMMAND takes to execute
Three times are displayed: totalexecution time (aka real time); user CPU time; and system CPU time
set
displays a wide variety of options relating to bash shell operation
These options are formatted much like environment variables; but they aren’t the same things. You can pass various options to set to have it affect a wide range of shell operations.
exit
terminates any shell
Login shells are shell programs that are launched automatically when you initiate a text-mode login as opposed to those that run in xterm windows or other terminal emulators
logout
terminates only login shells
Login shells are shell programs that are launched automatically when you initiate a text-mode login as opposed to those that run in xterm windows or other terminal emulators
type COMMAND
tells you how a command you enter will be interpreted—as a built-in command; an external command; an alias; and so on
history
displays all of the commands in the history
typically the latest 500 commands
!!
display and execute the last command in your shell history
!NUMBER
execute command NUMBER from the history
$PATH
a directory list to search when you’re entering command or program names
env
display environment variables
unset VARNAME
unset an environment variable
$PS1
the shell prompt
man COMMAND
display the manual for COMMAND
info COMMAND
hypertext formatted manual
help COMMAND
a built in manual for built in commands
>
Creates a new file containing standard output. If the specified file exists; it’s overwritten. No file descriptor necessary.
> >
Appends standard output to the existing file. If the specified file doesn’t exist; it’s created. No file descriptor necessary.
2>
Creates a new file containing standard error. If the specified file exists; it’s overwritten. File descriptor necessary.
2»
Appends standard error to the existing file. If the specified file doesn’t exist; it’s created. File descriptor necessary.
&>
Creates a new file containing both standard output and standard error. If the specified file exists; it’s overwritten. No file descriptors necessary.
Sends the contents of the specified file to be used as standard input. No file descriptor necessary.
<
Accepts text on the following lines as standard input. No file descriptor necessary.