Skip to content

Instantly share code, notes, and snippets.

@pythonicrubyist
Created October 30, 2013 16:30
Show Gist options
  • Save pythonicrubyist/7235695 to your computer and use it in GitHub Desktop.
Save pythonicrubyist/7235695 to your computer and use it in GitHub Desktop.
Handy Linux Commands
ls *.txt | wc -l | tee /dev/tty count.txt
@pythonicrubyist
Copy link
Author

In the above example, the ls command would list all .txt files in the current directory, take a word count (wc) by the amount of lines (-l) and the output displayed to the /dev/tty (terminal) will be sent to the count.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment