Create greetings after the launch Linux Terminal

rendick

rendick

Posted on May 23, 2022

Create greetings after the launch Linux Terminal

Hey! Today I will tell you how to create greetings after the launch Linux Terminal.


First, create folder

mkdir welcome-script
cd welcome-script/
Enter fullscreen mode Exit fullscreen mode

After this, you need to create .sh file

touch welcome.sh
Enter fullscreen mode Exit fullscreen mode

You need to open welcome.sh file via Vim

sudo vim ./welcome.sh
Enter fullscreen mode Exit fullscreen mode

Basic commands

echo - command that output text, etc.

Variable (programming) - named

Commands in a variable - output anything, function

sleep - time to finish something after the time

u - variable for Linux function(like Username, OS version, etc)

$ - for output Linux command. Example: os=$(whoami) (variable=function for command(command)


Code

#!/bin/bash

name="Name"

u="$USER"

echo " "
echo " "
echo "░█░█░█░█▀▀▀░█░░░░█▀▀▀░█▀▀█░█▀█▀█░█▀▀▀░"
echo "░█░█░█░█▀▀▀░█░░░░█░░░░█░░█░█░█░█░█▀▀▀░"
echo "░▀▀▀▀▀░▀▀▀▀░▀▀▀▀░▀▀▀▀░▀▀▀▀░▀░▀░▀░▀▀▀▀░"
sleep 1

echo " "
now=$(date)
echo "Current time: $now"

echo " "
echo "Hello $USER!"
sleep 1

echo " "
os=$(uname -r)
echo "Your OS is $os"
echo " "
sleep 1

setup=$(neofetch)
echo "Your PC stats: $setup"
echo " "
sleep 1
Enter fullscreen mode Exit fullscreen mode

Edit .bashrc

Open your file manager and paste this command

BashRC

/home/YOURUSER/.bashrc/
Enter fullscreen mode Exit fullscreen mode

And now you need to paste command to .bashrc

Paste

source /home/YOURUSER/welcome-script/welcome.sh
Enter fullscreen mode Exit fullscreen mode

Source code

You can easily download this script from my GitHub repository.

Source code

💖 💪 🙅 🚩
rendick
rendick

Posted on May 23, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related