bat command to copy files

Created on 8 Sep 2018  路  2Comments  路  Source: sharkdp/bat

One of the main uses of cat for me was to print output of files, so that I can copy paste easily. Is such a feature supported in bat?

If no, why not develop it :smile:

question

Most helpful comment

It actually is supported! :)

If you want bat to just print out the file contents without the sidebar and pager, you can use -p --wrap=never --paging=never to have it only output the syntax-highlighted text. In the next release, you won't even need to use --wrap (#291).


If you're looking to copy text off of a local terminal (not SSH), there's an even easier way that you might find useful:

macOS:

bat file | pbcopy

Linux:

bat file | xclip

All 2 comments

It actually is supported! :)

If you want bat to just print out the file contents without the sidebar and pager, you can use -p --wrap=never --paging=never to have it only output the syntax-highlighted text. In the next release, you won't even need to use --wrap (#291).


If you're looking to copy text off of a local terminal (not SSH), there's an even easier way that you might find useful:

macOS:

bat file | pbcopy

Linux:

bat file | xclip

it would be better I close this issue now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidarmstronglewis picture davidarmstronglewis  路  30Comments

mre picture mre  路  21Comments

itkovian picture itkovian  路  31Comments

vvuk picture vvuk  路  17Comments

septatrix picture septatrix  路  20Comments