You are here: Articles > UNIX > UNIX

 See more articles about "UNIX "

Show line numbers in vi or vim

 

Displaying line numbers while editing a file can be handy. This recipe describes how to turn on and off the display of line numbers in vi and vim.

While editing a document (and not inserting text), type the following to turn on line numbers:



:set number



If you tire of the line numbers, enter the following command to turn them off:



:set nonumber

 

Also see ...

Move or jump to specific lines in vi
H3Navigating large files is an important capability when using any editor. The vi editor makes it easy to move around./H3PAll of the following commands must be entered in command mode, not insert mode. Pressing ESC will ensure you are in command mode. br / br /To jump to the end (last li

Perform case insensitive searches in vi or vim
H3The default behavior of searches in vi/vim is case sensitive. A simple setting allows case insensitive searches./H3PBy default, the following search string entered in command mode will find only instances of Tech Recipes which match the upper and lower case exactly: br / br /div class=

Continuously watch a text file in UNIX
H3Using the tail command with an option, the file will remain open and you will see any additional output written to the file. This is especially useful for watching log files./H3PTo monitor any new output to /var/log/messages:br / br / br /div class="code"tail f /var/log/messages/d

Solving ldap_sasl_interactive_bind_s error with ldapsearch or ldapmodify
H3This error message is commonly found when using the OpenLDAP ldapsearch, ldapmodify, ldapadd or other ldap command line utilities against non OpenLDAP servers such as Sun's SunONE/iPlanet, IBM's Tivoli, or Novell directory servers. This recipe explains the error and describes how to solve it./

Solve your UNIX identity crisis
H3If you frequently login to multiple UNIX systems as different users, it is sometimes helpful to make sure you know who you are. The who command, in addition to telling you who else is online, can tell you who you are logged in as and on what tty port. /H3PTo determine who you logged into y