Last active
September 29, 2018 08:34
-
-
Save thefiend/4eee708af8e18a9c40ffba24420fe6ca to your computer and use it in GitHub Desktop.
Bash script to copy first line from all the text files in the current folder and save it as results.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Bash script to copy first line from all the text files | |
# in the current folder and save it as results.txt | |
# | |
rm results.txt; ls *.txt | xargs -I {} head -1 {} >> results.txt | |
echo "===== Results ====="; | |
cat results.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment