Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hadrienblanc/5d4a9ce36ec2d536d37ae69597ebeeb4 to your computer and use it in GitHub Desktop.
Save hadrienblanc/5d4a9ce36ec2d536d37ae69597ebeeb4 to your computer and use it in GitHub Desktop.
Loop through each file in the directory
# Loop through each file in the directory
for file in *; do
if [ -f "$file" ]; then # Check if it's a file (and not a directory)
echo "Filename: $file" # Print the name of the file
cat "$file" # Print the contents of the file
echo # Print a newline for better readability between files
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment