Copy & Paste in Terminal

Mac provides the command line for copy and paste, useful for some tasks.docker

refer link:http://osxdaily.com/2007/03/05/manipulating-the-clipboard-from-the-command-line/bash

Copy

copy the content of the fileide

pbcopy < file.txt

now the content is in clipboard, ready to be pastedthis

you can use pipe to combine command such as find,grep, awk and cut to filter and aggregate data.code

for example:ip

docker images | grep "iis-" | pbcopy
echo "this is a demo" | pbcopy

Paste

pbpaste

redirect content to a fileget

pbpaste > file.txt
pbpaste | grep "xxx"
相關文章
相關標籤/搜索