My situation: I have a file that I need to copy the entire contents of it.
In the terminal, I type:
cat file.txt, then copy the terminal output.
The easy solution:
pbcopy < file.txt
And now the contents are saved in my clipboard.
Then, if I had to paste those contents somewhere else, I would use vim to create a file and paste those contents in there, and if I was lucky, I wouldn't have to restart my computer from getting stuck in vim.
Instead, the easy solution:
pbpaste > file-two.txt
And now, all of the contents from my clipboard are saved in file-two.txt!
What other bash commands have you found useful? Let me know in the comments!