Remember what a terminal is? Let me remind you. Shell is a program that runs or processes commands and sends output. There are plenty of shells in Unix, and the one you’ll be using is called Bash. A terminal on the other hand is a software that runs the shell. You’re not limited to running Bash only in the terminal. In the future, you’ll use the Python program on the terminal. In fact, you’ll use various programs from the terminal. So, open your terminal, and get started!
- Shortcut to open a terminal: Ctrl+Alt+T
This is how a typical terminal looks like in Linux. The look might differ depending on different OS like Windows, Mac, Linux, and on different distros of Linux like Ubuntu, Fedora, Kali. The underlying principles are the same for all, so don’t worry!
What does the default text say
You can see the default text on my terminal shows fahim@Fahim:~$ which represents a structure user@machine:directory$
Here User is the name of the user. A computer can have many users. Even if you’re the only user of your computer, there’s an administrative mode, where the user is named as root. Machine is the name of your computer. In my case, I named it as Fahim. It depends on how you set up your computer. In between the colon and dollar sign lies your directory (folder) path. It shows where you’re working currently. By default, you’re on /home/ directory (folder), as tilde (~) represents the home directory. If you’re in administrative mode, you’ll be in /root/ directory by default. But what does this actually mean? Let’s see the Linux file system.
Understanding the Linux File System
All your personal files and folders are stored in the Home folder. When you open your terminal, by default it starts at the /home/ directory. When you need to perform administrative tasks, either you’ve to open the terminal in admin mode or input password for each session. Details on future posts. You can jump from any folder to any other folder with a simple command. This helps you to perform some tasks specific to a folder. In case you’re curious, here you’ll find details:
- Paths and Directories
- Navigating Directories
- Reading Files
- Organizing Files part 1
- Organizing Files part 2
Multiple Terminals at Once
You can open multiple tabs in one Terminal window or multiple terminal windows at once. Sometimes you need to perform multiple tasks at once, that’s when it comes handy. Say you’re downloading a movie on a terminal. In the meantime, you want to practice some Python codes in the terminal. But you can’t do it in one terminal. In this case, you might keep one terminal busy in downloading your movie, and open another tab or window to practice your codes. I generally use multiple terminals when downloading multiple movies at once. Thus I don’t have to wait before the screen all the time!
Click on “Files” and then choose either a new tab or a new window.
Customizing Linux Terminal
If you use so many shortcuts to make your tech life easy, you may want to apply them to the terminal. By default, the terminal shortcuts may differ from what you’re used to. In my case, Ctrl+C/X/V/A/Z/Y didn’t work for copy, cut, select all, undo, redo. But the interesting part is that you can customize the shortcuts in a Linux terminal!
Go to Edit –> Preferences –> Shortcuts
Click on any shortcut and type your desired shortcut. They will be overwritten. You may like to visit the Unnamed section to customize your terminal as you want.
To terminate a running program on the terminal, you need to press Ctrl+Z or Ctrl+C or something else. Look at this listing what the actual shortcut is. If you want, you can overwrite it. I use Ctrl+Z.
Up next, you’ll get your hands dirty with Bash Scripting!