linux overview / quiz 1 Flashcards

1
Q

ls

A

list the directory contents

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

cd

A

change the working directory

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

pwd

A

print the name of the working directory

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

mkdir

A

create a new directory

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

cp

A

copy a file or directory

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

mv

A

move or rename a file or directory

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

rm

A

remove a file or directory

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

rmdir

A

remove an empty directory

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

file

A

determine the file type

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

touch

A

change file timestamp or create an empty file if it doesn’t exist

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

wc

A

print the number of lines, words, and characters in a file

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

sort

A

sort lines of a file numerically or alphabetically

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

ps

A

print a snapshot of current processes

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

top

A

display dynamic view of running processes

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

netstat

A

print network statistics

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

pstree

A

print a tree of processes

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

kill

A

sends a signal to terminate a process

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

who

A

display current users logged on to the system

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

whoami

A

print effective userid (actually, identify current user)

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

groups

A

print the groups that the user is in

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

which

A

used to locate the executable file associated with the given command by searching it in the path environment variable

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

whereis

A

locate the binary, source, and man page files for a command

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

find

A

search for files in a directory hierarchy

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

locate

A

find files by name

25
grep
print lines matching to a pattern using regular expressions
26
cat
concatenate files and print to standard output (terminal)
27
echo
print a line of text
28
type
print a brief description of a command
29
more
file viewer for paging through text on screen at a time more command is used to view the text files in the command prompt, displaying one screen at a time in case the file is large (For example log files). The more command also allows the user do scroll up and down through the page.
30
less
file viewer similar to more, but with more features Less command is a Linux utility that can be used to read the contents of a text file one page (one screen) at a time.
31
head
print the first n lines of a file
32
tail
print the last n lines of a file
33
diff
compare files line-by-line shell command
34
date
print date and time in various formats
35
cal
print calendar for month and year
36
df
print file system disk space usage
37
du
estimate file space usage for directory and all subdirectories
38
clear
clear the terminal screen
39
sleep
does nothing for a specified amount of time
40
history
print history of recently used commands
41
chmod
set file permissions can add or take away read, write, and execute permissions set by owner, group, and others
42
input redirection
accomplished using the less than symbol for the input file command < input_file
43
output redirection
redirects the output to a file using the greater than symbol command > output_file can append instead of overwriting file using > >
44
combined input and output redirection
command < input_file > output_file
45
piping |
|, allows the output of a command to be connected to the input of another command
46
the directory is a type of file (True/False)
True
47
which linux command is used to go back from a directory to the directory before that?
cd..
48
how many types of basic permissions are available in linux to grant a user?
3 (read, write, execute)
49
in a multiuser multitasking linux operating system, what does "multitasking" refer to?
The capability of the operating system to run multiple programs concurrently on a single processor.
50
You need to list all files and directories in the current directory, including hidden ones. Which linux command would you use?
ls -a
51
You need to copy a file named "report.txt" to a directory named "backup". How would you do that? Choose the right command.
cp report.txt backup
52
What is the output shown for a "type echo" command?
echo is a shell built-in
53
After issuing the command chmod go+rx apple.c, which of the following file permissions is possible for the ordinary file apple.c? Hint: g stands for group and o stands for others
-rwxr-xr-x
54
In a system call, the user has super-privileges whereas the kernel has no privilege. (true/false)
false
55
When a process running in user mode makes a system call to open() to access a file, what accurately represents the role of kernel and user mode,
The open() system call switches the process to kernel mode, which accesses the file on behalf of the process
56
_____________ primarily provides a text-based interface through which users can execute commands, manage files, and perform various system tasks in the Linux OS. It allows users to control and manage the system using text-based commands and scripting.
shell
57
Device drivers in an operating system are responsible only for providing hardware-specific functionalities and have no role in managing the communication between software applications and hardware devices. (true/false)
false
58
What is a fundamental difference between the C standard library functions and system calls in a Unix-like operating system?
C standard library functions execute in user mode, while system calls transition to kernel mode to access privileged operations.
59
What does cd .. command do ?
Directory switched to the previous level