out of space on /root

Xen list at xenhideout.nl
Mon Mar 6 17:16:37 UTC 2017


Oliver Grawert schreef op 06-03-2017 15:23:
> hi,
> On Mo, 2017-03-06 at 14:10 +0100, Xen wrote:
>> 
>> Simos Xenitellis schreef op 06-03-2017 11:57:
>> 
>> >
>> > >
>> > > In general commands such as:
>> > >
>> > > cat "file" | tail -n 500
>> > >
>> > > will get you the last 500 lines.
>> >
>> > Preferably, you can write straight ahead
>> >
>> > tail -100 /var/log/syslog
>> 
>> Yes, that's what I said. But his files are no longer in /var/log, so 
>> that doesn't help.
>> 
> 
> no, you said to cat the file and then tail the result ... which means
> reading the whole file into ram and pipe the output to read the last
> 500 lines ... while simos suggested to read the last 500 lines (and
> only these) directly from the file (admittedly from the wrong place).

Do I really have to quote?

> Maybe with a file so large a better command would be
> 
> tail -n 500 "file" so that tail can do random seeks, but I'm not sure.

Why? Because the above command, namely

cat "file" | tail -n 500

will read the entire file from disk before tail will filter out the last 
500 lines.

So I never said to cat the file, I said:

*In general* "cat "file" | tail -n 500 will get you the last 500 lines." 
so that's not what I advised. That is the general form. That's the 
idiomatic expression. Then I said "Maybe with a file so large" you had 
better name the file directly.

Is it so hard to read?

It says it verbatim.

Down below, I say again:

"would do the trick, although again, you can better directly name a 
file:"

split -b 500M "filename".

And:

"Both should work (tail and split with a direct filename)."



Is it so hard to read the entire message before you start responding?




More information about the ubuntu-users mailing list