Intro to Linux Flashcards

(69 cards)

1
Q

What argument for the -type option of the find command is used to search for directories?

A

d (as in “find -type d”)

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

What command will display all files in all directories and subdirectories from the user’s home directory?

A

find ~

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

Which of the following arguments for the -type option of the find command is used to search for symbolic links?

A

l (as in “find -type l”)

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

What is the “wc” command?

A

Meaning “word count”, the “wc” command is used to count the number of lines, words, and bytes (or characters) in a file or input. By itself it shows the number of lines, words, and bytes (or characters) in the file(s), in that order. “wc filename.txt”

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

What is the “find” command?

A

The “find” command searches for files and directories in a specific location

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

Which one is NOT a valid -type option for the find command? [a, b, c, d]

A

‘a’ is not valid

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

Which of the followings are logical operators of the find command? [-not, -and, -xor, -true, -or]

A

-not, -and, -or

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

What is the difference between the “locate” and the “find” commands?

A

“locate” searches for the files using a pre-built database, while the “find” command searches the filesystem in real time for the desired file/directory.

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

What command will remove the files you scare up with the “find” command?

A

“-remove”

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

What argument for the -type option of the find command is used to search for files?

A

f (as in “-type f”

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

How do you use the output of one command as the input of a second?

A

”|”, also known as “pipe”.

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

What command can you use to update the locate database?

A

updatedb (“sudo updatedb”)

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

What command is used to update the timestamps of files?

A

“touch”. It can also make files

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

What option of the find command do you use to add another option?

A

“-and” (“find -option -and -option”)

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

What option of the find command do you use to negate something, or in other words, find its’ opposite?

A

“-not” (“find -not -option”)

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

What three numbers do you add up to set permissions in Linux, and what do they mean?

A

4 (read), 2 (write), 1(execute)

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

What three entities do you set permissions for?

A

The owner, the group, and “other”.

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

What four characters do you use to set permissions, and what do they mean?

A

r (read), w (write), x (execute), and -(null/nothing). Example: rwx, r-x, r–

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

What command allows you to find files by name by looking up a database?

A

“locate”

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

What command allows the user to search for files in a directory hierarchy with versatile options?

A

“find”

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

Which are the symbolic notations for the chmod command?

A

u, g, o, a

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

What number base do computers use?

A

Base 2.

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

What are the entities in the Linux (or Unix) security model?

A

user, group, and world(others)

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

What command can you use to display the user’s identity?

A

id

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What commands let you login as the super user?
"su - root", "su -", "su -l root"
26
Tell me five valid file types in Linux as an output of ls -l command
"-" (regular files), "d" (directories), "c" (character devices), "b" (block devices), and "l" (symbolic link)
27
What command can you use to change the group ownership of a file?
"chgrp"
28
How do you change a file’s owner?
"chown"
29
What does the 'w' permission attribute do?
Allows the file to be written and edited
30
What command changes a user’s password?
"passwd"
31
What command can you use to execute a command as another user?
"sudo"
32
Where is user account information stored?
/bin/user
33
How do you change a file’s mode?
"chmod"
34
How do you set default permissions on a file?
"umask"
35
What does the 'r' permission attribute do?
Allows the file to be opened and read
36
What does the "ping" command do?
Send an ICMP ECHO_REQUEST to network hosts
37
What does the "traceroute" command do?
Print the route packets to trace to a network host
38
What does "ip" do?
Show/manipulate routing, devices, policy routing and tunnels
39
What does "netstat" do?
Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
40
What does "ftp" do?
It is an internet file transfer program
41
What does "wget" do?
It is a non-interactive network downloader
42
What does "lcd" do within the "ftp" program?
It changes the directory on the local system
43
What does "bye" do within the "ftp" program?
log off the remote server and end the session
44
What is a container?
It's a lightweight, isolated environment where you can run applications. Each container has everything that the application needs to run: code, tools, libraries, and settings.
45
How is a container different from a virtual machine?
A virtual machine has its own OS, while the container uses the host system's OS; It borrows its kernel. This makes containers less isolated, but more light-weight and memory efficient.
46
What login name should you be given when accessing a public FTP server?
"anonymous". If it wants a password, its usually your email address.
47
Which commands can you use to display routing information?
"ip route show" and "ip r"
48
Which command can you use to test the connectivity to the remote host?
"ping "
49
What does the scp command do?
Copies files across a network securely (Secure copy)
50
Using SSH how would you connect to a remote host named remote-sys?
"ssh remote sys"
51
What option allows you to encrypt an dssh connection?
The -c option in SSH specifies the encryption cipher to use for the connection
52
What is a unique feature of "sftp"?
Only the SSH server is needed on the server side
53
What is "sftp"?
SFTP (Secure File Transfer Protocol) is a way to transfer files between computers over the internet, using SSH to encrypt the data.
54
What is "ssh"?
SSH (Secure Shell) is a protocol used to securely connect to a remote computer over a network. It allows you to log into another computer, execute commands, and transfer files safely, even over unsecured networks.
55
Which information is displayed when ping operation succeeds?
Delay (or how long it took for the packets to get there), packet size, and the destination host's name (could be ip or hostname)
56
What does "ssh" stand for?
Secure Shell
57
What does "get fileName" do within the ftp program?
In an FTP program, "get fileName" is a command used to download a file from the remote FTP server to the local system.
58
What commands can you use to display the assigned IP address information?
"ip address show" and "ip a"
59
How do you make a script?
Create a file - you can use a text editor like vim or nano to do this when you open the editor - specify an interpreter, write your commands and save, and give your file execute permissions
60
How do you exit insert mode in vim?
use ESC key
61
How do you save and quit in vim?
:wq
62
How do you run your script1.sh using the source method?
". " or "source "
63
Run your script1.sh in a child bash shell?
"./"
64
How do you run a script if the script isn’t executable, or you don't want to make it executable?
"bash "
65
How do you run your script1.sh as an executable file?
"path/to/scriptname"
66
How do you define a variable?
"var_name=var"
67
What is a stub function?
Its like any other function in programming - a box you can put commands into, to tidy things up. "functionName(){ }"
68
68