Thursday, October 28, 2010

5 most important reasons why a Unix developer should use VIM


  VIM is a text editor, an extension of vi.   VIM is called so because it has lot of Vi Improved features, and hence the name. We saw how to install VIM in one our earlier articles: VIM Installation. Let us see the 5 most compelling reasons why a UNIX developer should use VIM:

1.  File already open alert: Every Unix programmer will have at least one bad experience of overwriting a file which is being opened in  more than one terminal. This CANNOT happen in vim. If a file is opened in an terminal, when the same file is already opened in a different terminal, a warning message appears. This is very helpful feature for the programmers.

Monday, October 18, 2010

User Account & Shell

    When a new user account is created in UNIX, a lot of attributes are defined for the new user. The following are the ones :
  • User Name
  • User Id
  • Group Id
  • Home directory
  • Default Shell
   User name is the name given to the new user in the system. In any account, to find out the user who is currently working or logged in:

Wednesday, September 15, 2010

5 different ways to do file listing without ls command

  ls has to be the command which every UNIX user has used the most. Well, what if ls command does not exist. Can we still list the files and directories without the ls command? In other words, can we simulate the ls command? There are many different ways to achieve that. Lets us see some of them.

1. The simplest of all is using the echo command:
echo *
  In case, if you also want to list the hidden files as well,

Monday, September 13, 2010

EXINIT vs .exrc

In one of our earlier articles, we discussed the use of .exrc file. In this article, we will discuss about the EXINIT variable and how it is related to .exrc file.

  EXINIT is an environment variable which is used by the vi command. When the vi command opens a file, it first reads the EXINIT variable, if present,  and applies the settings accordingly.

Tuesday, August 31, 2010

Unix File Descriptors

 Unix has 3  file descriptors:
  • 0 - Input
  • 1 - Output
  • 2 - Error
Every file descriptor is associated with a value. The above list shows the 3 file descriptors and their associated value. Before we see too much into this, let us go straight to see some examples.

Output File Descriptor:
#cat f1
I am an Indian,
And I love Unix.
#
 In the above example, the cat command displayed the contents of the file f1. The output of the cat command got displayed or got re-directed to the terminal which is the output file descriptor by default. To prove it, lets try this: