Srini's Point of View

My thoughts on technology, food and other fancies…

comment multiple lines in vi

The comment symbol for Unix scripts is typically “#”. You can use the same concept for files for other programming languages. My vi commands below use the “#” symbol.

If you want to comment 5 lines in a file -

  1. Go to the first line you want to comment
  2. Make sure you are …

Manage directory navigation with pushd and popd

UNIX supports a wide variety of directory-navigation tools. Two good tools are pushd and popd.

You’re certainly aware that the cd command changes your current directory. What happens if you have several directories to navigate, but you want to be able to quickly return to a location? The pushd …

Reuse previous arguments

Here is another great tip from IBM. I love this. The !$ command returns the last argument used with a command. But what happens if you have a command that used arguments and you want to reuse just one of them?

The !:1 operator returns the argument used in a command …

Use history expansion

This post is from Unix tips from IBM. What happens if you’re using the same file name for a series of commands? Well, there’s a shortcut that can quickly retrieve the last file name you used.

What happens if you’re using the same file name for a …