tail command help

Hi does anyone know how to create a file using the tail command? My book has this file I need to create and it says to use the tail command and that it is possible but I have no idea. Thanks.

Maybe:

tail -n 10000 infile > outputFile
# Or
tail -f infile | tee outputFile

ok but where do i type the contents of the file? sorry i am a newbie to this.

---------- Post updated at 02:50 PM ---------- Previous update was at 02:04 PM ----------

So do I need to create the file using cat and save it. Then use the tail command to display it to the output file? I cant find anyway to actually create and edit the file using the tail command right?

tail is not used for creating files... So, NO you can't use tail for creating files at least not in an ethical way!...

man tail
tail - output the last part of files

--ahamed

You can create the file with tail:

tail > FILENAME

Start typing and press ctrl-D when you are finished. The last ten lines you entered (or all if you typed less than ten) will be in FILENAME.

1 Like