1/124
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Command to list directory contents
ls
Option to show long listing format with ls
ls -l
Option to list all files including hidden with ls
ls -a
Command to display current working directory
pwd
Command to change directory
cd
Change to parent directory
cd ..
Shortcut to home directory
cd ~
Reuse previous working directory
cd -
Command to create a file
touch
Command to create a directory
mkdir
Option to create parent directories as needed with mkdir
mkdir -p
Command to remove a file
rm
Command to remove directory recursively & force
rm -rf
Command to copy files
cp
Option for recursive copy
cp -r
Command to move/rename a file
mv
Command to display contents of file
cat
Command to concatenate multiple files into one
cat file1 file2 > combined.txt
Command to view file with pagination
less
Quick exit from less
q
Display first 10 lines of a file
head
Display last 10 lines of a file
tail
Follow log file in real time
tail -f
Search for pattern in files
grep "pattern"
Make grep case‑insensitive
grep -i
Count lines matching pattern
grep -c
Show line numbers with grep
grep -n
Search recursively with grep
grep -r "pattern"
Find files by name (current dir)
find . -name "*.txt"
Find and delete empty files
find . -type f -empty -delete
Search command history
Ctrl + r
Repeat last command
!!
Run previous command starting with string
!ls
Get help for a command
man
Quick help output (many commands)
What does 'apropos' do
Search man page names/descriptions
Display path of executable
which
Show command location in PATH list
type -a
Print environment variables
printenv
Set environment variable for current session
export VAR=value
Change file permissions (symbolic)
chmod u+x
Change file permissions (numeric)
chmod 755
Change owner of file
chown
Change owner & group
chown
Change group ownership
chgrp
Permission bits: read
4
Permission bits: write
2
Permission bits: execute
1
Special permission setuid value
4### (chmod 4755)
Octal 644 corresponds to
rw-r--r--
Symbolic to remove execute for others
chmod o-x
Command to change default perms mask
umask
Default umask for regular users
022
File that stores user accounts
/etc/passwd
File that stores encrypted passwords
/etc/shadow
Command to switch user
su -
Command to run cmd as root
sudo
File that configures sudo privileges
/etc/sudoers
Command to edit sudoers safely
visudo
Command to add user
sudo useradd
Show snapshot of current processes
ps aux
Show tree view of processes
pstree
Interactive process monitor
top
Improved top with colors & sorting
htop
Kill process by PID
kill
Force kill process
kill -9
Find PID by name
pgrep
Run command in background
Bring bg job to foreground
fg
List jobs in current shell
jobs
Nice value meaning
CPU scheduling priority
Change priority of running process
renice
Display system uptime and load
uptime
Check disk usage human readable
df -h
Check directory size summary
du -sh
Show memory usage
free -h
Display block device information
lsblk
Display mounted filesystems
mount | column -t
Mount ISO image
sudo mount -o loop cd.iso /mnt
Unmount filesystem
sudo umount /mnt
Show IP addresses (modern)
ip addr
Bring interface up
sudo ip link set eth0 up
Check network connectivity
ping
Traceroute to host
traceroute
DNS lookup command
dig
Simple HTTP request tool
curl
Transfer files over SSH
scp file user@host:/path
Secure shell login
ssh user@host
Package index update (Debian)
sudo apt update
Install package (Debian)
sudo apt install
Remove package (Debian)
sudo apt remove
Upgrade all packages (Debian)
sudo apt upgrade
Package manager for Red Hat
yum or dnf
Show package that owns a file (dpkg)
dpkg -S
List all installed packages (RPM)
rpm -qa
Enable a service with systemd
sudo systemctl enable
Start a service
sudo systemctl start
View service status
systemctl status
View systemd journal logs
journalctl -xe
Reboot the system
sudo reboot