How do I get to the end of a file using the more command
i.e. more filename
(I want to stay in the file, but don't want to have to do Shift + G to get to the end, as I want the command set up as a short cut.
I want to more the end of the file rather than the start but stay
within the file)
-p command
+command For each file examined, initially execute the more
command in the command argument. If the command
is a positioning command, such as a line number or
a regular expression search, set the current posi-
tion to represent the final results of the com-
mand, without writing any intermediate lines of
the file. For example, the two commands:
more -p 1000j file
more -p 1000G file
are equivalent and start the display with the current posi-
tion at line 1000, bypassing the lines that j would write
and scroll off the screen if it had been issued during the
file examination. If the positioning command is unsuccess-
ful, the first line in the file will be the current posi-
tion.
It's good to pick up these sorts of shortcuts to save a lot of time when in a hurry or under pressure - the little things like knowing a flag here and there often make the difference between finding a vital piece of information that can lead to solving a problem.
As with most general issues there are many ways to do things in UNIX - you could have piped tail into the more command to achieve the same effect, variety is the spice of of life!