zl程序教程

您现在的位置是:首页 >  其它

当前栏目

[Tools] Create Files in the Terminal from the Clipboard with PBPaste

in The with from create tools Files terminal
2023-09-14 09:00:47 时间

You'll often find yourself going through a tutorial where you need to copy some code from a webpage and create a file and paste the contents onto your local machine. Your terminal has a useful tool called "pbpaste" which allows you to paste contents into a file using a standard redirect.

 

Use:

pbpaste > ./index.html

 

It is built-in with Mac

 

You can also use `pbcopy`, checkout https://langui.sh/2010/11/14/pbpaste-pbcopy-in-mac-os-x-or-terminal-clipboard-fun/

echo 'Hello World!' | pbcopy