nano Movement |
Linux Commands - Shells |
Skills in moving around in large files is very important for an administrator because config files of 1000+ lines will take a very long time to navigate.
Here is an example of opening a file that is longer. The example is a copy of the /etc/httpd/conf/httpd.conf for the apache web server. You can create a large file and do the same thing, just do not practice on real config files so that you do not damage them. Ctrl+X is the same command as ^X, the ^ stands for the Ctrl key.
When the file opens you can see that in the middle at the bottom you have a list of the number of lines in the file, here it is 991. This is a difficult file to move around in as it takes too much time so you have to use some commands. In order to move to the end of the file use the command: Alt _/ If you want to move to the start of the file use: Alt_\ Notice the slash is in the opposite direction. If you want to move to a specific line use this command: Ctrl+Shift+ _ When you do that an option will open for you to enter the line number to go to. In the example, line 456 is entered. Note that you also can use Ctrl+Y to go to the first line or Ctrl+V to go to the last line when this line numbe option opens.
You can also use these commands to move in smaller increments. ^F Move forward one character
Copyright CyberMontana Inc. and BeginLinux.com
All rights reserved. Cannot be reproduced without written permission. Box 1262 Trout Creek, MT 59874
|