shell history and Tab completion Flashcards

1
Q

to exit out of “reverse search” in shell, type:

A

ctrl g

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

to enter the reverse search type:

A

ctrl r

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

your history files are stored in your?

A

home directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

These are some common stored history commands files:

A

~/.bash_history
~/.history displays the shell history with numbers
~/.histfile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

the _______command controls the number of commands to retain in history

A

HISTSIZE (default is 500)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

You can use your ______ key to autocomplete:
commands
files, directories,paths
environmental variables
Usernames

A

tab

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

This command displays your shell history:

A

history

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If you want to increase your history size, use this command:
and place it in your personal initialization files

A

export HISTSIZE=whatever number you want

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

To see a certain or Rerun a command line number in your history, type

A

!N or “Bang” and the number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

to repeat the previous command line

A

!! or bang bang

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

to repeat the most recent command starting with “string”

A

!string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does this command represent

! : N

A

<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>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

More short cuts -

!^

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly