Intro to Linux Flashcards

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
Q

What commands let you login as the super user?

A

“su - root”, “su -“, “su -l root”

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

Tell me five valid file types in Linux as an output of ls -l command

A

”-“ (regular files), “d” (directories), “c” (character devices), “b” (block devices), and “l” (symbolic link)

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

What command can you use to change the group ownership of a file?

A

“chgrp”

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

How do you change a file’s owner?

A

“chown”

29
Q

What does the ‘w’ permission attribute do?

A

Allows the file to be written and edited

30
Q

What command changes a user’s password?

A

“passwd”

31
Q

What command can you use to execute a command as another user?

A

“sudo”

32
Q

Where is user account information stored?

A

/bin/user

33
Q

How do you change a file’s mode?

A

“chmod”

34
Q

How do you set default permissions on a file?

A

“umask”

35
Q

What does the ‘r’ permission attribute do?

A

Allows the file to be opened and read

36
Q

What does the “ping” command do?

A

Send an ICMP ECHO_REQUEST to network hosts

37
Q

What does the “traceroute” command do?

A

Print the route packets to trace to a network host

38
Q

What does “ip” do?

A

Show/manipulate routing, devices, policy routing and tunnels

39
Q

What does “netstat” do?

A

Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

40
Q

What does “ftp” do?

A

It is an internet file transfer program

41
Q

What does “wget” do?

A

It is a non-interactive network downloader

42
Q

What does “lcd” do within the “ftp” program?

A

It changes the directory on the local system

43
Q

What does “bye” do within the “ftp” program?

A

log off the remote server and end the session

44
Q

What is a container?

A

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
Q

How is a container different from a virtual machine?

A

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
Q

What login name should you be given when accessing a public FTP server?

A

“anonymous”. If it wants a password, its usually your email address.

47
Q

Which commands can you use to display routing information?

A

“ip route show” and “ip r”

48
Q

Which command can you use to test the connectivity to the remote host?

A

“ping <hostname/ip>”

49
Q

What does the scp command do?

A

Copies files across a network securely (Secure copy)

50
Q

Using SSH how would you connect to a remote host named remote-sys?

A

“ssh remote sys”

51
Q

What option allows you to encrypt an dssh connection?

A

The -c option in SSH specifies the encryption cipher to use for the connection

52
Q

What is a unique feature of “sftp”?

A

Only the SSH server is needed on the server side

53
Q

What is “sftp”?

A

SFTP (Secure File Transfer Protocol) is a way to transfer files between computers over the internet, using SSH to encrypt the data.

54
Q

What is “ssh”?

A

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
Q

Which information is displayed when ping operation succeeds?

A

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
Q

What does “ssh” stand for?

A

Secure Shell

57
Q

What does “get fileName” do within the ftp program?

A

In an FTP program, “get fileName” is a command used to download a file from the remote FTP server to the local system.

58
Q

What commands can you use to display the assigned IP address information?

A

“ip address show” and “ip a”

59
Q

How do you make a script?

A

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
Q

How do you exit insert mode in vim?

A

use ESC key

61
Q

How do you save and quit in vim?

A

:wq

62
Q

How do you run your script1.sh using the source method?

A

”. <scriptname>" or "source <scriptname>"</scriptname></scriptname>

63
Q

Run your script1.sh in a child bash shell?

A

”./<path/to/scriptname>”

64
Q

How do you run a script if the script isn’t executable, or you don’t want to make it executable?

A

“bash <scriptname>"</scriptname>

65
Q

How do you run your script1.sh as an executable file?

A

“path/to/scriptname”

66
Q

How do you define a variable?

A

“var_name=var”

67
Q

What is a stub function?

A

Its like any other function in programming - a box you can put commands into, to tidy things up.

“functionName(){
}”

68
Q
A
68
Q
A