If you're new to Linux, start here! This section will cover the basics, including how to access the command line and essential concepts.
cd [directory]
ls
mkdir [directory_name]
touch [file_name]
cp [source_file] [destination]
mv [old_name] [new_name]
rm [file_name]
nano [filename]
vi [filename]
git clone https://github.com/username/repository.git
git status
git add README.md
git commit -m "Updated Linux Bible in README.md"
git push origin master
Important
If you're working on a branch other than master, replace it with the appropriate branch name. If this is your first time pushing to the repository, Git may prompt you to configure your username and email:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git status
uname -a
lscpu
free -m
df -h
sudo adduser username
sudo usermod -aG sudo username
passwd username
sudo deluser username
sudo apt update
sudo apt upgrade
sudo apt install packagename
sudo reboot
journalctl
last reboot
ps aux
kill PID
uptime
top
ifconfig
netstat -tuln
ping example.com
netstat -s
fsck /dev/sda1
find / -type f -size +100M
Note
Searches for files larger than 100 megabytes on the system.
sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades
rkhunter --check
sudo ufw status
sudo ufw allow 22
sudo ufw enable
Note
Checks the firewall status, allows SSH traffic, and enables the firewall.
lsusb
lspci
Note
Lists PCI devices connected to the system.
getent passwd
Note
Shows a list of all user accounts on the system.
getent group
usermod -g newgroup username
iostat
df -hT
sudo apt install htop
htop
Note
Interactive process viewer that provides a visual representation of CPU and memory usage.
sudo apt install lm-sensors
sensors
apt search packagename
sudo apt autoremove
tar -cvzf backup.tar.gz /path/to/backup
tar -xvzf backup.tar.gz -C /path/to/restore
sudo apt update
sudo apt clean
journalctl -xe
sudo nano /etc/network/interfaces
nslookup example.com
or
dig example.com
ls -l filename
cat /var/log/unattended-upgrades/unattended-upgrades.log
sudo apt install sysstat
sar -u
du -h
sudo apt install sysstat
pidstat 1
nohup command &
This Linux Command Bible is licensed under [Apache-2.0 license]. See the LICENSE file for details.