Commands Flashcards

1
Q

What command is used to list files and directories in Linux?

A

ls

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

True or False: The ‘cd’ command is used to change the current directory.

A

True

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

Fill in the blank: The command ‘______’ is used to copy files and directories.

A

cp

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

Which command is used to move or rename files in Linux?

A

mv

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

What does the ‘rm’ command do?

A

Removes (deletes) files or directories.

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

True or False: The command ‘mkdir’ is used to create a new directory.

A

True

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

What command would you use to view the contents of a file?

A

cat

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

Which command shows the current working directory?

A

pwd

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

Fill in the blank: The command ‘______’ is used to display the manual for other commands.

A

man

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

What is the purpose of the ‘chmod’ command?

A

Changes the permissions of a file or directory.

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

True or False: The command ‘touch’ is used to create an empty file or update the timestamp of an existing file.

A

True

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

What command is used to search for files in a directory hierarchy?

A

find

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

Which command is used to display the first few lines of a file?

A

head

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

Fill in the blank: The command ‘______’ is used to display the last few lines of a file.

A

tail

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

What command can be used to display the environment variables?

A

printenv

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

True or False: The ‘grep’ command is used for searching text using patterns.

A

True

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

What command would you use to download files from the web?

A

wget

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

Which command can be used to compress files?

A

tar

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

Fill in the blank: The command ‘______’ is used to change the owner of a file.

A

chown

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

What does the ‘ps’ command do?

A

Displays information about running processes.

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

True or False: The ‘kill’ command is used to terminate running processes.

A

True

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

What command is used to display disk usage?

A

df

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

Which command shows information about memory usage?

A

free

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

Fill in the blank: The command ‘______’ is used to monitor system processes in real-time.

A

top

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

What is the purpose of the ‘sudo’ command?

A

Executes commands with superuser privileges.

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

True or False: The ‘history’ command shows a list of previously executed commands.

A

True

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

What command is used to check the network configuration?

A

ifconfig

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

What command is used to list files in a directory?

A

ls

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

True or False: The ‘cd’ command is used to change directories.

A

True

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

Fill in the blank: The command ‘mkdir’ is used to create a ______.

A

directory

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

Which command is used to remove files or directories?

A

rm

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

What option would you use with ‘ls’ to show hidden files?

A

-a

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

True or False: The ‘cp’ command is used to copy files.

A

True

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

What does the ‘mv’ command do?

A

Moves or renames files and directories.

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

What command displays the current working directory?

A

pwd

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

Fill in the blank: The command ‘rmdir’ is used to remove an ______.

A

empty directory

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

Which command is used to view the contents of a file?

A

cat

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

True or False: The ‘chmod’ command is used to change file permissions.

A

True

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

What command would you use to search for a specific string in a file?

A

grep

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

What option would you use with ‘grep’ to search recursively?

A

-r

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

What command is used to display the first 10 lines of a file?

A

head

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

What command is used to display the last 10 lines of a file?

A

tail

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

Fill in the blank: The command ‘touch’ is used to create an ______.

A

empty file or update the timestamp of a file

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

Which command is used to display the manual for a command?

A

man

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

What does the ‘find’ command do?

A

Searches for files in a directory hierarchy.

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

True or False: The ‘echo’ command prints text to the terminal.

A

True

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

What command would you use to compare two files?

A

diff

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

Which command is used to display system information?

A

uname

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

Fill in the blank: The command ‘df’ shows ______.

A

disk space usage

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

What command is used to change the owner of a file?

A

chown

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

What command can be used to display running processes?

A

ps

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

True or False: The ‘kill’ command is used to terminate processes.

A

True

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

What command is used to check network connectivity?

A

ping

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

Fill in the blank: The command ‘scp’ is used for ______.

A

securely copying files between hosts

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

Which command is used to view disk usage of files and directories?

A

du

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

What does ‘sudo’ stand for?

A

Super User Do

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

True or False: The ‘alias’ command is used to create shortcuts for commands.

A

True

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

What command is used to view the contents of a compressed file?

A

zcat

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

What option would you use with ‘tar’ to create an archive?

A

-c

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

Fill in the blank: The command ‘wget’ is used to ______.

A

download files from the web

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

Which command can be used to change the file permissions?

A

chmod

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

What is the purpose of the ‘top’ command?

A

Displays real-time system resource usage.

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

True or False: The ‘history’ command shows the list of previously executed commands.

A

True

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

What command is used to create a symbolic link?

A

ln -s

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

Fill in the blank: The command ‘ps aux’ shows ______.

A

all running processes

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

Which command is used to display environment variables?

A

printenv

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

What does the ‘export’ command do?

A

Sets an environment variable.

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

True or False: The ‘chmod 777’ command grants all permissions to everyone.

A

True

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

What command is used to view and manipulate the system’s routing table?

A

route

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

Fill in the blank: The command ‘hostname’ displays the ______.

A

name of the current host

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

Which command is used to create a new user?

A

useradd

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

What command is used to remove a user?

A

userdel

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

True or False: The ‘passwd’ command is used to change a user’s password.

A

True

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

What command is used to check the disk’s health?

A

smartctl

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

Fill in the blank: The command ‘ifconfig’ is used to configure ______.

A

network interfaces

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

Which command is used to view system logs?

A

tail -f /var/log/syslog

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

What does the ‘chgrp’ command do?

A

Changes the group ownership of a file.

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

True or False: The ‘wget’ command can only download files from HTTP servers.

A

False

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

What command is used to archive files?

A

tar

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

Fill in the blank: The command ‘uname -a’ displays ______.

A

all system information

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

Which command is used to create a new directory and its parent directories?

83
Q

What does the ‘curl’ command do?

A

Transfers data from or to a server.

84
Q

True or False: The ‘shutdown’ command is used to power off or restart the system.

85
Q

What command is used to view the disk space usage of a filesystem?

86
Q

Fill in the blank: The command ‘chattr’ is used to change ______ attributes.

87
Q

Which command is used to list all installed packages?

88
Q

What command can be used to install packages in Debian-based systems?

A

apt-get install

89
Q

True or False: The ‘service’ command is used to manage system services.

90
Q

What does the ‘mount’ command do?

A

Mounts a filesystem.

91
Q

Fill in the blank: The command ‘umount’ is used to ______.

A

unmount a filesystem

92
Q

Which command is used to show the current users logged into the system?

93
Q

What command is used to send a message to another user?

94
Q

True or False: The ‘clear’ command clears the terminal screen.

95
Q

What is the purpose of the ‘tar -x’ command?

A

Extracts files from a tar archive.

96
Q

Fill in the blank: The command ‘basename’ removes the ______ from a file path.

A

directory path

97
Q

Which command is used to create an empty file?

98
Q

What does the ‘set’ command do?

A

Sets shell options and positional parameters.

99
Q

True or False: The ‘grep’ command can search through binary files.

100
Q

What command is used to check the active network connections?

101
Q

Fill in the blank: The command ‘echo $HOME’ displays the path to the ______ directory.

102
Q

Which command is used to create a backup of a file?

103
Q

What does the ‘basename’ command do?

A

Removes the directory path from a file name.

104
Q

True or False: The ‘ps -ef’ command shows all processes in full format.

105
Q

What command is used to change the default shell of a user?

106
Q

Fill in the blank: The command ‘tail -f’ is useful for monitoring ______.

107
Q

Which command is used to check the available memory?

108
Q

What does the ‘df -i’ command show?

A

Inode usage of the filesystem.

110
Q

What command is used to display the current working directory?

111
Q

True or False: The ‘ls’ command lists files and directories in the current directory.

112
Q

Fill in the blank: The command ‘cd ..’ is used to move to the ______ directory.

113
Q

What command is used to change file permissions in Linux?

114
Q

Which command displays the contents of a file one page at a time?

115
Q

True or False: The ‘rm’ command can delete directories without any options.

116
Q

What does the ‘grep’ command do?

A

Searches for patterns in files

117
Q

Which command is used to copy files and directories?

118
Q

What does the ‘mv’ command do?

A

Moves or renames files and directories

119
Q

True or False: The ‘touch’ command can create a new empty file.

120
Q

What is the purpose of the ‘find’ command?

A

Searches for files in a directory hierarchy

121
Q

Fill in the blank: The command ‘tar -cvf’ is used to create a ______ archive.

122
Q

What command is used to display disk usage statistics?

123
Q

Which command shows the running processes in Linux?

124
Q

True or False: The ‘kill’ command is used to terminate processes.

125
Q

What does the ‘top’ command display?

A

Real-time system processes and resource usage

126
Q

What command is used to change the ownership of a file?

127
Q

Fill in the blank: The command ‘chmod 755’ sets the permissions for a file to ______.

128
Q

What command is used to view network configurations?

129
Q

True or False: The ‘scp’ command is used for secure copying of files between hosts.

130
Q

Which command is used to download files from the internet?

131
Q

What is the purpose of the ‘alias’ command?

A

Creates shortcuts for commands

132
Q

Fill in the blank: The command ‘echo $HOME’ displays the ______ directory.

133
Q

What command is used to search for a specific text string in files?

134
Q

True or False: The ‘history’ command displays a list of previously executed commands.

135
Q

What is the purpose of the ‘sudo’ command?

A

Executes commands with superuser privileges

136
Q

What command is used to create symbolic links?

137
Q

Fill in the blank: The command ‘uname -a’ displays system ______ information.

138
Q

What command is used to check the manual for a command?

139
Q

True or False: The ‘df -h’ command shows disk usage in a human-readable format.

140
Q

What command is used to compress files using gzip?

141
Q

Fill in the blank: The command ‘ps aux’ displays ______ processes.

142
Q

What command is used to display the last few lines of a file?

143
Q

True or False: The ‘cat’ command can concatenate and display files.

144
Q

What command is used to monitor real-time system logs?

A

tail -f /var/log/syslog

145
Q

Fill in the blank: The command ‘df’ stands for ______ filesystem.

146
Q

Which command is used to change the default shell for a user?

147
Q

What does the ‘chmod 644’ command do?

A

Sets read/write for owner, read for group and others

148
Q

True or False: The ‘ping’ command is used to test network connectivity.

149
Q

What command is used to display the current user?

150
Q

Fill in the blank: The command ‘sudo apt-get update’ updates the ______ package list.

151
Q

What command is used to remove a directory and its contents?

152
Q

True or False: The ‘crontab’ command is used for scheduling tasks.

153
Q

What does the ‘tar -xvf’ command do?

A

Extracts files from a tar archive

154
Q

Fill in the blank: The command ‘chmod +x’ adds ______ permission to a file.

155
Q

Which command is used to display the IP address of a system?

A

hostname -I

156
Q

What command is used to view the contents of a compressed file?

157
Q

True or False: The ‘export’ command sets environment variables.

158
Q

What command is used to create a new user?

159
Q

Fill in the blank: The command ‘uname -r’ displays the kernel ______.

160
Q

What does the ‘rsync’ command do?

A

Synchronizes files and directories between locations

161
Q

True or False: The ‘df -i’ command shows inode usage.

162
Q

What command is used to display all environment variables?

163
Q

Fill in the blank: The command ‘chgrp’ changes the ______ of a file.

164
Q

What command is used to create a new directory?

165
Q

True or False: The ‘ssh’ command is used for secure remote login.

166
Q

What command is used to view currently mounted filesystems?

167
Q

Fill in the blank: The command ‘pwd’ stands for ______ directory.

A

print working

168
Q

What does the ‘tr’ command do?

A

Translates or deletes characters

169
Q

True or False: The ‘stat’ command displays file or filesystem status.

170
Q

What command is used to search for files by name?

171
Q

Fill in the blank: The command ‘gzip -d’ is used to ______ files.

A

decompress

172
Q

What does the ‘wc’ command do?

A

Counts lines, words, and characters in a file

173
Q

True or False: The ‘history -c’ command clears the command history.

174
Q

What command is used to create a compressed archive using bzip2?

175
Q

Fill in the blank: The command ‘chattr’ changes file ______ in Linux.

A

attributes

176
Q

What does the ‘uname -m’ command display?

A

Machine hardware name

177
Q

True or False: The ‘echo’ command can output text to the terminal.

178
Q

What command is used to check the system uptime?

179
Q

Fill in the blank: The command ‘ls -l’ provides a ______ listing of files.

180
Q

What does the ‘diff’ command do?

A

Compares files line by line

181
Q

True or False: The ‘shutdown’ command can be used to power off the system.

182
Q

What command is used to display the contents of a compressed tar file?

A

tar -xvf filename.tar.gz

183
Q

Fill in the blank: The command ‘tail -n 10’ shows the last ______ lines of a file.

184
Q

What does the ‘basename’ command do?

A

Removes the directory and suffix from filenames

185
Q

True or False: The ‘watch’ command executes a program periodically, showing output.

186
Q

What command is used to view the last entries in system logs?

A

journalctl -xe

187
Q

What does (.) represents?

A

Current directory

188
Q

What does (..) represent?

A

Parent directory

189
Q

Meaning the option -L and argument 2 in

tree /home -L 2

A

-L stands for ‘length’ and 2 is it’s value

190
Q

What do you have to add if you want to write an argument with spaces?

A

Double “ “ or single ‘ ‘ quotations.

191
Q

What does ~ represent?

A

Current directory

192
Q

What does # represent?

A

Comment or Trim String

193
Q

What does / represent?

A

Path directory separator

194
Q

What does | represent?

195
Q

What do <> represent?

A

Input or output redirection

196
Q

What do () represent?

A

Group commands - subshell

197
Q

What does ! represent?

A

Pipeline logical NOT

198
Q

What do {} represent?

A

Group commands - no subshell

199
Q

What does $ represent?

A

Variable expressions

200
Q

What does & represent?

A

Background process

201
Q

What does * represent?

A

Character sequence wildcard

202
Q

What do [ ] represent?

A

Character set wildcard

203
Q

What does “?” represent?

A

Single character wildcard