Linux Flashcards
ls
Lists files and directories in the current directory
ls -l
Lists files with detailed info (permissions, owner, size, date)
ls -a
Lists all files, including hidden files (those starting with .
cd
Changes the current working directory
pwd
Prints the current working directory path
mkdir
Creates a new directory (folder)
rm
Deletes a file
rm -r
Deletes a directory and its contents recursively
mv
Moves or renames files and directories
cp
Copies files and directories
cat
Displays file contents or joins multiple files
nano
Simple, user-friendly command-line text editor
vim/vi
Powerful command-line text editors with modes and shortcuts
chmod
Changes file or directory permissions
chown
Changes the ownership of a file or directory
sudo
Runs a command as the superuser (admin privileges)
su
Switches to another user account (often root)
grep
Searches text using basic regular expressions
fgrep or grep -F
Searches for fixed strings (no regex interpretation)
egrep or grep -E
Searches using extended regular expressions
grep -f
Searches for patterns from a file
grep -e
Allows specifying multiple patterns directly in the command
man
Shows the manual page for a command
man grep
Displays the manual page specifically for grep
df -h
Shows disk space usage in human-readable format
du -sh
Shows the size of a directory and its contents
ifconfig / ip
Displays network interface configuration (use ip on modern systems)
history
Displays a list of previously entered commands
Linux Directory Layout
The structure of folders like /home, /etc, /bin, /var, /usr, etc
Linux Directory Navigation
Using commands like cd, pwd, ls to move through the file system
Least Privilege Principle
Users should have only the minimum level of access needed to perform their tasks
Linux Distributions (Overview)
Different flavors of Linux (e.g., Ubuntu, CentOS, Fedora, Debian) built on the Linux kernel but with different tools, package managers, and goals