Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bat: add page #2297

Merged
merged 2 commits into from
Sep 6, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions pages/common/bat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# bat

> Print and concatenate files. A cat(1) clone with syntax highlighting and Git integration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the second sentence to a subheading. Wrap cat within backticks and remove (1).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure :)


- Print the contents of a file to the standard output:

`bat {{file}}`

- Concatenate several files into the target file:

`bat {{file1}} {{file2}} > {{target_file}}`

- Append several files into the target file:

`bat {{file1}} {{file2}} >> {{target_file}}`

- Number all output lines:

`bat -n {{file}}`

- Syntax highlight a json file:
mfrw marked this conversation as resolved.
Show resolved Hide resolved

`bat --language json {{file.json}}`