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

issmirnov picture issmirnov  路  3Comments

antoinemadec picture antoinemadec  路  3Comments

yannallain picture yannallain  路  3Comments

yum-feng picture yum-feng  路  3Comments

tbsvttr picture tbsvttr  路  3Comments