A Basic Overview of Every Day Linux Terminal Commands

The terminal is an integral part of Linux systems. Learning the terminal and its commands not only increases your understanding of your system and how it operates, but also gives you plenty of opportunities to automate tedious tasks like renaming files through Bash scripting.

The Most Important Command of All (man)

man (manual) is probably the most important command of all. Don’t understand something here? Want to learn more about one of these commands? Want to learn more about different terminal commands? man is your friend. Often a quick search in a browser of your choice will suffice for whatever you need to know, however in some cases doing a quick search through man can be just as useful. man stands for manual, and the syntax for this command is as follows: man [commandName], and that’s it! Unlike the internet this command is also always available to you, so whether you’re on an airplane or in the middle of a Congolese rainforest man is there for you.

Changing Directories (cd)

cd, or change directory, changes your directory. Of course this is useful for changing directories, but a few tips are that if you ever need to get back to your home directory, or ~/, you can just type cd without passing any arguments. If you’d like to go back a directory then you can also use cd ..

Listing Files (ls)

ls, or list, is a useful way of understanding what files are in your current directory. You can pass -a to it, which will allow you to see all in the current directory, including files/directories that are hidden with a . in front of them, such as .local.

Copying Files (cp)

cp, or copy, is used to copy files. Generally if you want to copy a file just type in cp [filename] [path/to/copy/location/], however in the case of wanting to copy you would specify -r to execute the command recursively.

Deleting Files (rm)

rm, or remove, is a tool for removing files. This can be a bit of a dangerous tool, and once you rm something it’s gone, so be careful! For basic operations you can rm [filename], however if you have to remove an entire directory then you’ll need to give it the directory name and pass -rf to it, which will tell rm to remove files recursively, and to force it to execute.

Renaming files (mv)

mv, or move, renames files. Yeah. A command called move. Let’s not get too hung up on that though. mv is both for renaming files and also for moving them, as the name would suggest. If you want to rename your file just mv [CurrentFileName] [NewFileName], and if you’d like to actually move it you’d essentially pass the same argument, but this time with a directory to move it to.

Super user do (sudo)

sudo, or super user do, is a command which allows you to run commands as root, or the super user. This command can be useful if you do not have permission to write edit a certain file (/etc/fstab, for example) or simply need it to update your files with whatever package manager you may be using.

Package Managers

I can’t give a definitive command here as there are many package managers out there for different Linux distros, however what I can tell you is what a package manager is. A package manager is the way you install files on Linux. There’s no need to go to a website that looks like it was made sometime around 2005 to download a sketchy .exe file. You can just run your package manager with some sort of install candidate and install the program right there. Some applications will require you to go to their website however and get a .deb or whatever file it may be for your respective distro that acts like a .exe, however this is usually not the case.

…That’s about it.

That’s all I have for now. These commands should be able to get you through daily tasks if you should choose to do them on the command line. These commands are very simple, and while it is true you could do the same things in a file manager one thing you cannot do in a file manager is automate these tasks. Given, automation isn’t all the command line has going for it. There are also tools such as youtube-dl which allows you to download videos from youtube, and ffmpeg which allows you to compress and transcode all sorts of media files.

I hope you found this article at least semi-helpful, and encourage you to look for situations where you can use the command line every day.