Create greetings after the launch Linux Terminal

Create greetings after the launch Linux Terminal

·

1 min read

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


First, create folder

mkdir welcome-script
cd welcome-script/

After this, you need to create .sh file

touch welcome.sh

You need to open welcome.sh file via Vim

sudo vim ./welcome.sh

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

Edit .bashrc

Open your file manager and paste this command

68747470733a2f2f692e696d6775722e636f6d2f437335473243382e706e67.png

/home/YOURUSER/.bashrc/

And now you need to paste command to .bashrc

68747470733a2f2f692e696d6775722e636f6d2f5855596b304a392e706e67.png

source /home/YOURUSER/welcome-script/welcome.sh

Source code

You can easily download this script from my GitHub repository.

Source code