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
What is the purpose of the 'sudo' command?
Executes commands with superuser privileges.
26
True or False: The 'history' command shows a list of previously executed commands.
True
27
What command is used to check the network configuration?
ifconfig
28
29
What command is used to list files in a directory?
ls
30
True or False: The 'cd' command is used to change directories.
True
31
Fill in the blank: The command 'mkdir' is used to create a ______.
directory
32
Which command is used to remove files or directories?
rm
33
What option would you use with 'ls' to show hidden files?
-a
34
True or False: The 'cp' command is used to copy files.
True
35
What does the 'mv' command do?
Moves or renames files and directories.
36
What command displays the current working directory?
pwd
37
Fill in the blank: The command 'rmdir' is used to remove an ______.
empty directory
38
Which command is used to view the contents of a file?
cat
39
True or False: The 'chmod' command is used to change file permissions.
True
40
What command would you use to search for a specific string in a file?
grep
41
What option would you use with 'grep' to search recursively?
-r
42
What command is used to display the first 10 lines of a file?
head
43
What command is used to display the last 10 lines of a file?
tail
44
Fill in the blank: The command 'touch' is used to create an ______.
empty file or update the timestamp of a file
45
Which command is used to display the manual for a command?
man
46
What does the 'find' command do?
Searches for files in a directory hierarchy.
47
True or False: The 'echo' command prints text to the terminal.
True
48
What command would you use to compare two files?
diff
49
Which command is used to display system information?
uname
50
Fill in the blank: The command 'df' shows ______.
disk space usage
51
What command is used to change the owner of a file?
chown
52
What command can be used to display running processes?
ps
53
True or False: The 'kill' command is used to terminate processes.
True
54
What command is used to check network connectivity?
ping
55
Fill in the blank: The command 'scp' is used for ______.
securely copying files between hosts
56
Which command is used to view disk usage of files and directories?
du
57
What does 'sudo' stand for?
Super User Do
58
True or False: The 'alias' command is used to create shortcuts for commands.
True
59
What command is used to view the contents of a compressed file?
zcat
60
What option would you use with 'tar' to create an archive?
-c
61
Fill in the blank: The command 'wget' is used to ______.
download files from the web
62
Which command can be used to change the file permissions?
chmod
63
What is the purpose of the 'top' command?
Displays real-time system resource usage.
64
True or False: The 'history' command shows the list of previously executed commands.
True
65
What command is used to create a symbolic link?
ln -s
66
Fill in the blank: The command 'ps aux' shows ______.
all running processes
67
Which command is used to display environment variables?
printenv
68
What does the 'export' command do?
Sets an environment variable.
69
True or False: The 'chmod 777' command grants all permissions to everyone.
True
70
What command is used to view and manipulate the system's routing table?
route
71
Fill in the blank: The command 'hostname' displays the ______.
name of the current host
72
Which command is used to create a new user?
useradd
73
What command is used to remove a user?
userdel
74
True or False: The 'passwd' command is used to change a user's password.
True
75
What command is used to check the disk's health?
smartctl
76
Fill in the blank: The command 'ifconfig' is used to configure ______.
network interfaces
77
Which command is used to view system logs?
tail -f /var/log/syslog
78
What does the 'chgrp' command do?
Changes the group ownership of a file.
79
True or False: The 'wget' command can only download files from HTTP servers.
False
80
What command is used to archive files?
tar
81
Fill in the blank: The command 'uname -a' displays ______.
all system information
82
Which command is used to create a new directory and its parent directories?
mkdir -p
83
What does the 'curl' command do?
Transfers data from or to a server.
84
True or False: The 'shutdown' command is used to power off or restart the system.
True
85
What command is used to view the disk space usage of a filesystem?
df -h
86
Fill in the blank: The command 'chattr' is used to change ______ attributes.
file
87
Which command is used to list all installed packages?
dpkg -l
88
What command can be used to install packages in Debian-based systems?
apt-get install
89
True or False: The 'service' command is used to manage system services.
True
90
What does the 'mount' command do?
Mounts a filesystem.
91
Fill in the blank: The command 'umount' is used to ______.
unmount a filesystem
92
Which command is used to show the current users logged into the system?
who
93
What command is used to send a message to another user?
write
94
True or False: The 'clear' command clears the terminal screen.
True
95
What is the purpose of the 'tar -x' command?
Extracts files from a tar archive.
96
Fill in the blank: The command 'basename' removes the ______ from a file path.
directory path
97
Which command is used to create an empty file?
touch
98
What does the 'set' command do?
Sets shell options and positional parameters.
99
True or False: The 'grep' command can search through binary files.
True
100
What command is used to check the active network connections?
netstat
101
Fill in the blank: The command 'echo $HOME' displays the path to the ______ directory.
home
102
Which command is used to create a backup of a file?
cp -r
103
What does the 'basename' command do?
Removes the directory path from a file name.
104
True or False: The 'ps -ef' command shows all processes in full format.
True
105
What command is used to change the default shell of a user?
chsh
106
Fill in the blank: The command 'tail -f' is useful for monitoring ______.
log files
107
Which command is used to check the available memory?
free
108
What does the 'df -i' command show?
Inode usage of the filesystem.
109
110
What command is used to display the current working directory?
pwd
111
True or False: The 'ls' command lists files and directories in the current directory.
True
112
Fill in the blank: The command 'cd ..' is used to move to the ______ directory.
parent
113
What command is used to change file permissions in Linux?
chmod
114
Which command displays the contents of a file one page at a time?
less
115
True or False: The 'rm' command can delete directories without any options.
False
116
What does the 'grep' command do?
Searches for patterns in files
117
Which command is used to copy files and directories?
cp
118
What does the 'mv' command do?
Moves or renames files and directories
119
True or False: The 'touch' command can create a new empty file.
True
120
What is the purpose of the 'find' command?
Searches for files in a directory hierarchy
121
Fill in the blank: The command 'tar -cvf' is used to create a ______ archive.
tar
122
What command is used to display disk usage statistics?
df
123
Which command shows the running processes in Linux?
ps
124
True or False: The 'kill' command is used to terminate processes.
True
125
What does the 'top' command display?
Real-time system processes and resource usage
126
What command is used to change the ownership of a file?
chown
127
Fill in the blank: The command 'chmod 755' sets the permissions for a file to ______.
rwxr-xr-x
128
What command is used to view network configurations?
ifconfig
129
True or False: The 'scp' command is used for secure copying of files between hosts.
True
130
Which command is used to download files from the internet?
wget
131
What is the purpose of the 'alias' command?
Creates shortcuts for commands
132
Fill in the blank: The command 'echo $HOME' displays the ______ directory.
home
133
What command is used to search for a specific text string in files?
grep
134
True or False: The 'history' command displays a list of previously executed commands.
True
135
What is the purpose of the 'sudo' command?
Executes commands with superuser privileges
136
What command is used to create symbolic links?
ln -s
137
Fill in the blank: The command 'uname -a' displays system ______ information.
kernel
138
What command is used to check the manual for a command?
man
139
True or False: The 'df -h' command shows disk usage in a human-readable format.
True
140
What command is used to compress files using gzip?
gzip
141
Fill in the blank: The command 'ps aux' displays ______ processes.
all
142
What command is used to display the last few lines of a file?
tail
143
True or False: The 'cat' command can concatenate and display files.
True
144
What command is used to monitor real-time system logs?
tail -f /var/log/syslog
145
Fill in the blank: The command 'df' stands for ______ filesystem.
disk
146
Which command is used to change the default shell for a user?
chsh
147
What does the 'chmod 644' command do?
Sets read/write for owner, read for group and others
148
True or False: The 'ping' command is used to test network connectivity.
True
149
What command is used to display the current user?
whoami
150
Fill in the blank: The command 'sudo apt-get update' updates the ______ package list.
APT
151
What command is used to remove a directory and its contents?
rm -r
152
True or False: The 'crontab' command is used for scheduling tasks.
True
153
What does the 'tar -xvf' command do?
Extracts files from a tar archive
154
Fill in the blank: The command 'chmod +x' adds ______ permission to a file.
execute
155
Which command is used to display the IP address of a system?
hostname -I
156
What command is used to view the contents of a compressed file?
zcat
157
True or False: The 'export' command sets environment variables.
True
158
What command is used to create a new user?
adduser
159
Fill in the blank: The command 'uname -r' displays the kernel ______.
release
160
What does the 'rsync' command do?
Synchronizes files and directories between locations
161
True or False: The 'df -i' command shows inode usage.
True
162
What command is used to display all environment variables?
printenv
163
Fill in the blank: The command 'chgrp' changes the ______ of a file.
group
164
What command is used to create a new directory?
mkdir
165
True or False: The 'ssh' command is used for secure remote login.
True
166
What command is used to view currently mounted filesystems?
mount
167
Fill in the blank: The command 'pwd' stands for ______ directory.
print working
168
What does the 'tr' command do?
Translates or deletes characters
169
True or False: The 'stat' command displays file or filesystem status.
True
170
What command is used to search for files by name?
locate
171
Fill in the blank: The command 'gzip -d' is used to ______ files.
decompress
172
What does the 'wc' command do?
Counts lines, words, and characters in a file
173
True or False: The 'history -c' command clears the command history.
True
174
What command is used to create a compressed archive using bzip2?
bzip2
175
Fill in the blank: The command 'chattr' changes file ______ in Linux.
attributes
176
What does the 'uname -m' command display?
Machine hardware name
177
True or False: The 'echo' command can output text to the terminal.
True
178
What command is used to check the system uptime?
uptime
179
Fill in the blank: The command 'ls -l' provides a ______ listing of files.
detailed
180
What does the 'diff' command do?
Compares files line by line
181
True or False: The 'shutdown' command can be used to power off the system.
True
182
What command is used to display the contents of a compressed tar file?
tar -xvf filename.tar.gz
183
Fill in the blank: The command 'tail -n 10' shows the last ______ lines of a file.
10
184
What does the 'basename' command do?
Removes the directory and suffix from filenames
185
True or False: The 'watch' command executes a program periodically, showing output.
True
186
What command is used to view the last entries in system logs?
journalctl -xe
187
What does (.) represents?
Current directory
188
What does (..) represent?
Parent directory
189
Meaning the option -L and argument 2 in tree /home -L 2
-L stands for 'length' and 2 is it's value
190
What do you have to add if you want to write an argument with spaces?
Double " " or single ' ' quotations.
191
What does ~ represent?
Current directory
192
What does # represent?
Comment or Trim String
193
What does / represent?
Path directory separator
194
What does | represent?
Pipe
195
What do <> represent?
Input or output redirection
196
What do () represent?
Group commands - subshell
197
What does ! represent?
Pipeline logical NOT
198
What do {} represent?
Group commands - no subshell
199
What does $ represent?
Variable expressions
200
What does & represent?
Background process
201
What does * represent?
Character sequence wildcard
202
What do [ ] represent?
Character set wildcard
203
What does "?" represent?
Single character wildcard
204