Hello Friends, welcome back to another article about Linux. In this article I’ll tell you, how to make banner in Linux terminal. So that whenever you open terminal, that banner will be displayed. No matter which Linux distribution you are using these steps will be same for all Linux distros.
- So to create a banner, first we need to install figlet. With the help of figlet you can create so many types of stylish banners. If you don’t want to use figlet, you can also use alternatives of figlet like toilet package.
- After we install figlet, we need to set up a figlet command that will be executed automatically when terminal starts up. Follow the steps and commands mentioned below to make permanent banner in Linux terminal.
- Open Linux terminal and install figlet and lolcat package by typing
sudo apt install figlet lolcatfor Debian/Ubuntu.
sudo apt install figlet lolcat [For Debian/Ubuntu]
sudo yum install figlet lolcat [For CentOS/RHEL]
sudo dnf install figlet lolcat [For Fedora 22+]
- Using figlet and lolcat you can print text in different styles and colors. Like the below command prints amanbytes in terminal.
figlet "amanbytes" | lolcat
- You can also use many arguments from figlet to change the font style and the way it prints. For example, use -f and font name to specify the font and -c to print text in center of terminal. Use
showfigfontscommand in terminal to list all the supported fonts in figlet.
- Below command prints a beautiful banner in terminal using figlet and lolcat. It prints a name like “AmanBytes” and tagline “Dive into cyberworld”. You can copy paste it but, make sure to change the name and tagline according to you.
figlet -f slant -c "AmanBytes" | lolcat && figlet -f digital -c "Dive into cyberworld" | lolcat
- You can also make your own style using different arguments supported by figlet. use
man figletcommand in your terminal to know more about figlet.
Automating Banner Command
- Now we just need to run automatically the figlet command that prints our banner in terminal, every time terminal starts. So for that, type
nano ~/.bashrc. This command will open bashrc file in nano text editor. If you want you can also use another text editor that you like.
- Move to bottom of the file and type the below command.
#printbanner figlet -f slant -c "AmanBytes" | lolcat figlet -f digital -c "Dive into cyberworld" | lolcat
- Save the file using Ctrl + O and then exit nano text editor using Ctrl + X. That’s it now every time you open your Linux terminal, your banner will be printed.
Commands in bashrc file are executed whenever terminal is launched. So we just added our own command in bashrc file, so our command will be also executed whenever we open terminal. Using # we can comment in file. So I used
#printbanner so that whenever, I open bashrc file again I can know the below command prints banner.
If you are still stuck somewhere, feel free to watch the video available below. That’s it I’ll see you guys in next one.