Customizing the Bash Shell Flashcards

1
Q

env

A

Displays all environment variables

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

$USER

A
  • Current user’s username.

- “whoami” displays this

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

$SHELL

A

Shell the user is working as

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

$TERM

A

Current terminal

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

$PS1

A

Default bash prompt

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

\h

A

hostname

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

\w

A

current working directory (shows entire path)

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

\W

A

current working directory (only shows the one specific directory name you are in)

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

\u

A

username

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

\@

A

12 hour am/pm date

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

\t

A

24 hour hh:mm:ss

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

\T

A

12 hour hh:mm:ss

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

\j

A

number of jobs running on the shell

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

\d

A

date

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

\H

A

full hostname

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

$HOME

A

User’s home directory path

17
Q

$LD_LIBRARY_PATH

A

Directory in which libraries are found and bin executable files are located

18
Q

$HOSTNAME

A

System hostname

19
Q

$PWD

A

Current working directory

20
Q

$EDITOR

A

Default editor when the system opens files

21
Q

$MAIL

A

Holds the location of the users mail spool

22
Q

Create an alias to the command “vi file.txt” called openfile

A

alias openfile=”vi file.txt”

23
Q

Global bash config file

A

/etc/bashrc (Red Hat/CentOS)

/etc/bash.bashrc (Debian/Ubuntu)

24
Q

Directory containing what should be given to new users by default when they are created

A

/etc/skel

25
Q

/etc/profile

A

File used to set/change shell variables for all users

26
Q

~/.bash_login

A

File is executed when a user logs in to the shell

27
Q

~/.bash_logout

A

File is executed when a user exits the shell

28
Q

env -u

A

Remove a specific environment variable

29
Q

~/.profile

A

Used to change shell variables for a specific user

30
Q

How to declare a bash function

A

functionName() {

}

31
Q

unset

A

Unset an environment variable

32
Q

~/.bashrc

A

File used to alter an individual user’s environment

33
Q

bash -r

A

Restrictive mode for bash shell