Mac provides the command line for copy and paste, useful for some tasks.
reference link:http://osxdaily.com/2007/03/05/manipulating-the-clipboard-from-the-command-line/
Copy
copy the content of the file
1 | pbcopy < file.txt |
Now the content is in clipboard, ready to be pasted.
you can use pipe to combine command such as
find
,grep
,awk
andcut
to filter and augment data.
for example:
1 | echo "this is a demo" | pbcopy |
Paste
Simply run this command:
1 | pbpaste |
Redirect content to a file:
1 | pbpaste > file.txt |
1 | pbpaste | grep "xxx" |