Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Empowering you to understand your world

Debian Commands: A Cheat Sheet With Examples

glow in the dark keyboard
Photo by seppe machielsen on Pexels.com

This article provides a list of useful Debian commands with examples that you can use for your daily activities. Whether you are a system administrator or a home desktop/laptop user, it’s helpful to keep this list of Linux commands handy. Note that these commands may not work with all other Linux distributions. However, many of them will.

Debian Commands To Install Apps

‘sudo’ is to provide the administrative privileges required to make changes to your system.

You can install apps on Debian using the APT package management system’s commands shown below. Example usage:

sudo apt install nameofapp

You can uninstall or remove an app from Debian using the ‘apt remove’ command as shown below. Example usage:

sudo apt remove appname

You can do a more thorough app removal, including its configuration files you can use APT’s purge command. Example usage:

sudo apt remove --purge appname

Debian Commands To Edit Files

If you need to edit configuration files, which is a common need for a Debian installation without a GUI (example: a server), you can start by trying to launch the Nano text editor since it usually comes with Debian. Press Ctrl + O to save the file, and Ctrl + X to close Nano and return to the command prompt. Example usage:

nano filename.txt

You can also quickly view files without launching a text editor using the ‘less’ command. Press ‘Q’ to return to your command prompt. Example usage:

less filename.txt

You can view the last line of a log file in real time using the tail command. Every time the log file changes, it will show the updated last line so you can monitor it without running the command or opening the file repeatedly. Example usage:

sudo tail -f var/log/syslog

How To Find A File On Debian

You can find a file on Debian at the command line using ‘locate’. You may have to install it first using the following commands:

sudo apt install locate

sudo updatedb

Example using of the ‘locate’ command. It will return the path to the file afterwards if it found it:

locate filename.txt
Subscribe to our newsletter
Get notified when new content is published