Skip to content

Instantly share code, notes, and snippets.

@loretoparisi
Created November 3, 2017 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loretoparisi/2fd376722968576f5abd448ffb1ef3b9 to your computer and use it in GitHub Desktop.
Save loretoparisi/2fd376722968576f5abd448ffb1ef3b9 to your computer and use it in GitHub Desktop.
Bash WC pipe file list
#!/bin/bash
find $1 -maxdepth 1 -type f -print0 | xargs -0 wc | awk '{print $1 "\t" $4}'
@loretoparisi
Copy link
Author

Example:

$ find /root/*.csv -maxdepth 1 -type f -print0 | xargs -0 wc | awk '{print $1 "\t" $4}'
7017	/root/sample_1_.csv
1010	/root/sample_2.csv
1243	/root/sample_3.csv

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