Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Commit 82a0d3e

Browse files
changed sample.txt content
1 parent 63af5d2 commit 82a0d3e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

tail_less_cat_head.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -407,13 +407,13 @@ Consider this sample file, with line numbers prefixed
407407

408408
```bash
409409
$ cat sample.txt
410-
1) Hello World!
410+
1) Hello World
411411
2)
412412
3) Good day
413-
4) How do you do?
413+
4) How are you
414414
5)
415-
6) Just do it
416-
7) Believe it!
415+
6) Just do-it
416+
7) Believe it
417417
8)
418418
9) Today is sunny
419419
10) Not a bit funny
@@ -428,8 +428,8 @@ $ cat sample.txt
428428

429429
```bash
430430
$ tail sample.txt
431-
6) Just do it
432-
7) Believe it!
431+
6) Just do-it
432+
7) Believe it
433433
8)
434434
9) Today is sunny
435435
10) Not a bit funny
@@ -556,13 +556,13 @@ DESCRIPTION
556556

557557
```bash
558558
$ head sample.txt
559-
1) Hello World!
559+
1) Hello World
560560
2)
561561
3) Good day
562-
4) How do you do?
562+
4) How are you
563563
5)
564-
6) Just do it
565-
7) Believe it!
564+
6) Just do-it
565+
7) Believe it
566566
8)
567567
9) Today is sunny
568568
10) Not a bit funny
@@ -572,29 +572,29 @@ $ head sample.txt
572572

573573
```bash
574574
$ head -n3 sample.txt
575-
1) Hello World!
575+
1) Hello World
576576
2)
577577
3) Good day
578578

579579
$ # some versions of head allow to skip explicit n character
580580
$ head -4 sample.txt
581-
1) Hello World!
581+
1) Hello World
582582
2)
583583
3) Good day
584-
4) How do you do?
584+
4) How are you
585585
```
586586

587587
* when number is prefixed with `-` sign, all lines are fetched except those many lines to end of file
588588

589589
```bash
590590
$ # except last 9 lines of file
591591
$ head -n -9 sample.txt
592-
1) Hello World!
592+
1) Hello World
593593
2)
594594
3) Good day
595-
4) How do you do?
595+
4) How are you
596596
5)
597-
6) Just do it
597+
6) Just do-it
598598

599599
$ # except last 2 lines
600600
$ seq 13 17 | head -n -2
@@ -634,7 +634,7 @@ Warning: something went wrong
634634
more blah
635635

636636
==> sample.txt <==
637-
1) Hello World!
637+
1) Hello World
638638
2)
639639
3) Good day
640640

@@ -643,7 +643,7 @@ $ head -q -n3 report.log sample.txt
643643
blah blah
644644
Warning: something went wrong
645645
more blah
646-
1) Hello World!
646+
1) Hello World
647647
2)
648648
3) Good day
649649
```
@@ -661,8 +661,8 @@ $ head -n11 sample.txt | tail -n3
661661
11) No doubt you like it too
662662

663663
$ tail sample.txt | head -n2
664-
6) Just do it
665-
7) Believe it!
664+
6) Just do-it
665+
7) Believe it
666666
```
667667

668668
<br>

0 commit comments

Comments
 (0)