View previous topic :: View next topic |
Author |
Message |
HeadHolio Guru
Joined: 10 Aug 2002 Posts: 445
|
Posted: Fri Oct 21, 2005 6:00 pm Post subject: skip to end of file? |
|
|
Anyone know how to jump to the end of a file with nano? Is this possible? I have log files that are huge and viewing them with nano without being able to skip to the end kinda sucks. I have the feeling I should probably be using vi instead...... |
|
Back to top |
|
|
96140 Retired Dev
Joined: 23 Jan 2005 Posts: 1324
|
Posted: Sat Oct 22, 2005 7:03 am Post subject: Re: skip to end of file? |
|
|
HeadHolio wrote: | Anyone know how to jump to the end of a file with nano? Is this possible? I have log files that are huge and viewing them with nano without being able to skip to the end kinda sucks. I have the feeling I should probably be using vi instead...... |
Well, if holding down PgDn isn't an option for you, open a file with "nano <filename> +<linenumber>". So says man nano; if you know the line number you want, add it after the plus sign.
Better yet, since you're just viewing text (instead of writing it), use the tail utility. Try "tail -n 30 <filename>"; 30 is the number of lines to display from the end of the file. Adjust the number as you see fit. To get the last 27 lines of /var/log/messages, do:
Code: | # tail -n 27 /var/log/messages |
|
|
Back to top |
|
|
think4urs11 Bodhisattva
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Sat Oct 22, 2005 10:28 am Post subject: Re: skip to end of file? |
|
|
HeadHolio wrote: | I have log files that are huge and viewing them with nano without being able to skip to the end kinda sucks. |
less <logfile>
press 'G' to jump to the end ('g' for beginning) _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
|
chunderbunny Veteran
Joined: 31 May 2004 Posts: 1281 Location: 51°24'27" N, 0°57'15" W
|
Posted: Sat Oct 22, 2005 12:08 pm Post subject: |
|
|
Yeah, "less" is better for viewing logfiles. You can search by pressing "/" as well. |
|
Back to top |
|
|
HeadHolio Guru
Joined: 10 Aug 2002 Posts: 445
|
Posted: Sat Oct 22, 2005 3:26 pm Post subject: Perfect |
|
|
Thanks guys. I think i'll use less from now on cause I usually don't know how many lines are in the log files. |
|
Back to top |
|
|
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
Posted: Sun Oct 23, 2005 7:56 am Post subject: Re: Perfect |
|
|
HeadHolio wrote: | Thanks guys. I think i'll use less from now on cause I usually don't know how many lines are in the log files. | Another option is: which takes you directly to the end of the file. Also, you can use "/" in vim to start searching if you want, "gg" to go to beginning of file, "G" to go to end of file. |
|
Back to top |
|
|
nickel Apprentice
Joined: 21 Oct 2005 Posts: 192 Location: Germany
|
Posted: Sun Oct 23, 2005 11:06 am Post subject: |
|
|
you know, to programm (c++, c or java), write textfiles and so on, i use emacs. It has has so many cool things. Theres xemacs, for x system, but i never use it |
|
Back to top |
|
|
djpharoah Apprentice
Joined: 24 Nov 2004 Posts: 186 Location: Irvine, California USA
|
Posted: Sun Oct 23, 2005 11:04 pm Post subject: |
|
|
try gedit |
|
Back to top |
|
|
96140 Retired Dev
Joined: 23 Jan 2005 Posts: 1324
|
Posted: Sun Oct 23, 2005 11:24 pm Post subject: |
|
|
djpharoah wrote: | try gedit |
If you read his first post, you might have noticed that he specifically didn't want something bundled with (or has dependecies for) KDE or Gnome. gedit is one of Gnome's dependencies.
Though I will say that gedit is a fine program; it gets the job done and is great for doing XML/XHTML/Javascript/CSS editing . . . its syntax highlighting is great, too. |
|
Back to top |
|
|
brianahr Apprentice
Joined: 07 Oct 2004 Posts: 236 Location: USA
|
|
Back to top |
|
|
96140 Retired Dev
Joined: 23 Jan 2005 Posts: 1324
|
Posted: Mon Oct 24, 2005 4:35 pm Post subject: Re: scite |
|
|
That looks like a more generic version of gedit (if that's possible ). Nice, though. |
|
Back to top |
|
|
blidside n00b
Joined: 30 Jul 2002 Posts: 51 Location: Tampa, FL
|
Posted: Mon Oct 24, 2005 4:42 pm Post subject: |
|
|
scribes,
scribes.sourceforge.net
kinda cool concept - let the window manger manage windows, file manager manage files, and let scribes be a lightwight, syntax friendly editor. |
|
Back to top |
|
|
brims Guru
Joined: 19 Apr 2004 Posts: 492 Location: Arizona
|
Posted: Mon Oct 24, 2005 7:02 pm Post subject: |
|
|
If you just want to view the last part of a log file you can use tail, default is the last 10 lines. If you want 16 lines, do tail -n <number> <logfile>. |
|
Back to top |
|
|
Urban Cowboy n00b
Joined: 09 Oct 2007 Posts: 64
|
Posted: Fri Oct 12, 2007 12:27 am Post subject: Re: scite |
|
|
First page, 6th post.
EDIT: Whoops.. holy two years dead thread revival batman! |
|
Back to top |
|
|
|