Whether you have currently installed a fresh Linux Distro. Or you have just come to know that there exists a thing called Linux terminal in your system. So you want to try your hands on it. And basically, want to know whats all the fuss about this “Linux Terminal” thing.
This guide will help you get the complete idea about what the Linux terminal is. And will quickly get you started with it using some simple day-to-day commands (the actual sauce of terminal).
Note: Mac users can also follow this guide.
What actually is Terminal?
Terminal basically provides a command-line (only text-based) interface to communicate with the core system. It takes some commands from you and then sends it to the system to process the output.
The Terminal you have in your Linux distribution is actually a “Terminal Emulator”. Which is provided by their respective distribution managers.
Terminal Emulators emulates or mimics the behavior of an actual terminal while also running in a GUI(Graphical User Interface) environment. This is the reason why distributions are provided with terminal emulators.
But Why use Terminal?
It’s a legitimate question to ask that, what’s the need of a terminal while the same tasks can be done without it (with the help of GUI)? Well, the short answer is we need a fast and efficient way to perform our tasks (and yeah! you can save some money of a mouse because you only need your keyboard for that).
If you are planning to become a Developer, Programmer, System admin, Data scientist, Hacker, etc. Then you will have to know the use of the terminal. This skill is one of the highest priorities to learn in the above-mentioned types of field.
Don’t worry, this guide completely walks you through every step you need to take. And you will start using the terminal right away.
Launching your Linux Terminal
In most cases hittingctrl+alt+twill launch the terminal, if not try searching “terminal” from your application’s menu and launch it.
There’s not much to it (not really). You can clearly see that, it’s an almost blank window with a little text written at the top-left corner. And a blinking cursor waiting for your input.
Launch Programmes with Terminal
You can use the Terminal as an application launcher. Just type the name of the application you have installed in your system. For example, try typing ‘firefox’ and hit enter to launch it. You can try ‘vlc’ and other applications if you have them installed.
You can get a command not found error even if you have the application already installed because some applications have a different terminal reference name like ‘code’for visual studio code, ‘subl’ for sublime text, etc. so, try playing with your favorite applications name on the Terminal.
Directories and File Manipulation with Terminal
Your terminal can also act as a full-fledged file explorer. You can navigate around your files and directories, create them, delete them, and basically anything you do with your file explorer. The following are some commands to get you started.
short for “Print Work Directory”, this command will give you the exact path to the directory in you currently are (default is /home/useror ~).
use this command to list the files and directories in a directory. Usingls will list the contents in the current directory and‘ls /directoryName’to list the contents of a specific directory.
use this commandto change directories and navigation like a file explorer. ‘cd /directoryName’ will get you inside the directory or use ‘cd /full/path/to/directory’ (if you really know the full path) to navigate to a nested directory.
Note: You can have directories with spaces in between. For that use a backslash(‘\’) in front of every space that occurs in between any file or directory to avoid a potential error. For example, use ‘cd My\ Folder’ to get inside My Folder. This goes for other command s as well which involves files and directories.
this command makes a new file simply by ‘touch newFile.txt’.
pretty much liketouchthis command creates a new directory simply by‘mkdir newDirectory’.
use this command to remove files and directories. ‘rm fileName’will remove a single file and ‘rm -rf directoryName’ will destroy an entire directory along with its all files and sub-directories.
Important Note: Be careful while executing the above commands. Make sure to spell the files and directories names correctly, because they all are case-sensitive (you can’t mess uppercase letters with lowercase ones and vice-versa). rmlike commands (when not been executed carefully) can cause serious data loss which can’t be recovered.
Installing Applications with Terminal
Every Linux distribution comes with its software center and a package manager. But you can install all the software and applications from the Terminal itself using the ‘sudo apt-get install’command.
For Example, try installing figlet using ‘sudo apt-get install figlet’and type in your user password when asked. Once installed try ‘figlet Linux is Awesome’ command and experiment it yourself.
Try installing vlc media player with the terminal and comment down below if it worked or not.