[Ilugc] The cat command

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Fri Sep 18 05:42:31 2009

I am going to send a command a day like Bharathi used to do.

But I have very little time and life is not in my hands.

So I will go away one day as mysteriously as I come.

So please don't mistake me when that happens. Here we go.

Everyone knows that cat command.

$ cat /etc/passwd

will print the file to console.

Now you can get line numbers into a file like this.

$ cat -n /etc/passwd > /tmp/passwd-with-lineno.txt

This is a very powerful usage of this command.

You can always view line numbers in vim/vi or emacs but sometimes you
want that in the file itself.

Then you have the tac command.

It prints the file in reverse.

$ tac /etc/passwd

-Girish


-- 
Gayatri Hitech
web: http://gayatri-hitech.com

SpamCheetah Spam filter:
http://spam-cheetah.com

Other related posts:

  • » [Ilugc] The cat command - Girish Venkatachalam