25 Useful Commands for Linux Mint

25 Useful Commands for Linux Mint

Linux Mint is one of the most popular Linux distributions, known for its ease of use and powerful features. While the graphical interface offers a lot, knowing some terminal commands can significantly enhance your experience. Whether you’re a newbie or a seasoned user, these 25 commands will help you navigate, manage, and optimize your Linux Mint system effectively.

1. Checking Your Linux Mint Version

Before diving into the commands, it’s helpful to know which version of Linux Mint you’re running. Use the following command to display this information:

lsb_release -a

This command provides detailed information about your Linux Mint version, including the release number and codename.

2. Updating the System

Keeping your system updated is crucial for security and performance. Use this command to update your package list:

sudo apt update

After updating the package list, upgrade the installed packages with:

sudo apt upgrade

This ensures all your software is up-to-date.

3. Upgrading the Distribution

To upgrade your entire Linux Mint distribution to a new release, use the following command:

sudo apt dist-upgrade

This command handles package dependencies and removes unnecessary packages.

4. Cleaning Up Unused Packages

Over time, your system may accumulate unused packages. Clean them up with:

sudo apt autoremove

This command removes packages that were installed as dependencies but are no longer required.

5. Searching for Packages

To search for a specific package within the repositories, use:

apt search [package-name]

Replace [package-name] with the name of the package you’re looking for.

6. Installing New Software

Installing software is straightforward with the following command:

sudo apt install [package-name]

Replace [package-name] with the software you wish to install.

7. Removing Installed Software

To remove software you no longer need, use:

sudo apt remove [package-name]

This command removes the specified software, freeing up space.

8. Viewing Disk Usage

To check how much disk space is being used, run:

df -h

The -h option makes the output more human-readable, displaying sizes in GB or MB.

9. Checking Available Memory

To view your system’s memory usage, use:

free -h

This command shows the total, used, and available memory in a human-readable format.

10. Listing Connected USB Devices

To list all USB devices connected to your system, run:

lsusb

This command provides a detailed list of connected USB devices.

11. Listing PCI Devices

To view information about PCI devices, use:

lspci

This command lists all PCI devices, which include your network cards and graphics cards.

12. Checking System Uptime

To find out how long your system has been running, use:

uptime

This command shows the current time, system uptime, and average load.

13. Viewing System Logs

System logs can be crucial for troubleshooting. View them with:

dmesg

This command displays kernel-related messages and can help diagnose hardware issues.

14. Managing Services

To start, stop, or restart a service, use:

sudo systemctl [action] [service-name]

Replace [action] with start, stop, or restart, and [service-name] with the service you want to manage.

15. Viewing Active Network Connections

To see all active network connections and listening ports, use:

sudo netstat -tuln

This command helps monitor network activity and troubleshoot issues.

16. Killing a Process

If an application becomes unresponsive, kill it using:

kill [PID]

Replace [PID] with the Process ID, which you can find using the ps command.

17. Finding Files and Directories

To search for files or directories by name, use:

find /path -name [filename]

Replace /path with the directory to search in and [filename] with the file or directory name.

18. Viewing File Contents

To view the contents of a text file without editing it, use:

cat [filename]

This command displays the entire content of the file.

19. Editing Files with Nano

Nano is a simple text editor. To edit a file, use:

nano [filename]

This command opens the file in Nano, allowing you to make changes.

20. Compressing Files

To compress files into a .tar.gz archive, use:

tar -czvf [archive-name].tar.gz [file1] [file2]

Replace [archive-name] with the desired name and [file1] [file2] with the files you want to compress.

21. Extracting Files

To extract a .tar.gz archive, use:

tar -xzvf [archive-name].tar.gz

This command extracts the contents of the archive to the current directory.

22. Changing File Permissions

To change file permissions, use:

chmod [permissions] [filename]

Replace [permissions] with the desired permission settings and [filename] with the file name.

23. Changing File Ownership

To change the owner of a file, use:

sudo chown [owner]:[group] [filename]

Replace [owner] and [group] with the new owner and group, and [filename] with the file name.

24. Viewing Network Interface Information

To see detailed information about your network interfaces, use:

ifconfig

This command displays the IP address, MAC address, and other interface-related details.

25. Rebooting the System

Finally, to reboot your system, use:

sudo reboot

This command restarts your computer safely.

Conclusion

These 25 commands provide a strong foundation for managing and optimizing your Linux Mint system. From checking your system version to managing services, these commands cover essential tasks that every Linux Mint user should know. Whether you’re maintaining your system or troubleshooting issues, mastering these commands will help you work more efficiently and effectively.

Fedya Serafiev

Fedya Serafiev

Fedya Serafiev owns the website linuxcodelab.eu. He finds satisfaction in helping people solve even the most complex technical problems. His current goal is to write easy-to-follow articles so that such problems do not arise at all.

Thank you for reading the article! If you found the information useful, you can donate using the buttons below: