Skip to content

Instantly share code, notes, and snippets.

@acodega
Created March 1, 2019 14:26
Show Gist options
  • Save acodega/abdcc3b491689e7cc32d2f29fb2bc4aa to your computer and use it in GitHub Desktop.
Save acodega/abdcc3b491689e7cc32d2f29fb2bc4aa to your computer and use it in GitHub Desktop.
in macOS Terminal
# Output to a file, overwriting it if it exists
ls > ~/Desktop/file.txt
# Output to a file, appending to it if it exists
ls >> ~/Desktop/file.txt
# Pipe output to an application, the "-fe" tag will instruct to read the piped input and open it as a new unsaved file
ls | open -fe
# Pipe output to the Mac's clipboard
ls | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment