Monday 17 March 2008

Editing text files in Linux

At some point you may end up having to edit a text file from a command line prompt, perhaps to change a configuration file on advice from a forum post.

There's a joke in the professional UNIX community "users haven't got CLUE", they even walk around in t-shirts with puns on to that effect. CLUE stands for 'command line user experience'. Unlike MS-DOS and the related windows 'command' window, the command shell in a UNIX or LINUX distribution has a very powerful tool set, enabling complex tasks to be undertaken very swiftly with a short series of commands. Using these tools effectively requires knowledge and experience, remembering the subtleties and nuances of these commands is a memory feat in itself. When it comes to editing files the traditional command line editors available at the command line are extremely capable and powerful in the hands of an experienced user, or programmer, but for you or I they are next to useless for the occasional edit to a file. So an old hand at Linux or Unix is likely suggest that you edit a file with 'vi', 'ed', 'Emacs' or 'vim', as does some of the assistance available to you on-line. Instead, in Ubuntu, use 'nano' which is a nice simple text editor that will work pretty much as you would expect, even if, like me, you don't have CLUE.

No comments: