Mac OS — pbcopy with heredoc mode ( input new line directly without escape character ) "heredoc mode" is just my naming. $ cat | pbcopy Alice Bob Carol Ctrl+d and finish Check $ pbpaste Alice Bob Carol Version bash 4.2 Mac OSX High Sierra Links ccc/pbmake at 9781f78fb00f7b2b7ae9398ba9dc285e7ebc4552 · YumaInaura/ccc Qiita—Japanese Medium—imported