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
Q

grep

A

print lines matching to a pattern using regular expressions

26
Q

cat

A

concatenate files and print to standard output (terminal)

27
Q

echo

A

print a line of text

28
Q

type

A

print a brief description of a command

29
Q

more

A

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
Q

less

A

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
Q

head

A

print the first n lines of a file

32
Q

tail

A

print the last n lines of a file

33
Q

diff

A

compare files line-by-line
shell command

34
Q

date

A

print date and time in various formats

35
Q

cal

A

print calendar for month and year

36
Q

df

A

print file system disk space usage

37
Q

du

A

estimate file space usage for directory and all subdirectories

38
Q

clear

A

clear the terminal screen

39
Q

sleep

A

does nothing for a specified amount of time

40
Q

history

A

print history of recently used commands

41
Q

chmod

A

set file permissions
can add or take away read, write, and execute permissions
set by owner, group, and others

42
Q

input redirection

A

accomplished using the less than symbol for the input file
command < input_file

43
Q

output redirection

A

redirects the output to a file using the greater than symbol
command > output_file
can append instead of overwriting file using > >

44
Q

combined input and output redirection

A

command < input_file > output_file

45
Q

piping |

A

|, allows the output of a command to be connected to the input of another command

46
Q

the directory is a type of file (True/False)

A

True

47
Q

which linux command is used to go back from a directory to the directory before that?

A

cd..

48
Q

how many types of basic permissions are available in linux to grant a user?

A

3 (read, write, execute)

49
Q

in a multiuser multitasking linux operating system, what does “multitasking” refer to?

A

The capability of the operating system to run multiple programs concurrently on a single processor.

50
Q

You need to list all files and directories in the current directory, including hidden ones. Which linux command would you use?

A

ls -a

51
Q

You need to copy a file named “report.txt” to a directory named “backup”. How would you do that? Choose the right command.

A

cp report.txt backup

52
Q

What is the output shown for a “type echo” command?

A

echo is a shell built-in

53
Q

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

A

-rwxr-xr-x

54
Q

In a system call, the user has super-privileges whereas the kernel has no privilege. (true/false)

A

false

55
Q

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,

A

The open() system call switches the process to kernel mode, which accesses the file on behalf of the process

56
Q

_____________ 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.

A

shell

57
Q

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)

A

false

58
Q

What is a fundamental difference between the C standard library functions and system calls in a Unix-like operating system?

A

C standard library functions execute in user mode, while system calls transition to kernel mode to access privileged operations.

59
Q

What does cd .. command do ?

A

Directory switched to the previous level