47

As you can see on this screenshot of Mik's Guake he has a startup message of ASCII art when he opens it, and that's what I'd like to do, can someone help me?

Mik's Guake

4
  • Please see this question, where I explain one way of doing it. Unfortunately, your question is a possible duplicate of that one.
    – user76204
    Dec 31 '12 at 16:06
  • @Mik I think my question is a "real" duplicate of this one. Anyway, could you please explain me how to make the text get colored? Is that a argument on echo?
    – Zignd
    Dec 31 '12 at 16:15
  • The prompt is red because I have specified some ANSI escape codes in the PS1 line in my .bash_aliases ; you can do this manually in your bash_aliases or .bashrc for various things. You should also be able to use the preferences in gnome-terminal or guake to alter some of the appearance settings. There's some good answers on this site discussing the use of colour and ANSI escape codes in the terminal.
    – user76204
    Dec 31 '12 at 16:27
  • Congrats. Your question almost has 100k views! Apr 25 at 19:53

10 Answers 10

24

Open your terminal with CTRL+ALT+T and type as

nano ~/.bashrc

There type as

echo " Hi Zignd" then close and save it.

then type this command to reload bashrc .

source ~/.bashrc

You will what you want.

for example :I made my self.

enter image description here

3
  • 2
    Make sure that this echo is within a condition that checks that the output is a tty, or (your choice) the shell is interactive. Otherwise you'll break scp, rsync.
    – egmont
    Aug 28 '15 at 6:54
  • You can also add screenfetch. Jan 31 '18 at 17:01
  • The source command is completely unnecessary.
    – nog642
    Sep 16 at 22:29
18

To extend @snow's answer, put the code below from the very first line of your .bashrc. And be proud to be ubuntu user :)

echo "MMMMMMMMMMMMKlxMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMW0occlxNM"
echo "MMMMMMMMMMMMOcxMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMKOXMMMMMMMMMMMMMMMMMNdcoxkOlc0"
echo "MMMMMMMMMMMMOcxMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMdcOMMMMMMMMMMMMMMMMMkoO0lckkcl"
echo "dxWMMMM0d0MMOcoxdooxONMMMOdXMMMMXdkMMWkxdoodxONMMMdcldddkMXdxWMMMM0dKM0coOxk0xcd"
echo "ccNMMMMxckMMOco0XNXkclKMMxc0MMMMKcoMMNllKXXXkclXMMdcxKKKXMKclNMMMMkc0MM0oclldokN"
echo "ccNMMMMxckMMOcxMMMMMOclWMxc0MMMMKcoMMNllWMMMMdcOMMdcOMMMMMKclNMMMMkc0MMMMNXXNWMM"
echo "ccNMMMMxckMMOcxMMMMMKccNMxc0MMMMKcoMMNllWMMMMxckMMdcOMMMMMKclNMMMMkc0MMMMMMMMMMM"
echo "lcKMMMMxckMMOcxMMMMWdcxMMkcxMMMMKcoMMNllWMMMMkckMMxckMMMMMNccKMMMMkc0MMMMMMMMMMM"
echo "0lcxkkklckMMOclkOkxlckWMMNocdkkkdcoMMNllWMMMMkckMMXlcxkkxNM0lcxkkkoc0MMMMMMMMMMM"
echo "MNxlccloxXMMXxolccokNMMMMMWOolclox0MMWxkWMMMM0d0MMMXxlclxNMMNklcclokXMMMMMMMMMMM"

OR

echo "       _                 _         "
echo " _   _| |__  _   _ _ __ | |_ _   _ "
echo "| | | | '_ \| | | | '_ \| __| | | |"
echo "| |_| | |_) | |_| | | | | |_| |_| |"
echo " \__,_|_.__/ \__,_|_| |_|\__|\__,_|"

The secret to these image like characters is to use an image converter to ASCII characters. There are lots of free tools in the wild like toilet or figlet but I personally use jp2a.

You can also use this site for generating text to ASCII instead of image to ASCII.

3
  • +1 for mentioning the site to generate ascii images
    – don.joey
    Jan 5 '13 at 16:29
  • +1 for jp2a (why use a website?)
    – Vreality
    Oct 5 '13 at 0:20
  • Make sure that these echos are within a condition that checks that the output is a tty, or (your choice) the shell is interactive. Otherwise you'll break scp, rsync.
    – egmont
    Aug 28 '15 at 6:54
10

How do we apply ASCII art into the terminal?

There are numerous ways of generating ASCII art, including specialized software and manual building but there are also websites that generate ASCII art by simply entering the desired name.

First we need to generate/create the ASCII "code": visit this website, type the desired name and copy the "live" generated ASCII result.

Then create a text file named art and paste into it the above mentioned generated ASCII result, copy the art file in your home folder (navigate here by clicking Nautilus sidebar's Home), open the .bashrc file (to make it viewable, press Ctrl+H) and paste on the bottom of the page

cat art

enter image description here Worth mentioning:

The above-mentioned site contains hundreds of different fonts for generating ASCII that feature various sizes, 3D-look, etc.

enter image description here

Source

As for images to ASCII go to this website

6

First generate a ascii drawing. I recommend asciio:

apt-get install asciio

asciio

Example:

  .-------.
  |  Hi   |
  '-------'
      ^      (\_/)
      '----- (O.o)
             (> <)

Copy and paste the drawing in file:

vim /home/<youruser>/banner

Finally, add at the end of file to read when you open a new bash:

echo "cat banner" >> /home/<youruser>/.bashrc

Open another terminal:

ready

4
  • Can you please translate your answer to English?
    – edwinksl
    Jul 27 '16 at 2:15
  • Sorry. I tried. Jul 27 '16 at 2:25
  • I haven't permission for post images yet. Sorry. Jul 27 '16 at 2:30
  • That's fine, I am aware of that.
    – edwinksl
    Jul 27 '16 at 2:31
4

This one takes a png image file and outputs a facsimile onto your terminal

If you have nodejs installed then issue

npm install -g picture-tube

then put this into bottom of your ~/.bashrc

echo "picture-tube  --cols 60   /tmp/justpng/orbifold_333_shell.png"
      picture-tube  --cols 60   /tmp/justpng/orbifold_333_shell.png

code is at https://github.com/substack/picture-tube

enter image description here

enjoy

4

enter image description here

sudo apt-get install figlet

echo "Hello world!" | figlet | color_it.sh 54

cat color_it.sh

#!/usr/bin/env bash 

## A.M.Danischewski 2015+(c) Free - for (all (uses and 
## modifications)) - except you must keep this notice intact. 

declare INPUT_TXT=""
declare    ADD_LF="\n" 
declare -i DONE=0
declare -r COLOR_NUMBER="${1:-247}"
declare -r ASCII_FG="\\033[38;05;"
declare -r COLOR_OUT="${ASCII_FG}${COLOR_NUMBER}m"

function show_colors() { 
   ## perhaps will add bg 48 to first loop eventually 
 for fgbg in 38; do for color in {0..256} ; do 
 echo -en "\\033[${fgbg};5;${color}m ${color}\t\\033[0m"; 
 (($((${color}+1))%10==0)) && echo; done; echo; done
} 

if [[ ! $# -eq 1 || ${1} =~ ^-. ]]; then 
  show_colors 
  echo " Usage: ${0##*/} <color fg>" 
  echo "  E.g. echo \"Hello world!\" | figlet | ${0##*/} 54" 
else  
 while IFS= read -r PIPED_INPUT || { DONE=1; ADD_LF=""; }; do 
  PIPED_INPUT=$(sed 's#\\#\\\\#g' <<< "${PIPED_INPUT}")
  INPUT_TXT="${INPUT_TXT}${PIPED_INPUT}${ADD_LF}"
  ((${DONE})) && break; 
 done
 echo -en "${COLOR_OUT}${INPUT_TXT}\\033[00m"
fi 

its typical to create a dir ~/bin and make all those files visible

mkdir ~/bin
# ... put above color_it.sh as file ~/bin/color_it.sh
chmod +x ~/bin/color_it.sh   # make it executable
export PATH=${HOME}/bin:${PATH}  # add this line to your ~/.bashrc

echo "Hello world!" | figlet | color_it.sh 34
3

You can add interesting ASCII arts on your terminal without leaving your terminal. cowsay has some of the coolest ASCII arts and piping fortune outputs into cowsay can take this to another level. Let's see how this is done, open your terminal and type:

sudo apt-get install cowsay

Now cowsay is installed let's have some fun, add the following command

cowsay I am in a good mooooo-d.

If you don't like the cow, there is a mystical zoo within your terminal, type

cowsay -f dragon Who dared to wake me up?

To bring up a list of all the animals in your mystical zoo type cowsay -l. If you prefer 'thinking animal' over talking one try

cowthink -f <animal name> <your message>

< > are to be ignored. If you want to display a same custom message each time you log in please continue, otherwise skip to the next step.

Copy your ASCII art and go to the home directory. Create a file <newfile.txt>, paste your ASCII art inside the file, and save it. Open a file.bashrc from the home directory. Add the following on the bottom line of the file and save it.

cat <newfile.txt>

You are done :) reopen your terminal.


Let's make your animal a little more intelligent by adding fortune

sudo apt-get install fortune

Go to the home directory and open .bashrc and add the following as top line of the file

fortune | cowsay -f <your animal>

Now save the file and you are done :)

3

Run these commands as root

  1. Install figlet

    apt-get install figlet

  2. For editing .bashrc file, we need a text editor, here we use leafpad

    apt-get install leafpad

  3. Edit the .bashrc file located in the root folder.

    leafpad /root/.bashrc

  4. Scroll down to the end of the file then type figlet your name

    figlet Anonymous

  5. Type in the next line echo "your message"

    echo "We are Anonymous"

  6. Save the file (File->Save)

img_terminal

Finally, relaunch your terminal again with the root privileges

1
  • it is not working for non-root terminal, 2nd i like your terminal tree orientation is there any link for that i can refer Jul 20 '20 at 9:02
0

Here's my terminal slash screen:

Terminal Splash Screen

It combines elements of other answers here including figlet and toilet depending on which is already installed on your system. The full setup (bash script) is explained here:

0

Show the colorful TEXT ART in Linux Terminal

ascii_text_art

Follow these steps:

  1. Install figlet and lolcat:

    sudo apt install figlet lolcat
    
  2. Install git:

    sudo apt install git
    
  3. Download some figlet fonts from GitHub:

    cd Desktop
    git clone https://github.com/xero/figlet-fonts.git
    

    or visit the link: https://github.com/xero/figlet-fonts.git

  4. Copy all the font files from figlet-fonts directory to /usr/share/figlet/:

    sudo cp figlet-fonts/* /usr/share/figlet/
    
  5. For editing the .bashrc file, we need a text editor. Here we use nano:

    sudo apt-get install nano
    
  6. Open the .bashrc file (located in the root folder) in the nano editor:

    sudo nano /root/.bashrc
    
  7. Scroll down to the end of the file (press the down arrow key) and then type the following:

    figlet -f font_name your_text | lolcat
    

    For example:

    figlet -f 3d Hello World! | lolcat
    
  8. To save the file press Ctrl+O then hit Enter. Then press Ctrl+X to exit.

  9. Now launch your terminal with admin privilegesand you will see the text art. :)

Note: The text art color will automatically change each time you launch the terminal (with admin privileges).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.