TT logo
You are viewing a low-graphics version of this page. Click the headline to view full version:

Linux shell commands (various)

Technical computer help

Toytown Germany > Discussion forum > Themes > Miscellaneous
marka
Can anyone please tell me the linux command I need to use to view the last part of a text file ?? I have tried "less 'filename'" but this shows the beginning of the file and I need to see the end. Its a log file and nearly 200 MB big so dont fancy scrolling to the end :-)

Thanks
Bumpy
tail -10 filename
false
tail -f <filename> ... will give the last part of the file and will show new lines if they appear (handy for log files)
Inflatablewoman
10 being the number of lines you want to read in.
don_riina
Well, on a Mac you would...blah blah blah.

(standard TT response to any computer question. Fucking ignore it and simply bang on about how things are better on a Mac, or on Linux, or whateverthespank)
Mr.Fox
You could open the file with less, and then press Shift-G to move to the end of the file. The advantage of using less is, you could scroll up and down a file. press g to move to the top of the file again.
ian
QUOTE (don_riina @ Sep 6 2006, 11:21 am) *
Well, on a Mac you would...

Well on a Mac you wouldn't...bother! You get on with real work!

(I wanted to keep the spirit of opinionating going)
Darkknight
tail is faster, forget "less" and anything MAC Related..

tail -f <filename> = Opens the file shows you the last few lines and starts an active monitoring for updates.

tail -10 <filename> = Shows you the last 10 lines then exits.
HEM
Isnt 10 the default (it is on Solaris):

tail name-of-file will produce the last 10 lines.
Hutcho
10 is the default and you don't need the -f. If you want to specify number of lines use -n.

All of this can be found by typing "man tail"
HEM
The "-f" option is useful if you are monitoring a log file...
Vert
Less is good, shift - G to go to end of file, Ctrl F to do the tail -f trick. Less is better because you can ctrl - c to stop the ctrl f thing, and scroll up if you saw something interesting.

hmmmmmm.
OhFFS
QUOTE (marka @ Sep 6 2006, 11:10 am) *
I have tried "less 'filename'" but this shows the beginning of the file and I need to see the end.

That is because less is more, grasshopper.

QUOTE (Hutcho @ Sep 6 2006, 12:09 pm) *
man tail

*snigger*

Of course, % rm God is funnier. Or:

% make fire
Make: Don't know how to make fire. Stop.
% why not?
No match.
% gotta light?
No match.

Or... http://www.tbi.univie.ac.at/~ronke/FUN/unix.html
actordamian
Munich, Germany.

1). Can anyone help me get online using my 02 surf stick with a linux operating system? I am at my wits end. 02 are not helpful.
Ubuntu Linux Software für Ihre(n) Surf-Stick, Surf-Box-Mini, Surf-Card-Express‏

2). Interested in buying a cheap laptop with a windows operating system and wireless possibilities using a surf stick.

Thank you.
Damian.
Darkknight
Support is spotty at best, but try one of these sites.
Dostoyevsky
QUOTE (don_riina @ Sep 6 2006, 11:21 am) *
Well, on a Mac you would...blah blah blah.

(standard TT response to any computer question. Fucking ignore it and simply bang on about how things are better on a Mac, or on Linux, or whateverthespank)

On a Mac you could and should actually use the same "tail -10 file" command as on Linux.
You are viewing a low fidelity version of this page. Click to view the full page.