0

Let's say I have this commandline:

~/development/company/folder:

and i run this command

./gradlew appRun

then my command line looks like this:

~/development/company/folder: ./gradlew appRun

Now, if there is an error and there is a bunch of output, then i need to scroll up and, because unix just formats everything the same, it's real easy to get all the lines and commands mixed up.

What I would like is for each command I enter to be like, bright red or bold or something, and all the output from that to be white or whatever it currently is.

How do i do that?

4
  • 1
    Relating unix.stackexchange.com/questions/20803/…, for bash Commented Jan 28, 2020 at 16:15
  • @Jeff yeh, this is a duplicate Commented Jan 28, 2020 at 16:26
  • It is a quite different answer for the Z shell, note. Commented Jan 28, 2020 at 19:53
  • 1
    Try liquidprompt, it only changes the prompts, but the changed prompts are conspicuous that a command's output is usually distinct from its invocation. Commented Feb 1, 2020 at 16:12

1 Answer 1

-1

It's not that UNIX formats everything the same. Any command you run can also write formatted output.

When you run for instance ./gradlew appRun, just redirect the output (both the error stream and the standard output stream to a file)

./gradlew appRun &> mylogfile.log
1
  • Question: How do I find the needles in my haystack?  Answer: Here’s a tool that will move all your hay to another farm, leaving the needles behind. Then you’ll have no trouble seeing the needles, as they’ll be the only things there. (Of course you’ll have to go to the other farm to look at the hay.)    :-(    ⁠ Commented Jan 29, 2020 at 19:12

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.