Add xclip information to commands.md

This commit is contained in:
Donovan Glover 2017-12-11 23:46:54 -05:00
parent 30c8eebf6b
commit 75788ceb84
No known key found for this signature in database
GPG Key ID: 8FC5F7D90A5D8F4D

View File

@ -123,6 +123,21 @@ Note that you can run multiple servers on different ports through Jekyll and oth
- The directory `<dir>` must exist before you can write to it
- Note that all `pdflatex` options must come before specifying `<file>`
### Xclip
**Using the X clipboard**
- Copy the result of any command to the X clipboard: `command | xclip`
- This is particularly useful for commands like `fzf`, where you want to search for a specific file then do something with it
- Paste the results from the X clipboard: `xclip -o`
**Using the global clipboard**
- Copy a file to the global clipboard: `xclip -sel clip < filename.txt` **OR** `cat filename.txt | xclip -sel clip`
- Note that `-sel` is shorthand for `-selection` and that `clip` is shorthand for `clipboard`
- Copy the result of any command to the global clipboard: `command | xclip -sel clip`
- Paste the results from the global clipboard: `xclip -o -sel clip`
### Dealing with Archives
- Zip all files in a directotry: `zip -r <zip_name> <directory>`