shell history and Tab completion Flashcards
to exit out of “reverse search” in shell, type:
ctrl g
to enter the reverse search type:
ctrl r
your history files are stored in your?
home directory
These are some common stored history commands files:
~/.bash_history
~/.history displays the shell history with numbers
~/.histfile
the _______command controls the number of commands to retain in history
HISTSIZE (default is 500)
You can use your ______ key to autocomplete:
commands
files, directories,paths
environmental variables
Usernames
tab
This command displays your shell history:
history
If you want to increase your history size, use this command:
and place it in your personal initialization files
export HISTSIZE=whatever number you want
To see a certain or Rerun a command line number in your history, type
!N or “Bang” and the number
to repeat the previous command line
!! or bang bang
to repeat the most recent command starting with “string”
!string
What does this command represent
! : N
<EVENT> <Separator><Word>
! Represents a command line ( or event )
! = The most recent command line
! = !!
\: N Represents a word on the command line
0 = command, 1 = first argument, etc.
</Word></Separator></EVENT>
More short cuts -
!^
Represents the first argument.
!^ is the same as ! : 1
!$ represents the last argument
examples-
user$ head.files.txt sorted_files.txt notes.txt
!^ = files.txt
!$ = notes.txt