How to shorten your command line prompt (bash) like Spatry does it?

I got the following screenshot from a Spatry linux video from https://www.youtube.com/watch?v=ROyqnJg1Ipo

my command line is usually long. so i prefer whole of current path in 1st line and command prompt in next

I want something like this on every prompt

----[myusername@laptop]------[14:30:44]----/mnt/1CFED66BFED63CA8/router/Documents/hacking/1 set up tools/wifiphisher
==> 

Solution 1:

Assuming you're using bash, place a line like:

PS1="----[\u@\H]------[\t]----\w\n==> "

into your ~/.bashrc file, which will set your bash prompt to what you want. If you want to change it further, just consult the page http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

Solution 2:

Though The question is already answered and accepted, but I still want to suggest trying using bash-it.

It has numerous themes, aliases and completion support for several languages and frameworks, including git, rails, svn and many others.

Installation

  1. Download the zip archive from here https://github.com/Bash-it/bash-it/archive/master.zip and extract it in a folder .bash_it. This folder would be a hidden folder for starting with a dot(.).

  2. Run ~/.bash_it/install.sh (it automatically backs up your ~/.bash_profile or ~/.bashrc, depending on your OS)

  3. Edit your modified config ~/.bashrc file in order to customize Bash-it.

    For example if you want to use the Slick theme you'd change the line 8 of ~/.bashrc file to

     export BASH_IT_THEME='slick'
    

The Themes are in ~/.bash_it/themes/ directory.

The available themes screenshot can be viewed here. https://github.com/Bash-it/bash-it/wiki/Themes

Alternatively, you can preview all of them in your shell using the command

 BASH_PREVIEW=true reload

You can start using them by doing command

source ~/.bash_it/themes/<theme-name>/<theme-name>.theme.bash

'bobby' theme has a prompt with time included, try using it. You can also customize them.