Unix - Pipes?

Discussion in 'Linux Discussion' started by ymcabookwormcat, May 5, 2008.

  1. Describe the Unix philosophy that deals with pipes and why we have pipes.
  2. Similar Threads: Unix Pipes
    Forum Title Date
    Linux Discussion How do I check if my linux, or unix, box is 32bit of 64bit through the terminal? Jul 3, 2008
    Linux Discussion How do I run multiple commands on a Unix/Linux system without a GUI? Jul 3, 2008
    Linux Discussion unix help!!!!!? Jun 18, 2008
    Linux Discussion Unix/programming question? Jun 18, 2008
    Linux Discussion free UNIX servers? Jun 3, 2008
    Linux Discussion Installing Unix with Windows XP? Jun 1, 2008
    Linux Discussion Drivers for Unix? May 30, 2008
    Linux Discussion What is recursive in Linux/Unix? May 30, 2008
    Linux Discussion Can we perform mathematical operations on UNIX dates? May 30, 2008
    Linux Discussion i need codings for unix commands in c language ...please help... an urgent task...? May 29, 2008

  3. row_o Guest

    The pipe (|) is a great symbol in the linux/unix world.
    It basically sends the output of one command to another command but as its input.
    An example would be sending the output of a long list command into a perl command line script

    ls -la | perl -pe 's/one/two/g'
  4. M?l? Guest

    Adding further:-

    Pipes allows you to use simple unix commands together to make more complex/powerful programs

    Like above program
    ls -la | grep abc | lpr
    this allows to list all files using ls command, pass to filter (grep) for filename having name "abc" and send it to print.

    So according to unix philosophy, command should be mainly used for one purpose/task like command ls (for listing files),grep (filter result) ,lpr (for printing) etc but piping allows us to build more complex program/commands using this building blocks of unix commands (without writing new program codes for doing this job).

    Try doing same things in microsoft Windows and you have to bang your head even for doing simple command like above. Though windows is catching up by allowing use of limited scripting language and commands but still way behind.

Share This Page