Results 1 to 5 of 5

Thread: entering a vertical straight line in the terminal

  1. #1
    Join Date
    Aug 2013
    Beans
    14

    entering a vertical straight line in the terminal

    I am trying to enter a command into the terminal, and I'm unsure about a straight line in the command. I don't know if it is actually supposed to be entered or if it's there to show a break or something. It is the line between "zero" and "nc" in the following. host-a$ cat /dev/zero | nc -l -p 12345 I know this is a complete noob question, so thanks for the help.
    Last edited by philinux; August 17th, 2013 at 02:23 PM. Reason: added vertical to title

  2. #2
    Join Date
    Jun 2007
    Location
    Porirua, New Zealand
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: entering a straight line in the terminal

    The | symbol is sometimes known as a "pipe" symbol. In the example you give, it's part of the command sequence. It roughly translates to "Take the output from one command and use it as input to the next command."
    Forum DOs and DON'Ts
    Please use CODE tags - Including your email address in a post is not recommended
    Never assume that the information provided by Dr Google is up-to-date or relevant.

  3. #3
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    pipe

    The straight line is called a pipe. It takes output from the first program and uses it as input for the second. However, the example using cat you have is a little strange.

    Code:
    ls /usr/bin
    ls /usr/bin | less
    
    ls /usr/bin/*grep* 
    ls /usr/bin/*grep* | wc -l
    You can hook as many programs together in that way as you want.

    Code:
    apt-cache search xml 
    apt-cache search xml | sort 
    apt-cache search xml | sort | less
    You can also use < and > and >> to redirect IO.

  4. #4
    Join Date
    Jan 2010
    Location
    Hyperborea
    Beans
    2,017
    Distro
    Ubuntu 15.10 Wily Werewolf

    Re: entering a straight line in the terminal

    Also on my laptop the only way to get the "pipe" is with alt gr + |
    Alt gr is the key to the right of the spacebar.
    If I don't use it then I get ` or ¬

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

    Re: entering a vertical straight line in the terminal

    If you're using a US keyboard, Shift-\ should give you a pipe.

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
  •