Skip to content

Instantly share code, notes, and snippets.

@danielpodrazka
Created March 28, 2023 22:36
Show Gist options
  • Save danielpodrazka/c37be6a4380395362306734db0a3d1cd to your computer and use it in GitHub Desktop.
Save danielpodrazka/c37be6a4380395362306734db0a3d1cd to your computer and use it in GitHub Desktop.
Bash one-liner that reads content of the files in current directory with their respective filename on top of each file and saves them in clipboard. Skips directories.
# sudo apt-get install xclip
for file in *; do if [ -f "$file" ]; then echo "=============$file============="; cat "$file"; echo; fi; done | xclip -selection clipboard
@danielpodrazka
Copy link
Author

Generated with GPT4.
Prompt:

Bash one-liner that reads content of the files in current directory with their respective filename on top of each file and saves them in clipboard. Skip any names that are directories'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment