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 hitting ![launching terminal](https://lh4.googleusercontent.com/qbLq3vBX9xuNB6JHp3zz7pLDN7wbDvsMLjIAOXQgFWN3S7l9wmP6idlH5le96oLG76g6FOBRxSw2Etp37jEu9R8quQsQ0uX6kpm_aS4VS6_T9dLztVDHAbfov-tQ4nF2oSoWfTU)
ctrl+alt+t
will launch the terminal, if not try searching “terminal
” from your application’s menu and launch it.
If you don’t own a Linux machine and want to get started quickly. Then you can check out this online terminal emulator.
Overview of the Linux Terminal
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.
‘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.
1.pwd
short for “Print Work Directory”, this command will give you the exact path to the directory in you currently are (default is
/home/user
or ~
).2.ls
use this command to list the files and directories in a directory. Using ls
will list the contents in the current directory and ‘ls /directoryName’
to list the contents of a specific directory.![ls linux basic command](https://lh3.googleusercontent.com/zyKCbdnAUINjmwPLf1vg07RNjF_gK_JjifSSYSKF_bqJS7PEGJ0AEhNDrlhS_12xX3a4WwS-ruF_NuNfJ7eTs_EOexwmUM_WYPMM4Ig9JnVIMCHrqZoYGA66DCVWoYbojlDhsuU)
3.cd
use this command to 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.
‘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.4.touch
this command makes a new file simply by
‘touch newFile.txt’
.5.mkdir
pretty much like touch
this command creates a new directory simply by ‘mkdir newDirectory’
.![mkdir command preview](https://lh4.googleusercontent.com/0NNaQt3MTt-xWLmp-2xMOZBGQvb7dWlmHsK9_dsZ0ReePZPcw1OSbeQZX1VHEQhKd6vY3BSs1X0kEpv7fdPVmkjZ9snYN5quSVNWK6D2HROXORk1daLEj6BNebCymQ9Fe0_UL8k)
6.rm
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.
‘rm fileName’
will remove a single file and ‘rm -rf directoryName’
will destroy an entire directory along with its all files and sub-directories.
If you want to learn more commands why don’t you take a look at the 17 important Linux commands you must know
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).
rm
like 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.
Comments
Post a Comment