I have a mini-system with only limited number of binaries (bash,cp,cat,sed, ...). I don't have tail command, and I am wondering if I could emulate tail functionality with sedcat foo.txt | tail -n 10I know that I can print lines 1-10 with sed cat foo.txt | sed -n '1,10p', but how would I print the last 10 lines?
emulate tail with sed
bash;sed
You could do something like this:sed -e :a -e '$q;N;11,$D;ba'