macos terminal copy to a file code example Example: mac copy file to clipboard terminal $ pbcopy < file.txt