UNIX command tricks
Some of the day to day UNIX commands used by a Basis admin have been covered by one of my previous posts. Here are some tips and tricks you might find usable. Replace a string from previous command and execute If you have run a command with an incorrect argument (usually a typo), you need not retype the entire command. You can use this trick to replace the typo and run the command. In this example, I am trying to list a file, but I typed the file name wrong: sapnwnewbie:user1 2> ls -l i-made-a-typo i-made-a-typo not found Now I correct the typo, and typo alone, using ^ in front of replacement and error. The corrected command runs automatically. sapnwnewbie:user1 3> ^ i-made-a-typo ^ startsap.trc ls -l startsap.trc -rw-r--r-- 1 user1 group1 33155 Apr 17 03:03 startsap.trc Reusing last argument from the previous command This is useful if you have used an argument in a command and if you need to use it again this time. Only the last argument can