Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am running long builds with lots of data that I need to read through after each build. But I have to start from bottom up to reach to top and it takes lot of time as all the text looks same.

I was just wondering if it is possible that I can leave a command in terminal highlighted after it has been executed so that I can reach to it immediately and start downwards from there. i saw the colors supported by terminal but I think that won't do.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You can configure your PS1 shell variable with tput command so you can distinguish your commands from output:

$ export PS1="$(tput bold)$(tput setb 4)$PS1$(tput sgr0)"

Check 7th tip from http://www.thegeekstuff.com/2008/09/bash-shell-ps1-10-examples-to-make-your-linux-prompt-like-angelina-jolie/

share|improve this answer
    
thanks...that's what I was actually looking for ! –  Rorschach Apr 3 '13 at 11:03
    
I have a (complex..) way in bash to color in blue the commands I type after the prompt, and have the resulting output of the command NOT blue (using trap). But it is probably overkill ^^ –  Olivier Dulac Apr 3 '13 at 11:11
    
after putting it when I am copying something on my terminal than it is overwriting the command prompt completely though the execution is as normal. Well, it will solve my problem but just thought of sharing ! –  Rorschach Apr 3 '13 at 11:14
add comment

There are a few options:

  • Use a terminal multiplexer, and only run that command there. The buffer will be exclusively for the build;
  • Send the output to a file, and read the file after the build;
  • Colour the output, as you say, although I'd consider this last. This will work as long as the build itself doesn't have any colour output:
colcmd() {
    tput setf 3
    "$@"
    tput sgr0
}

The number passed to tput setf defines which colour to use. See your terminal documentation for information about which colour codes correspond to which colours. 3 is usually yellow.

You can invoke coloured commands like so:

colcmd command args
share|improve this answer
    
thanks..it didn't really work for me but your suggestions have been gud learning experience .. –  Rorschach Apr 3 '13 at 11:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.