Linux Commands Flashcards
List a directory’s content
ls
Shows the current working directory’s path
pwd
Changes the working directory
cd
Creates a new directory
mkdir
Deletes a file
rm
Copies files and directories, including their content
cp
Moves or renames files and directories
mv
Creates a new empty file
touch
Checks a file’s type
file
Creates and extracts a ZIP archive
zip and unzip
Archives files without compression in a TAR format
tar
Edits a file with a text editor
nano, vi, and jed
Lists, combines, and writes a file’s content as a standard output
cat
Searches a string within a file
grep
Finds, replaces, or deletes patterns in a file
sed
Displays a file’s first ten lines
head
Prints a file’s last ten lines
tail
Finds and manipulates patterns in a file
awk
Reorders a file’s content
sort
Sections and prints lines from a file
cut
Compares two files’ content and their differences
diff
Prints command outputs in Terminal and a file
tee
Finds files in a system’s database
locate
Outputs a file or folder’s location
find
Runs a command as a superuser
sudo
Runs programs in the current shell as another user
su
Modifies a file’s read, write, and execute permissions
chmod
Changes a file, directory, or symbolic link’s ownership
chown
Creates and removes a user account
useradd and userdel
Displays the system’s overall disk space usage
df
Checks a file or directory’s storage consumption
du
Displays running processes and the system’s resource usage
top
Works like top but with an interactive user interface
htop
Creates a snapshot of all running processes
ps
Prints information about your machine’s kernel, name, and hardware
uname
Shows your system’s hostname
hostname
Calculates commands’ execution time
time
Manages system services
systemctl
Runs another command continuously
watch
Displays a shell’s running processes with their statuses
jobs
Terminates a running process
kill
Turns off or restarts the system
shutdown
Checks the system’s network connectivity
ping
Downloads files from a URL
wget
Transmits data between servers using URLs
curl
Securely copies files or directories to another system
scp
Synchronizes content between directories or machines
rsync
Displays the system’s network interfaces and their configurations
lfconfig
Shows the system’s network information, like routing and sockets
netstat
Tracks a packet’s hops to its destination
traceroute
Queries a domain’s IP address and vice versa
nslookup
Displays DNS information, including record types
dig
Lists previously run commands
history
Shows a command’s manual
man
Prints a message as a standard output
echo
Links files or directories
ln
Sets and removes an alias for a file or command
alias and unalias
Displays a calendar in Terminal
cal
Manages Debian-based distros package libraries
apt-get