0% found this document useful (0 votes)
13 views

linux basic commands

Uploaded by

r19512695
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

linux basic commands

Uploaded by

r19512695
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

# User Management

sudo adduser username


# Adds a new user with the specified username.

sudo deluser username


# Deletes the specified user.

sudo passwd username


# Changes the password for the specified user.

# Package Management
sudo apt update
# Updates the package lists for upgrades and new package installations.

sudo apt upgrade


# Upgrades all the installed packages to their latest versions.

sudo apt install package_name


# Installs the specified package.

sudo apt remove package_name


# Removes the specified package.

# Service Management
sudo systemctl start service_name
# Starts the specified service.

sudo systemctl stop service_name


# Stops the specified service.

sudo systemctl restart service_name


# Restarts the specified service.

sudo systemctl enable service_name


# Enables the specified service to start on boot.

sudo systemctl status service_name


# Checks the status of the specified service.

# File System Management


df -h
# Displays disk space usage in a human-readable format.

du -sh /path/to/directory
# Displays the size of the specified directory.

sudo mount /dev/sdX1 /mnt


# Mounts the specified filesystem to the /mnt directory.

sudo umount /mnt


# Unmounts the filesystem mounted at /mnt.

# Network Management
ip a
# Displays all network interfaces and their statuses.

sudo systemctl restart networking


# Restarts the networking service.
netstat -tuln
# Displays network connections, routing tables, interface statistics, masquerade
connections, and multicast memberships.

# System Monitoring
top
# Displays real-time system information including CPU and memory usage.

free -h
# Displays memory usage in a human-readable format.

sudo journalctl -xe


# Displays the system logs with detailed information.

You might also like