• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Search

lines

Display certain lines in a file

March 23, 2023

This will display only lines 40-50 in a file called lines.txt.

$ cat lines.txt | head -n 50 | tail -n 10

$ cat lines.txt | head -n 50 | tail -n 10

For lines 90-100.

$ cat lines.txt | head -n 100 | tail -n 10

$ cat lines.txt | head -n 100 | tail -n 10

and so on.

Filed Under: Linux Tagged With: cat, display, head, lines, tail

History Without Line Numbers

September 8, 2022

Here’s how to display history without the line numbers.

history -w /dev/stdout

history -w /dev/stdout

Result

cd /etc/httpd/conf
view httpd.conf 
vim wiki.conf 
vim ssl.conf

cd /etc/httpd/conf view httpd.conf vim wiki.conf vim ssl.conf

Filed Under: Linux Tagged With: history, lines, list, without

  • Home
  • About
  • Search

Copyright © 2023