Blog

"Apt-get knowledge"

February 14, 2025

Oftentimes when first using the GNU/Linux operating system it can be daunting to understand what to do when presented with a command line interface (CLI). What follows is an abbreviated guide to some of the common commands found within this seemingly cryptic method of communicating with a computer.

Firstly, the most important command to understand while using a command line is the helpful built-in manual, or “man” pages which come with your distribution. I cannot stress how important it is to know that this exists and how to use it; many times looking up the man pages for a particular program has helped me avoid making errors or costly mistakes. For example, knowing the arguments (the various instructions given in the form of a dash and a letter or word such as -a) for a command like rm for “remove” can help you prevent accidentally deleting an important document. Unlike in Microsoft Windows or Apple macOS, the command line does not have a “recycle bin / trash bin.” This means that if you accidentally delete a file you may not be able to recover it; the command line, essentially, assumes you know what you are doing and does not “hold your hand” while you input information.

Secondly, there’s the ls command, which lists files contained within a directory. A “directory” is another word for a folder if you are more familiar with, say, Microsoft Windows’ approach to interacting files. To use the ls command, simply open your preferred terminal emulator (the program you use to issue and run command line tasks) and type ls. This will, presumably, list the files contained within your home directory. (e.g. /home/username/). For those just starting with GNU/Linux or similar UNIX-like operating systems, your “home directory” is where your personal files are usually stored. This nomenclature is also used within Apple’s macOS operating system. Microsoft Windows does things slightly differently, but the concept of a “My Documents”, “My Music”, “My Photos,” etc. folders are similar.

Now, if you’re like me, and I know I sure am, you happen to enjoy using the Debian GNU/Linux distribution of GNU/Linux. This means, unless altered otherwise, that you will be using the apt-get command frequently. Why do we use this program? It is designed to fetch reputable software from a trusted source, download it and install the software with a minimum of user effort. “Apt” in this case is short for “aptitude” and is, according to the man (or manual) page for the program, a “command-line tool for handling packages.” You can use apt-get to update your list of software sources, upgrade your software or even your operating system distribution to a newer version.

Let’s say you have a file in a directory like /home/username/Documents and you want to copy said file into /home/username/Desktop. How would you accomplish this task? By way of the copy or cp command. By typing cp filename /home/username/Desktop you are copying the source file “filename” into the destination directory (in this case, your desktop).

Hopefully these few commands will help you in your journey towards understanding and fully utilizing the GNU/Linux operating system to accomplish whatever task you have at hand.

Thumbnail Credits
"BASH Logo Colored.svg" © / Free Software Foundation, FAL, via Wikimedia Commons
"File:Linux command-line. Bash. GNOME Terminal. screenshot.png" © / ZxxZxxZ, Public domain, via Wikimedia Commons