From ee91d18bda4e8c047f39e31b88fc0c272e5ec87d Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Tue, 17 Dec 2019 20:43:40 -0600 Subject: [PATCH] Add Print Out Files In Reverse as a unix til --- README.md | 3 ++- unix/print-out-files-in-reverse.md | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 unix/print-out-files-in-reverse.md diff --git a/README.md b/README.md index e889db7..862b4d7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_891 TILs and counting..._ +_892 TILs and counting..._ --- @@ -828,6 +828,7 @@ _891 TILs and counting..._ - [Partial String Matching In Bash Scripts](unix/partial-string-matching-in-bash-scripts.md) - [PID Of The Current Shell](unix/pid-of-the-current-shell.md) - [Print A Range Of Lines For A File With Bat](unix/print-a-range-of-lines-for-a-file-with-bat.md) +- [Print Out Files In Reverse](unix/print-out-files-in-reverse.md) - [Repeat Yourself](unix/repeat-yourself.md) - [Saying Yes](unix/saying-yes.md) - [Search Files Specific To A Language](unix/search-files-specific-to-a-language.md) diff --git a/unix/print-out-files-in-reverse.md b/unix/print-out-files-in-reverse.md new file mode 100644 index 0000000..24d4e11 --- /dev/null +++ b/unix/print-out-files-in-reverse.md @@ -0,0 +1,19 @@ +# Print Out Files In Reverse + +If you're familiar with `cat` -- the command you might use to print out a file +in the terminal -- then you may appreciate a similar command: `tac`. + +With `tac` you can + +> Write each FILE to standard output, last line first. + +Notice that `tac` is `cat` spelled in reverse. That's what it does with your +files, prints them out in reverse. + +Give it a try just as you'd use `cat`: + +```bash +$ tac README.md +``` + +See `man tac` for more details.