Command Line Interface Flashcards

(69 cards)

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
What is the command path?
The set of directories in which Linux searches to find executable files
25
Does the command path include the present working directory?
No
26
How can you see the command path?
echo $PATH
27
How do you add a directory to the command path?
PATH:$PATH:[insert new path here]
28
What are the three ways to execute a program in Linux?
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
pwd
Shows the present working directory
30
whoami
Shows the current username
31
uname
Shows system information. Available flags: a, o, p.
32
uname -a
Shows all system information
33
uname -o
Shows the operating system
34
uname -p
Shows the processor architecture type
35
su
Switches users. Without flags, switches to the root user, and does not load any environment variables.
36
su -l [username]
Switches to the specified user in a login shell
37
su [username]
Switches to the specified user
38
su - [username]
Switches to the specified user and also loads that user's environment variables.
39
su -
Switches to the root user and loads the root user's environment variables.
40
exit
Exits the login shell, or goes back to the original user after a su
41
exec
Executes and executable and replaces the shell with the new process created by the executable
42
cd
Changes directories
43
ls
Lists the contends of a directory
44
ls -a
Lists all contents of a directory including any hidden files
45
ls -l
Lists detailed information about the contents of a directory including file size, permissions, owner, last modified date
46
ls -d
Lists only directories
47
ls -s
Lists contents of a directory and sorts by size
48
ls -X
lists contents of a directory and sorts by extension
49
history
Shows all commands in the history queue.
50
history -c
Clears the history queue
51
clear
Clears the shell screen
52
chsh
Changes the default shell. (e.g., chsh -s /bin/ksh changes the default shell to the Korn shell)
53
chsh -s [shell path]
Changes the default shell to the specified shell.
54
chsh -l
Lists all installed shells
55
What is the login shell?
It is a shell that is run only when the system starts and is only using the text interface.
56
What is a non-login shell?
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
Where are shell preferences for individual users stored?
~/.bashrc (for non-login shells) ~/.bash_profile (for login shells)
58
Where are systemwide configuration command stored?
/etc/profile This is used primarily to set environment variables.
59
Where are commands stored that are executed when a user logs in?
~/.bash_login
60
Where are individual users' configuration preferences stored?
~/.profile
61
Where are commands stored that are executed when a user logs out?
~/.bash_logout
62
What is the order in which login shells execute the configuration scripts that they use?
1: /etc/profile 2: ~/.bash_profile 3: ~/.bash_login 4: ~/.profile
63
su -l
Switches to a login shell.
64
what is the command to start a new shell session?
bash
65
Where are documentation files stored?
/usr/share/doc
66
man [command]
Displays the manual page for the command. Rarely gives examples. For examples, use info instead
67
info
More expansive version of man; gives more helpful documentation
68
How to get help at the shell prompt
add --help or -? after a command in the shell.