79153929

Date: 2024-11-04 00:51:51
Score: 0.5
Natty:
Report link

By using a combination of tail and head you should achieve it

Use head by getting all but the X last line of a file named file.txt .

head -n -X file.txt

It should work for .bash_history too and this could do the trick ?

head -n -X .bash_history > .bash_history

Use tail to keep the Y last line of a file named file.txt .

tail -n Y file.txt

you could combine this to have a script that create 2 temp files then merge them to .bash_history

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Antoine O