CLI Flashcards

1
Q

CLI stands for ?

A

Command Line Interface.

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

” cat “ is used for ?

A

Type out or combine files.

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

” head “ is used for ?

A

Show the first few lines of a file.

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

” tail “ is used for ?

A

Show the last few lines of a file.

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

” man “ is used for ?

A

View the documentation.

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

The command is ?

A

The name of the program you are executing.

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

” sudo “ is used for ?

A

Provide user with administrative privileges.

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

Virtual Terminal is ?

A

Console sessions that use the entire display and keyboard outside of a graphical environment.

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

Virtual Terminal is helpful when ?

A

You run into problem with the graphical desktop. You can switch to VT and troubleshoot.

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

” shutdown -r “ is used for ?

A

Reboot the system.

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

To reboot the system, use command ?

A

shutdown -r

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

To cancel rebooting the system, use command ?

A

shutdown -c

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

The schedule shutting down the system ?

A

shutdown -h HH:mm “Message”

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

To locate program, use ?

A

” which “ or “ whereis “

i.e “which diff”, “whereis diff”

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

Display the current working directory ?

A

pwd

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

Change your current home directory ?

A

cd

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

Change to parent directory ?

A

cd ..

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

Change to previous directory ?

A

cd -

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

An absolute pathname is ?

A

Start with the root directory and follows the tree.

Always starts with /.

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

A relative pathname is ?

A

Start from the present working directory.

Never starts with /.

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

Displays a tree view of the filesystem ?

A

tree or tree -d

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

List all files, including hidden files and directories ?

A

ls -a

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

Create hard link from two files ?

A

ln file1 file2 (with file1 already exists)

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

Create soft link from two files ?

A

ln -s file1 file3 (with file1 already exists)

25
View a file that is not very long, does not provide any roll-back?
cat
26
Look at a file backward, starting from the last line ?
tac
27
A paging program, used to view larger file ?
less
28
Search for pattern in the forward direction with " less " program ?
less /{pattern}
29
Search for pattern in the backward direction with " less " program ?
less ?{pattern}
30
Print the last 10 lines of a file by default ?
tail
31
Configure to print the last 15 lines of a file ?
tail -n 15
32
Print the first 10 lines of a file by default ?
head
33
Create an empty file ?
touch fileName
34
Make a new directory ?
mkdir dirName
35
Remove an empty directory ?
rmdir dirName
36
Remove a file or move that file to another location ?
mv fileName
37
Remove a file ?
rm fileName
38
Remove a file interactively ?
rm -i fileName
39
Remove a file forcefully ?
rm -f fileName
40
Remove a directory forcefully ?
rm -rf dirName
41
When commands are executed, by defaults how many file streams are there ?
3: stdin, stdout, stderr
42
To set input to a file, which sign to use ?
< | $ do_something < input-file
43
To set output to a file, which sign to use ?
> | $ do_something > output-file
44
To redirect stderr to a separate file ?
Use stderr’s file descriptor number (2), the greater-than sign (>), followed by the name of the file you want to hold everything the running command writes to stderr: ($ do_something 2> error-file)
45
To pipe the output of one command or program into another as its input ?
| | $ command 1 | command 2 | command 3
46
To search for file ?
locate | $ locate zip | grep bin
47
Wildcard: Matches any single character ?
? | ls ba?.out
48
Wildcard: Matches any string of character ?
* | ls *.out.
49
Wildcard: Matches any character in the set of characters, for example [adf] will match any occurrence of a, d, or f ?
[set]
50
Wildcard: Matches any character not in the set of characters ?
[!set]
51
What function / command that recurses down the filesystem tree from any particular directory (or set of directories) and locates files that match specified conditions ?
find | $ find /usr -name gcc
52
Two most common Package Management System ?
Debian and RPM
53
A Package Management System has ... levels ?
2 (high level and low level)
54
Example of high level package manager ?
dpkg (for Debian Family System) | rpm (for SUSE or Red Hat Family System)
55
Example of low level package manager ?
apt-get (Debian Family System) zypper (SUSE Family System) yum (Red Hat Family System)
56
What does a low level package manager do ?
+ Unpacking individual packages + Running scripts + Getting the software installed correctly
57
What does a high level package manager do ?
+ Works with group of packages + Download packages from vendors + Figure out dependencies
58
apt stands for ?
Advanced Packaging Tool
59
Difference between a Console and a Terminal ?
The console is a terminal. A system has got one console and potentially multiple terminals. The console is typically the primary interface for managing a computer, eg while it is still booting up. A terminal is a session which can receive and send input and output for command-line programs.