1/31
Vocabulary practice flashcards covering Linux command-line tools for file viewing, text processing, archiving, compression, and user/group permission management.
cat filename
Print the entire contents of a file to the screen.
less filename
View a file one page at a time (press q to quit).
head -n 10 filename
Show the first 10 lines of a file.
tail -n 20 filename
Show the last 20 lines of a file.
grep pattern filename
Search for text inside a file.
grep -i pattern filename
Case-insensitive text search.
grep '^error' filename
Match lines that start with the word error.
grep 'error$' filename
Match lines that end with the word error.
wc -l filename
Count the number of lines in a file.
sort filename
Sort lines alphabetically.
uniq
Remove duplicate adjacent lines.
cut -d: -f1 /etc/passwd
Extract the first column using a colon as the delimiter.
tar czvf archive.tar.gz folder
Create a gzip-compressed archive verbosely.
tar xzvf archive.tar.gz
Extract a gzip-compressed archive verbosely.
tar cjvf archive.tar.bz2 folder
Create a bzip2-compressed archive.
gzip filename
Compress a file into a .gz file.
gunzip filename.gz
Decompress a .gz file.
zip archive.zip file1 file2
Create a .zip archive.
unzip archive.zip
Extract a .zip archive.
whoami
Print your current username.
id
Print your user ID (UID) and group IDs (GID).
who
List currently logged-in users.
su - username
Switch to another user account.
sudo command
Run a command with root privileges.
useradd username
Create a new user account.
usermod
Modify an existing user account.
userdel username
Delete a user account.
groupadd groupname
Create a new group.
passwd username
Set or change a user password.
chmod 755 filename
Change file permissions (4 is read, 2 is write, 1 is execute).
chown user:group filename
Change the owner and group of a file.
chgrp groupname filename
Change the group ownership of a file.