Skip to content

Welcome to the Linux Command Bible repository! This guide aims to be a comprehensive resource for learning and mastering Linux commands.

License

Notifications You must be signed in to change notification settings

smtkanchana66/Linux-Bible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 

Repository files navigation

Linux Command Bible

Table of Contents

  1. Getting Started

  2. Basic Commands

  3. Git command

  4. User Management

  5. System Maintenance

  6. System Logs

  7. Process Management

  8. Network Management

  9. Filesystem Management

  10. Security

  11. Disk Management

  12. System Performance Monitoring

  13. Software Package Management

  14. System Backup and Restore

  15. System Maintenance and Updates

  16. Network Configuration and Troubleshooting:

  17. Security and Permissions

  18. System Monitoring and Resource Usage2

  19. Advanced Process Management

  20. Contributing

  21. License

Getting Started

If you're new to Linux, start here! This section will cover the basics, including how to access the command line and essential concepts.

Basic Commands

Change Directory

cd [directory]

List Files

ls

Make Directory

mkdir [directory_name]

Create a File

touch [file_name]

Copy File

cp [source_file] [destination]

Move/Rename File

mv [old_name] [new_name]

Remove/Delete File

rm [file_name]

Open a File in a Text Editor (e.g., Nano):

nano [filename]

Open a File in a Text Editor (e.g., vi):

vi [filename]

Git command

Clone a Repository from GitHub:

git clone https://github.com/username/repository.git

Check Git Status:

git status

Stage your changes:

git add README.md

Commit the changes:

git commit -m "Updated Linux Bible in README.md"

Push the changes to GitHub:

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"

Check the status:

git status

System Administration

Display System Information:

uname -a

View CPU Information:

lscpu

Check Memory Usage:

free -m

Disk Space Usage:

df -h

User Management

Add a User:

sudo adduser username

Add a User to the sudo Group:

sudo usermod -aG sudo username

Change User Password:

passwd username

Delete a User:

sudo deluser username

System Maintenance

Update Package Lists:

sudo apt update

Upgrade Installed Packages:

sudo apt upgrade

Install a New Package:

sudo apt install packagename

Restart the System:

sudo reboot

System Logs

View System Logs:

journalctl

Check Last System Reboot Time:

last reboot

Process Management

List Running Processes:

ps aux

Kill a Process:

kill PID

Check System Load:

uptime

Monitor System Resources:

top

Network Management

Display Network Configuration:

ifconfig

Check Open Ports:

netstat -tuln

Verify Connectivity:

ping example.com

View Network Statistics:

netstat -s

Filesystem Management

Check Filesystem Integrity:

fsck /dev/sda1

Find Large Files:

find / -type f -size +100M

Note

Searches for files larger than 100 megabytes on the system.


Security

Update Security Packages:

sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades

Check for Rootkits:

rkhunter --check

Firewall Configuration (using UFW):

sudo ufw status
    sudo ufw allow 22
sudo ufw enable

Note

Checks the firewall status, allows SSH traffic, and enables the firewall.


System Information

List USB Devices:

lsusb

Check PCI Devices:

lspci

Note

Lists PCI devices connected to the system.


User and Group Management

List All Users:

getent passwd

Note

Shows a list of all user accounts on the system.

List All Groups:

getent group

Change User's Primary Group:

usermod -g newgroup username

Disk Management

Check Disk I/O Statistics:

iostat

View Filesystem Mount Points:**

df -hT

System Performance Monitoring

Monitor CPU Usage (using htop)

sudo apt install htop
htop

Note

Interactive process viewer that provides a visual representation of CPU and memory usage.

Check System Temperature (using lm-sensors)

sudo apt install lm-sensors
sensors

Software Package Management

Search for a Package:

apt search packagename

Remove Unused Dependencies:

sudo apt autoremove

System Backup and Restore

Create a System Backup (using tar):

tar -cvzf backup.tar.gz /path/to/backup

Restore from Backup:

tar -xvzf backup.tar.gz -C /path/to/restore

System Maintenance and Updates

Check for System Updates (using apt):

sudo apt update

Clean Package Cache:

sudo apt clean

Monitor System Logs (using journalctl):

journalctl -xe

Network Configuration and Troubleshooting

Configure Network Interfaces:

sudo nano /etc/network/interfaces

DNS Troubleshooting (using nslookup or dig):

nslookup example.com

or

dig example.com

Security and Permissions

Check File Permissions:

ls -l filename

Check System Security Updates (using unattended-upgrades):

cat /var/log/unattended-upgrades/unattended-upgrades.log

System Monitoring and Resource Usage

Check System Resource Usage (using sar):

sudo apt install sysstat
sar -u

Monitor Disk Space Usage (using du):

du -h

Advanced Process Management

Monitor Process Resources (using pidstat):

sudo apt install sysstat
pidstat 1

Background Process Management (using nohup):

nohup command &

License

This Linux Command Bible is licensed under [Apache-2.0 license]. See the LICENSE file for details.

Releases

No releases published

Packages

No packages published