Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Highlighting my terminal commands?

  • 22-07-2009 9:19pm
    #1
    Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭


    In Ubuntu 804 Is it possible to do something whereby my terminal commands are highlighted in the sea of information that usually follows? Having them in bold or ideally a different background color would help me a lot when I have to backtrack several pages to find the top of the command. It seems like something someone somewhere already thought of and implemented?


Comments

  • Closed Accounts Posts: 3,762 ✭✭✭turgon


    Em well I now that if you typing a new command you just press the up button and it enters your previous commands in the prompt.

    So to redo the last command just enter up once and then enter.

    Thats in GNOME at least (Ubuntu 9.04), but I dont know if that will satisfy what you want.


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    It's less to do with finding the last command and more to do with finding where the results of the last command start! If I type in something that returns a page or 2 of feedback lines (like a grep or something) then I want to scroll back up the window and find the first line of that feedback section:
    grep -H -r "string" folder/
    folder/file1: line
    folder/file2: line
    folder/file3: line
    folder/file4: line
    folder/file5: line
    etc
    
    . So if I'm interested in the first result, I've got to scroll back up the terminal window, but if this is the fifth or fifteenth time I've tried this search (as it normally is), I can't immediately where the previous search ended and this one started.

    Does that make sense?


  • Closed Accounts Posts: 1,377 ✭✭✭An Fear Aniar


    You could pipe it to "more"

    command | more

    Might be easier to scroll through the results.

    .


  • Closed Accounts Posts: 12,807 ✭✭✭✭Orion


    Occams razor. When I'm doing something like that on VMS or Linux I just hit enter 7 or 8 times to leave blank space. Then you can just scroll up and you find those blank lines easily.


  • Registered Users, Registered Users 2 Posts: 85 ✭✭StiLL-TrAiNinG


    Macros42 wrote: »
    Occams razor. When I'm doing something like that on VMS or Linux I just hit enter 7 or 8 times to leave blank space. Then you can just scroll up and you find those blank lines easily.

    I usually do something similar to this, using clear a few times.

    Another solution might be to add some colour to your prompt, something like:
    http://www.wiredrevolution.com/bash-programming/customize-the-bash-ps1-command-prompt might be useful in making it more distinct.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    Macros42 wrote: »
    Occams razor. When I'm doing something like that on VMS or Linux I just hit enter 7 or 8 times to leave blank space. Then you can just scroll up and you find those blank lines easily.

    Yeah, that's what I've been doing aswell except I don't remember to do it until the fourth time I've run the same command :)

    Oh well, I was kinda hoping there was a simple way to do it

    ETA: That link looks interesting Still-Training, I'll take a closer look later.


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    You could pipe it to "more"

    command | more

    Might be easier to scroll through the results.

    .

    More is for babies. "less" is where it's at.

    Try ctrl+l (this clears the current shell screen), then use:

    command | less

    Less allows you to move forward and backwards using vi style shortcuts (shift + G moves to the end etc) and also supports pattern matching in the vi style (hit / then type in the pattern you want to match, then n for the next instance, etc.).


  • Closed Accounts Posts: 1,377 ✭✭✭An Fear Aniar


    Khannie wrote: »
    More is for babies. "less" is where it's at.

    Lol! You're more or less right I think.:)

    .


  • Registered Users, Registered Users 2 Posts: 3,721 ✭✭✭E39MSport


    I use this in my profile. Might help.

    # General settings...
    HISTSIZE=500

    # Define screen attributes and prompt...
    TERM=vt100
    set +a
    tput init
    bold=`tput -T$TERM bold`
    rev=`tput -T$TERM rev`
    underline=`tput -T$TERM smul`
    standout=`tput -T$TERM smso`
    off=`tput -T$TERM sgr0`
    set -a
    PS1='${bold}!${off} ${underline}$PWD${off}: '


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    E39MSport wrote: »
    I use this in my profile. Might help.
    Sorry, but of a noob here, where exactly do you put this information?


  • Advertisement
  • Closed Accounts Posts: 12,807 ✭✭✭✭Orion


    in .bashrc in your home directory. It's a standard text file.


  • Registered Users, Registered Users 2 Posts: 3,721 ✭✭✭E39MSport


    corblimey wrote: »
    Sorry, but of a noob here, where exactly do you put this information?

    Mine's in my .profile in my home directory.


Advertisement