# How to display certain line of file only using head or tail in 1 command?

**URL:** <https://community.unix.com/t/how-to-display-certain-line-of-file-only-using-head-or-tail-in-1-command/376419>\
**Category:** Homework & Coursework Questions\
**Created:** [October 11, 2019, 1:05am UTC](https://community.unix.com/t/how-to-display-certain-line-of-file-only-using-head-or-tail-in-1-command/376419 "2019-10-11T01:05:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![forzatekk](https://community.unix.com/letter_avatar/forzatekk/32/5_5575768a8748004e209b776fc1b2916d.png) [@forzatekk](https://community.unix.com/u/forzatekk)\
**Post date:** [October 11, 2019, 1:05am UTC](https://community.unix.com/t/how-to-display-certain-line-of-file-only-using-head-or-tail-in-1-command/376419/1 "2019-10-11T01:05:34Z")

</div>

First month learning about the Linux terminal and it has been a challenge yet fun so far. We're learning by using a gameshell. I'm trying to display a certain line ( only allowed 1 command ) from a file only using the head or tail. I'm pretty about this answer:

```nohighlight
head -23 history.txt | tail -1

```

However, it is not the good answer once I complete the gash check.

Any advice will help !

---

<div class="post-metadata">

**Author:** ![vbe](https://community.unix.com/user_avatar/community.unix.com/vbe/32/266_2.png) [@vbe](https://community.unix.com/u/vbe)\
**Post date:** [October 11, 2019, 4:36am UTC](https://community.unix.com/t/how-to-display-certain-line-of-file-only-using-head-or-tail-in-1-command/376419/2 "2019-10-11T04:36:13Z")

</div>

Welcome on board..

We have a forum for all to do with class work etc... please post in that forum  
Thread moved
