Customizing the Bash Shell Flashcards Preview

Linux+ (LXO-104) > Customizing the Bash Shell > Flashcards

Flashcards in Customizing the Bash Shell Deck (33):
1

env

Displays all environment variables

2

$USER

- Current user's username.
- "whoami" displays this

3

$SHELL

Shell the user is working as

4

$TERM

Current terminal

5

$PS1

Default bash prompt

6

\h

hostname

7

\w

current working directory (shows entire path)

8

\W

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

9

\u

username

10

\@

12 hour am/pm date

11

\t

24 hour hh:mm:ss

12

\T

12 hour hh:mm:ss

13

\j

number of jobs running on the shell

14

\d

date

15

\H

full hostname

16

$HOME

User's home directory path

17

$LD_LIBRARY_PATH

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

18

$HOSTNAME

System hostname

19

$PWD

Current working directory

20

$EDITOR

Default editor when the system opens files

21

$MAIL

Holds the location of the users mail spool

22

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

alias openfile="vi file.txt"

23

Global bash config file

/etc/bashrc (Red Hat/CentOS)

/etc/bash.bashrc (Debian/Ubuntu)

24

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

/etc/skel

25

/etc/profile

File used to set/change shell variables for all users

26

~/.bash_login

File is executed when a user logs in to the shell

27

~/.bash_logout

File is executed when a user exits the shell

28

env -u

Remove a specific environment variable

29

~/.profile

Used to change shell variables for a specific user

30

How to declare a bash function

functionName() {

}

31

unset

Unset an environment variable

32

~/.bashrc

File used to alter an individual user's environment

33

bash -r

Restrictive mode for bash shell