Skip to content

Instantly share code, notes, and snippets.

@samdoidge
Last active September 6, 2016 08:54
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 samdoidge/f375aee2cd72dbc22b3fca3f676d57c7 to your computer and use it in GitHub Desktop.
Save samdoidge/f375aee2cd72dbc22b3fca3f676d57c7 to your computer and use it in GitHub Desktop.
Recursively loop through a direcctory, cutting files down to 11 lines maximum - creating a new file of the same name in a Test folder.
for file in *; do head -n 11 "$file" > ../Test/"$file"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment