Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove carriage return from windows file and create new file. Exclude some files (from a directory) and concatenate into a one big file.
#!/bin/bash
# Remove carriage return from windows file <CR> and createa a new file
tr -d '\015' < windows_file > another_file
# Exclude some files prior concatenation
ls | sort | grep -v -E "(file1|file2|...|fileN)" | xargs cat > large_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment