Tag: pipe

  • cat + grep + wc and pipe operator

    A UNIX Command $ls 1984 2001 2004 2007 2010 TED-talks-grouped-by-year-in-high-quality.metalink 1990 2002 2005 2008 2011 ted_urls 1998 2003 2006 2009 ted_download.sh $cat TED-talks-grouped-by-year-in-high-quality.metalink | grep -w url | wc -l 980 $ UNIX Explanation This command finds out the number of lines with the word “url” in the file TED*.

  • coreutils: ls –quoting-style=c and | (pipe) symbol

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=432945 output of ls –quoting-style=c is incorrect when filename contains | (pipe) symbol. Steps: mkdir /tmp/bla touch “/tmp/bla/filename with | pipe” ls –quoting-style=c /tmp/bla returns: “filename with \| pipe” thanks, -Mathieu Ref: http://groups.google.com/group/comp.lang.c/browse_thread/thread/0db8070def6a4453