Linux Commands Flashcards

(137 cards)

1
Q

What command is used to list files in Linux?

A

ls

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

What command provides a detailed list of files?

A

ls -l

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

How do you list hidden files in Linux?

A

ls -a

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

What command shows the current directory?

A

pwd

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

How do you change directories in Linux?

A

cd

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

What is the shortcut to navigate to the home directory?

A

cd ~

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

How do you move up to the parent directory?

A

cd ..

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

What command is used to copy files?

A

cp

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

How can you copy files recursively?

A

cp -r

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

What command is used to move or rename files?

A

mv

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

How do you remove a file in Linux?

A

rm

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

What command removes a directory?

A

rm -r

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

How do you forcefully remove a file?

A

rm -f

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

What command is used to create a directory?

A

mkdir

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

How do you create an empty file?

A

touch

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

What command displays file contents?

A

cat

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

How can you view a file page by page?

A

less

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

What command shows the first 10 lines of a file?

A

head

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

What command shows the last 10 lines of a file?

A

tail

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

How do you follow changes to a file in real-time?

A

tail -f

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

What command is used to find files?

A

find

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

How do you search for text within files?

A

grep

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

What command allows recursive text searching?

A

grep -r

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

How do you perform a case-insensitive search with grep?

A

grep -i

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What command displays the current user?
whoami
26
How do you switch users in Linux?
su
27
What command executes a command as root?
sudo
28
How do you change a user's password?
passwd
29
What command accesses manual pages?
man
30
What command changes file permissions?
chmod
31
How do you change file ownership?
chown
32
What command changes the group of a file?
chgrp
33
What is the permission value for read?
4
34
What is the permission value for write?
2
35
What is the permission value for execute?
1
36
What are full permissions represented as?
777
37
What are standard file permissions?
644
38
What are standard directory permissions?
755
39
What command shows disk space usage?
df
40
How do you display human-readable disk space usage?
df -h
41
What command shows directory size?
du
42
How do you display human-readable directory size?
du -h
43
What command checks the filesystem?
fsck
44
What command mounts a filesystem?
mount
45
How do you unmount a filesystem?
umount
46
What command lists block devices?
lsblk
47
What tool is used for partitioning?
fdisk
48
What command updates the package list in Debian/Ubuntu?
apt update
49
How do you upgrade packages in Debian/Ubuntu?
apt upgrade
50
What command installs a package in Debian/Ubuntu?
apt install
51
How do you remove a package in Debian/Ubuntu?
apt remove
52
What command searches for packages in Debian/Ubuntu?
apt search
53
How do you show package information in Debian/Ubuntu?
apt show
54
What command installs a package in older Red Hat/CentOS?
yum install
55
What command installs a package in newer Red Hat/CentOS?
dnf install
56
How do you update all packages in Red Hat/CentOS?
yum update
57
What command removes a package in Red Hat/CentOS?
yum remove
58
How do you search for packages in Red Hat/CentOS?
yum search
59
What command lists installed packages in Red Hat/CentOS?
rpm -qa
60
What command lists processes in Linux?
ps
61
How do you list all processes?
ps aux
62
What command shows real-time processes?
top
63
How do you kill a process by its PID?
kill
64
What command kills processes by name?
killall
65
How do you forcefully kill a process?
kill -9
66
What command lists background jobs?
jobs
67
How do you bring a job to the foreground?
fg
68
What command shows network interfaces?
ifconfig
69
What is the modern network tool?
ip
70
How do you test connectivity?
ping
71
What command traces the route to a destination?
traceroute
72
How do you download files in Linux?
wget
73
What command transfers data?
curl
74
How do you initiate a secure shell connection?
ssh
75
What command securely copies files?
scp
76
What command shows network statistics?
netstat
77
What command shows system information?
uname
78
How do you check the kernel version?
uname -r
79
What command shows all system information?
uname -a
80
What command shows system uptime?
uptime
81
How do you check memory usage?
free
82
What command shows human-readable memory usage?
free -h
83
How do you get CPU information?
lscpu
84
What command provides hardware information?
lshw
85
How do you access OS release information?
cat /etc/os-release
86
What command sorts lines in a file?
sort
87
How do you get unique lines from a file?
uniq
88
What command counts words in a file?
wc
89
How do you cut columns from a file?
cut
90
What is the stream editor command?
sed
91
What command processes patterns in text?
awk
92
How do you translate characters in a file?
tr
93
What command compares two files?
diff
94
How do you create a tar archive?
tar -cf
95
What command extracts a tar archive?
tar -xf
96
How do you create a compressed tar archive?
tar -czf
97
What command extracts a compressed tar archive?
tar -xzf
98
How do you compress a file?
gzip
99
What command decompresses a file?
gunzip
100
How do you create a zip file?
zip
101
What command extracts a zip file?
unzip
102
What does output redirection do?
Redirects output
103
How do you append output in Linux?
Append output
104
What symbol is used to pipe output to a command?
|
105
How do you redirect error output?
2>
106
What command redirects all output?
&>
107
What command shows the environment variables?
env
108
How do you echo a variable in Linux?
echo $VAR
109
What command sets an environment variable?
export VAR=value
110
How do you show the current PATH?
echo $PATH
111
What command shows the current date?
date
112
How do you display the calendar in Linux?
cal
113
What command edits cron jobs?
crontab -e
114
How do you list cron jobs?
crontab -l
115
What command removes cron jobs?
crontab -r
116
Where is the system cron directory located?
/etc/cron.d
117
What command runs a job at a specific time?
at
118
How do you start a service in systemd?
systemctl start
119
What command stops a service?
systemctl stop
120
How do you restart a service?
systemctl restart
121
What command enables a service?
systemctl enable
122
How do you disable a service?
systemctl disable
123
What command checks the status of a service?
systemctl status
124
How do you list all services in systemd?
systemctl list-units
125
Where are system logs located?
/var/log
126
What command views the system log?
journalctl
127
How do you follow the system log in real-time?
journalctl -f
128
What command displays boot messages?
dmesg
129
Where is the authentication log located?
/var/log/auth.log
130
Where can you find system messages?
/var/log/messages
131
What is the recommended update frequency for Linux?
Regular (apt update && apt upgrade)
132
What antivirus is recommended for Linux?
ClamAV
133
What backup tool is recommended for Linux?
rsync
134
How can backups be automated in Linux?
Cron scheduling
135
What protocol is used for Windows file sharing in Linux?
Samba (SMB protocol)
136
What command is used for firewall management?
iptables
137
What is recommended for package integrity?
Hash verification