Copy a file's contents in one line
Published on 26 Mar 2020
If you ever wanted a quick and easy to get the contents of a file:
Shell Script
#!/usr/bin/env sh
cat $1 | xclip -selection c
Directly on the commandline, for a file called hello_world.txt
cat hello_world.txt | xclip -selection c
all tags
activerecord android annoyances api apt arch array artix atom az3w backend bash blog browser bug callback career cli cloud code coding config configuration cp crud css database db design devops django email erp filter fugitive gif gist git gnome grep hebrew http ide isbn-fetcher iso javascript job search js kanban kanban\ kindle koans linux logger manjaro map markdown microservices mobi mtp neovim nodejs packages pastbin patch post python rails reduce refactoring rest routes rspec ruby scripting security sed shell sql string_replacement study tdd terminal testing version_control vim walkthrough workflow