You can always start up an editor immediately to edit the current file being viewed. This will save some time and command typing. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to "vi" if neither VISUAL nor EDITOR is defined. I suggest you define your EDITOR first, enter:
$ export EDITOR=vimOR
$ echo 'export EDITOR=vim' >> ~/.bash_profile
export EDITOR=vimOpen any text file using more or less pager, type:
$ less myfile.txtOR
$ more ~/some.confTo edit a file, hit v key from keyboard. This will start up an editor at current line and file.
Further readings:
- man page less and more
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 6 comments… read them below or add one }
when you use less for more to view at that time you want edit first press ‘v’ then ‘i’
Great tip thank you. I heard about this on the Lottalinuxlinks podcast.
Hullo, just love your writing :) Sorry if this is a stupid comment, I didn’t find a “like” button :(
I use TextWrangler which comes with the ‘edit’ command line tool. I have always detested vim and preferred nano’s simplicity. I just tried this hint with nano and then with the TW edit command and both worked great. This is a simple, yet very helpful hint.
Thanks!
Thanks!!
i was looking for the EDITOR env-var tip!
Useful, thanks,
– Philippe