1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 23:28:02 +00:00

Add Cat A File With Line Numbers as a zsh til.

This commit is contained in:
jbranchaud
2015-05-15 08:20:30 -05:00
parent 89815d9c2a
commit e0d3f9f225
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# Cat A File With Line Numbers
You can quickly view a file using `cat`
```
$ cat Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use postgresql as the database for Active Record
gem 'pg'
```
With the `-n` flag I can view that file with line numbers
```
$ cat -n Gemfile
1 source 'https://rubygems.org'
2
3
4 # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5 gem 'rails', '4.2.0'
6 # Use postgresql as the database for Active Record
7 gem 'pg'
```