Linux shell commands (various)

16 posts in this topic

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

0

Share this post


Link to post
Share on other sites

tail -f <filename> ... will give the last part of the file and will show new lines if they appear (handy for log files)

0

Share this post


Link to post
Share on other sites

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)

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

 

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)

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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"

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

 

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.

 

 

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

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

 

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.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now