Command Line Interface Flashcards

0
Q

prompt

A

Prompt when logged in as root

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

$ prompt

A

Prompt when logged in as a regular user

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

exit

A

Logs the user off

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

clear

A

Clears the screen

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

pwd

A

Print working directory. Shows the current path.

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

/

A

Root location on the drive

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

/home

A

Where user home accounts live.

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

ls

A

Lists contents of current folder. Doesn’t show hidden files or attributes without flags.

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

ls -a

A

Lists all files, including hidden (‘all’) files.

Flag -a shows hidden files

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

ls –help

A

Shows possible flags/modifiers for the ls command

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

ls -l

A

Lists files in long format.

-l flag shows more information about each file, including permissions, file size, modified date.

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

ls -la

A

Lists all files, including hidden files, with detailed information

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

bash

A

Bourne again shell. The default shell.

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

sh

A

Bourne shell. Earlier version of bash.

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

ksh

A

Korn shell. Developed by David Korn. Has scripting features that are not found in bash

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

csh

A

C shell. Uses a syntax that is similar to the syntax used in the C programming language

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

tsch

A

An improved version of csh. It offers commandline editing and completion features not available with csh.

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

Where is the list of available shells stored?

A

/etc/shells

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

bash

A

The Bourne again shell. The standard shell on most Linux computers.

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

ash

A

The Bourne shell. Earlier version of bash.

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

ksh

A

Korn shell, developed by David Korn. Has scripting features not present in bash.

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

csh

A

C shell. Syntax similar to the c programming language.

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

tsch

A

Improved version of csh. Offers command line editing and completion features not available in csh.

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

Where can you find a list of shells?

A

/etc/shells

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

What is the command path?

A

The set of directories in which Linux searches to find executable files

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

Does the command path include the present working directory?

A

No

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

How can you see the command path?

A

echo $PATH

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

How do you add a directory to the command path?

A

PATH:$PATH:[insert new path here]

28
Q

What are the three ways to execute a program in Linux?

A
  1. Type the executable name (only if the name is in the command path)
  2. Type ./file name if the executable is in the pwd
  3. Type the full pathname
29
Q

pwd

A

Shows the present working directory

30
Q

whoami

A

Shows the current username

31
Q

uname

A

Shows system information. Available flags: a, o, p.

32
Q

uname -a

A

Shows all system information

33
Q

uname -o

A

Shows the operating system

34
Q

uname -p

A

Shows the processor architecture type

35
Q

su

A

Switches users. Without flags, switches to the root user, and does not load any environment variables.

36
Q

su -l [username]

A

Switches to the specified user in a login shell

37
Q

su [username]

A

Switches to the specified user

38
Q

su - [username]

A

Switches to the specified user and also loads that user’s environment variables.

39
Q

su -

A

Switches to the root user and loads the root user’s environment variables.

40
Q

exit

A

Exits the login shell, or goes back to the original user after a su

41
Q

exec

A

Executes and executable and replaces the shell with the new process created by the executable

42
Q

cd

A

Changes directories

43
Q

ls

A

Lists the contends of a directory

44
Q

ls -a

A

Lists all contents of a directory including any hidden files

45
Q

ls -l

A

Lists detailed information about the contents of a directory including file size, permissions, owner, last modified date

46
Q

ls -d

A

Lists only directories

47
Q

ls -s

A

Lists contents of a directory and sorts by size

48
Q

ls -X

A

lists contents of a directory and sorts by extension

49
Q

history

A

Shows all commands in the history queue.

50
Q

history -c

A

Clears the history queue

51
Q

clear

A

Clears the shell screen

52
Q

chsh

A

Changes the default shell. (e.g., chsh -s /bin/ksh changes the default shell to the Korn shell)

53
Q

chsh -s [shell path]

A

Changes the default shell to the specified shell.

54
Q

chsh -l

A

Lists all installed shells

55
Q

What is the login shell?

A

It is a shell that is run only when the system starts and is only using the text interface.

56
Q

What is a non-login shell?

A

It is a shell that is run when the system boots into a graphical user interface add a user requests to start a terminal session.

57
Q

Where are shell preferences for individual users stored?

A

~/.bashrc (for non-login shells)

~/.bash_profile (for login shells)

58
Q

Where are systemwide configuration command stored?

A

/etc/profile

This is used primarily to set environment variables.

59
Q

Where are commands stored that are executed when a user logs in?

A

~/.bash_login

60
Q

Where are individual users’ configuration preferences stored?

A

~/.profile

61
Q

Where are commands stored that are executed when a user logs out?

A

~/.bash_logout

62
Q

What is the order in which login shells execute the configuration scripts that they use?

A

1: /etc/profile
2: ~/.bash_profile
3: ~/.bash_login
4: ~/.profile

63
Q

su -l

A

Switches to a login shell.

64
Q

what is the command to start a new shell session?

A

bash

65
Q

Where are documentation files stored?

A

/usr/share/doc

66
Q

man [command]

A

Displays the manual page for the command. Rarely gives examples. For examples, use info instead

67
Q

info

A

More expansive version of man; gives more helpful documentation

68
Q

How to get help at the shell prompt

A

add –help or -? after a command in the shell.