# I'm looking for a two row shell prompt

**URL:** <https://community.learnlinux.tv/t/im-looking-for-a-two-row-shell-prompt/1751>\
**Category:** Homelab\
**Created:** [July 31, 2022, 6:34am UTC](https://community.learnlinux.tv/t/im-looking-for-a-two-row-shell-prompt/1751 "2022-07-31T06:34:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KpuCko](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/kpucko/32/361_2.png) [@KpuCko](https://community.learnlinux.tv/u/KpuCko)\
**Post date:** [July 31, 2022, 6:34am UTC](https://community.learnlinux.tv/t/im-looking-for-a-two-row-shell-prompt/1751/1 "2022-07-31T06:34:16Z")

</div>

Hello guys,  
If I remember correctly in the past I have watched a video of Jay which do Pop!\_OS overview (but I could be wrong) on this tutorial I seen in a terminal fancy Linux shell (PS1) which consist of two rows, full directory path, date and seconds, probably git integration and so on. I also remember that I have checked the project in the GitHub and it looks promising and very widely used.

Unfortunately I can’t find the right article now.  
Can you help me with that?  
Thanks.

---

<div class="post-metadata">

**Author:** ![ameinild](https://community.learnlinux.tv/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@ameinild](https://community.learnlinux.tv/u/ameinild)\
**Post date:** [August 1, 2022, 10:37am UTC](https://community.learnlinux.tv/t/im-looking-for-a-two-row-shell-prompt/1751/2 "2022-08-01T10:37:21Z")

</div>

Jay’s prompt can be found in his Ansible configs on Github (complete with a nice Unicorn):

> <https://github.com/LearnLinuxTV/personal_ansible_desktop_configs/blob/main/roles/base/files/users/jay/bash/bash_prompt>

A little explanation to the default variables can be [found here](https://ss64.com/bash/syntax-prompt.html).

```auto
\t The time, in 24-hour HH:MM:SS format. 
\j The number of jobs currently managed by the shell. 
\h The hostname, up to the first . (e.g. deckard) 
\w The current working directory. 
\n A newline. 

```

The `tput` commands sets colors using this commands instead of bash color codes.

In addition, you can construct your own `if` structure to show Git information (if inside a Git tree), like this:

```auto
$(if [["$(git rev-parse --is-inside-work-tree 2>/dev/null)"]]; then echo -n "[$(git branch --show-current)]$(git rev-list HEAD --count):♮]"; fi)

```

---

<div class="post-metadata">

**Author:** ![jay](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/jay/32/649_2.png) [@jay](https://community.learnlinux.tv/u/jay)\
**Post date:** [August 5, 2022, 3:40am UTC](https://community.learnlinux.tv/t/im-looking-for-a-two-row-shell-prompt/1751/3 "2022-08-05T03:40:04Z")

</div>

Great job finding that, and great response!

I think that’s the longest I’ve used a bash prompt without changing it. The job count has been extremely useful to me.

---

<div class="post-metadata">

**Author:** ![ameinild](https://community.learnlinux.tv/letter_avatar_proxy/v4/letter/a/51bf81/32.png) [@ameinild](https://community.learnlinux.tv/u/ameinild)\
**Post date:** [August 5, 2022, 9:08am UTC](https://community.learnlinux.tv/t/im-looking-for-a-two-row-shell-prompt/1751/4 "2022-08-05T09:08:25Z")

</div>

I also have my own two-row prompt, and one of the features I like the most is the user info and file and directory count inside the current directory.

This is the code (without colors):

```auto
[$(stat -c '%U' .)\302\246$PWD]$(ls -Al | grep -c '^d'):$(ls -Ap | grep -c -v /)]

```

And this is the result in a directory:

```auto
[am¦/home/am]14:36]

```

This means I always know who owns the directory, and also if I do file operations (copy, move, delete etc.), I get instant notification that it succeeds, since the count numbers change.
