How to improve your work in the terminal

Sometimes it can be very confused work with he terminal because we execute several commands and it is not clear where the results linked to one command end and where the other results begin.

An easy way to fix this problem is to add a spreader bar that allows divide the different commands and their results easily.

Create a blank file named .bash_ps1 in your user folder:

nano .bash_ps1

Then, copy the following text into the file:

...

Save the changes, close the terminal and reopen it. Voila!

Source: Lifehacker


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   ermimetal said

    Good trick, the net will serve me

  2.   Mauro Nicolas Ybanez Girard said

    Great. Simple and easy! I loved the result ...

  3.   Diego Leonard Bridge said

    Excellent! (a lo burns!) thanks!

  4.   lulius said

    The article is very good, but it does not suit me. Steps that I do 1st in my main folder (llulius) and there they hang (downloads, documents, desktop, etc) I create an empty file and when giving it the name I put it (nano .bash_ps1), edit the folder and copy all the text, save the text and I close the file. I open a terminal and execute (nano ~ / .bashrc) an editor opens inside the terminal I put the text if [-f "$ HOME / .bash_ps1"]; then
    . "$ HOME / .bash_ps1"
    fi
    at the end of everything and I save with control or and I leave with x
    I open the terminal again and everything remains the same as the song of Julio Iglesias
    Thanks for reading the article and see what I do wrong

  5.   angelux said

    I really like it, but I managed to do better with ZSH, it has prompts that can be put on either side of the terminal and that helps me better.

  6.   Orlando Garzon Diaz said

    Thanks Eärendil for this article. I just tried it and it worked flawlessly on the normal console and in Guake! I think it will help me a lot.

  7.   Orlando Garzon Diaz said

    Thanks Eärendil for this article. I just tried it and it worked flawlessly on the normal console and in Guake! I think it will help me a lot.

  8.   Let's use Linux said

    Try again. It should work. It worked for me. : S
    Cheers! Paul.

  9.   Let's use Linux said

    You're welcome! I'm glad it serves! 🙂
    Cheers! Paul.

  10.   Javier Debian Bb Ar said

    I copy it! Indeed, my terminals tend to end in gibberish.

  11.   Skeptical said

    Great! It seemed that I was not walking but yes =)

  12.   Alfonso Saavedra Chichon said

    A great trick without a doubt ^^
    Thanks for sharing.

  13.   johnjofer said

    I followed all the steps and did not walk.

  14.   Marcelo said

    The truth is very good = D

  15.   Carlos said

    It didn't work for me either, so I modified the script and got it to work in normal user, that is, when superuser is entered with su, the lines no longer appear. In the end the script was like this:

    function prompt_command {
    if [[$ COLUMNS = ""]];
    then
    return
    fi
    let fillsize = $ {COLUMNS} -9
    fill = »»
    while ["$ fillsize" -gt "0"]
    do
    fill = »- $ {fill}»
    let fillsize = $ {fillsize} -1
    done
    time = `/ bin / date +»% T »`
    echo "$ fill $ hour"
    }
    PROMPT_COMMAND = prompt_command

    It was much shorter, I removed several things and it works for me without problems. I do not modify the variable PS1 but use the one that the system creates by default.
    I do this on a linux arch.

  16.   Let's use Linux said

    Good date!

  17.   Kiarakovalevsky said

    Excellent!

  18.   The busy said

    Very comfortable