8

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
==> 
edwinksl
  • 24,149
nazar2sfive
  • 1,523

3 Answers3

16

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

  • okay, i'll change what's in my answer to reflect the prompt you want – Noah Singer Aug 24 '16 at 03:56
  • okay got it :-P – Noah Singer Aug 24 '16 at 04:13
  • user@machine and time is shown but PWD is not displayed – nazar2sfive Aug 24 '16 at 04:17
  • sigh, changed it one more time – Noah Singer Aug 24 '16 at 04:18
  • 5
    @nazar2sfive Yes, next time try to search for yourself instead of repeatedly asking changes to somebody else. There's plenty of documentation about bash prompts, how to insert various information in various formats, with colors, bold, italics etc. Googleing "Bash prompt generator" yields results like this websites where you can drag&drop the information you want to display with styles etc. It includes a "new line" drag and drop.... in summary: you could just search "bash prompt generator" and obain this answer without having to annoy other people multiple times – Bakuriu Aug 24 '16 at 09:19
  • @ Bakuriu ... that's my addiction of copy-paste in linux – nazar2sfive Aug 24 '16 at 09:50
8

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.

Anwar
  • 77,924
0

What you are looking for is oh my zsh. You can customize everything.

enter image description here

Check out more screen shots: Wiki page (screen shots).