Skip to content

Instantly share code, notes, and snippets.

@tbobm
Last active October 6, 2017 09:52
Show Gist options
  • Save tbobm/22e1819f8acc4d9717714794c886c6b5 to your computer and use it in GitHub Desktop.
Save tbobm/22e1819f8acc4d9717714794c886c6b5 to your computer and use it in GitHub Desktop.
cat file1.txt file2.txt file3.txt > merged.txt # Combine the 3 files into one
sort merged.txt > combined.txt # Sort the different lines
head -n 2 combined.txt # Show the first 2 lines to stdout
# Onliner:
# cat file1.txt file2.txt file3.txt | sort | tee combined.txt | head -n 2
tr '[:lower:]' '[:upper:]' < file1.txt | sort -r | uniq
# Lowercase to Uppercase
# < File input
# Sort in reverse order
# Remove duplicates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment