Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: cmd line too long

  1. #1
    Join Date
    Dec 2006
    Location
    crossville,tenn
    Beans
    86
    Distro
    Ubuntu 12.04 Precise Pangolin

    cmd line too long

    HI
    So how do I see the entire cmd if the cmd is very long?
    All I see is about the last half on my screen. I'm sure the full cmd is ready to invoke,but I can't see the full cmd. Thank you
    Forever Begins.....Now

  2. #2
    Join Date
    Dec 2010
    Location
    Fukuoka, Japan
    Beans
    1,064
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: cmd line too long

    It depedns on the terminal youre using. You can probably either scroll over using the mouse or the right arrow key.

  3. #3
    Join Date
    Feb 2012
    Location
    Athens, Alabama
    Beans
    611
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: cmd line too long

    Interesting question you have here because as I write this I called up my terminal and it automatically wraps. Could you be a little more specific exactly as to what situation you are referring to? Is it when you are trying to copy a Command Line input?

  4. #4

    Re: cmd line too long

    use the "\" character to "break up" long c-li commands...

    example:
    Code:
    ec2-describe-snapshots -K /home/jj/.ssh/domain.com/pem/pk-OOPQ5MLZTVMPLIT63VC6DXGCNX6SFPH3.pem -C /home/jj/.ssh/domain.compem/cert-OOPQ5MLZTVMPLIT63VC6DXGCNX6SFPH3.pem --region us-west-1 | \egrep "vol-ad4f72ce|vol-794f721a|vol-654f7206" | sort -r -k 5
    could also be entered as:
    Code:
    ec2-describe-snapshots -K /home/jj/.ssh/domain.com/pem/pk-OOPQ5MLZTVMPLIT63VC6DXGCNX6SFPH3.pem \
    -C /home/jj/.ssh/domain.com/pem/cert-OOPQ5MLZTVMPLIT63VC6DXGCNX6SFPH3.pem \
    --region us-west-1 | \egrep "vol-ad4f72ce|vol-794f721a|vol-654f7206" | sort -r -k 5
    Hope that helps...
    Windows assumes the user is an idiot.
    Linux demands proof.

  5. #5
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: cmd line too long

    Shift-PageUp, Shift-PageDown will scroll up and down in a console or terminal. Shift-End will take you back to the prompt.

  6. #6
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: cmd line too long

    To shorten commands you can try pre-defining long patterns as environment vars

    e.g. in example ec2-describe-snapshots command above

    aws_snapshots = "ec2-describe-snapshots -K"
    aws_pk = "/home/jj/.ssh/domain.com/pem/pk-OOPQ5MLZTVMPLIT63VC6DXGCNX6SFPH3.pem"
    aws_cert = "/home/jj/.ssh/domain.com/pem/cert-OOPQ5MLZTVMPLIT63VC6DXGCNX6SFPH3.pem"
    aws_region = "--region us-west-1"
    aws_vol = "vol-ad4f72ce|vol-794f721a|vol-654f7206"
    aws_sort = "sort -r -k 5"


    then the shorter command becomes

    $aws_snapshots $aws_pk $aws_cert $aws_region | \egrep $aws_vol | $aws_sort


    Or you could bundle vars together into shorter command strings.
    Last edited by dragonfly41; September 22nd, 2012 at 10:37 AM. Reason: noticed typo error .. I had used % instead of $ in short command

  7. #7
    Join Date
    Dec 2006
    Location
    crossville,tenn
    Beans
    86
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: cmd line too long

    Quote Originally Posted by daslinkard View Post
    Interesting question you have here because as I write this I called up my terminal and it automatically wraps. Could you be a little more specific exactly as to what situation you are referring to? Is it when you are trying to copy a Command Line input?
    Daslinkard;
    For instance; I copied your reply , 47 words , pasted it into my command line. This is what I get :
    "re specific exactly as to what situation you are referring to? Is it when you are trying to copy a Command Line input?^Cld you be a little mo "
    Obviously not completely what you said. I don't know how to fix this problem. Maybe a plug-in? Any suggestions? Thank you
    Forever Begins.....Now

  8. #8
    Join Date
    Jan 2008
    Location
    Midwest-USA
    Beans
    134
    Distro
    Ubuntu

    Re: cmd line too long

    I am glad somebody posted this because i have been fighting the same problem for 3 days....I can not paste anything longer than 47 lines in my terminal....If i paste 50 lines,,,,it leaves 3 out,,etc....I have even re-installed ffmpeg,,,,changed the code around,,,etc....It does not matter if my terminal is full screen or smaller....Same limitations on 47 lines of code....Any input would be great....FYI,,,,the codes i am using now worked before with no issues....Thanks....

    Release 12.04 (precise) 64-bit
    Kernel Linux 3.2.0-31-generic
    GNOME 3.4.2
    Last edited by timsdeepsky; October 8th, 2012 at 12:53 AM.
    Deepsky....I woke up one day feeling a little darker than usual....My inevitable midlife search for meaning....http://timcline.org/

  9. #9
    Join Date
    Jan 2008
    Location
    Midwest-USA
    Beans
    134
    Distro
    Ubuntu

    Re: cmd line too long

    Seems i can put the same long code in a bash script and call it from terminal and the script runs perfect....But putting the code in the terminal itself cuts off part of the code....
    Deepsky....I woke up one day feeling a little darker than usual....My inevitable midlife search for meaning....http://timcline.org/

  10. #10
    Join Date
    Dec 2006
    Location
    crossville,tenn
    Beans
    86
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: cmd line too long

    Quote Originally Posted by timsdeepsky View Post
    I am glad somebody posted this because i have been fighting the same problem for 3 days....I can not paste anything longer than 47 lines in my terminal....If i paste 50 lines,,,,it leaves 3 out,,etc....I have even re-installed ffmpeg,,,,changed the code around,,,etc....It does not matter if my terminal is full screen or smaller....Same limitations on 47 lines of code....Any input would be great....FYI,,,,the codes i am using now worked before with no issues....Thanks....

    Release 12.04 (precise) 64-bit
    Kernel Linux 3.2.0-31-generic
    GNOME 3.4.2
    Ok It all has to do with the prompt code.
    for example : export PS1="\[\e[32;1m\]\w> \[\e[0m\]" will give you
    ~> (in green) , with the ability to word wrap. It does this with the
    \[ and \] in the code. See this url http://www.ibm.com/developerworks/li.../l-tip-prompt/. Hope it helps.
    Forever Begins.....Now

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •