CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

[Library Index]

[View category: Operating Systems] [Discuss Article]

CLI performance techniques

Article is yet to be rated
Author:      alfer
Submitted:      04-Feb-2002 09:21:02
Imported From:      zZine (original author: alfer)


"The UNIX system is successful because the minimum number of keystrokes achieve the maximum effort.
Improve your typing, or teach the system to understand you

Most people involved with computer spend a lot of time writing text, rather than using the mouse to point and click. Whether you are using a text editor, composing an email or typing at the command line, you can save a lot of time if your typing skills are good. Less mistakes mean less time lost. It's never a bad idea to take typing classes.

But if you're too busy or lazy, use the following steps:

1. Log your commands

This is automatically done in most cases, but if for some reason you have disabled command history, enable it. For a most detailed input, use 'script'.

2. Review the list periodically

Open your commands history file (different filenames are used for different shells) and gather statistics about:

- Your typing mistakes
- The commands you use the most
- The parameters you use the most, for each command

This review, besides being very useful, is also rather funny: watch you in action!

3. For typing:

- Create a $HOME/bin directory'mkdir /export/home/user0121/bin'
- Create a symlink there with the error you have. If you type 'sl' instead of 'ls' often enough, just do a 'ln -s /export/home/user/0121/bin/sl /usr/bin/ls'.
Another option is to create an alias:
'alias sl="ls"' (include it in your .profile to have it always available).

- Add $HOME/bin to your PATH PATH=$PATH:$HOME/bin; export PATH.
Again, include it in your local shell configuration file.

Now you'll get correct answers even if you type the wrong command.

4. For parameters:

- Create aliases and use them.
Example, 'll' instead of 'ls -l', 'alog' instead of
'tail -f /usr/local/apache/logs/error_log'...

5. For commands:

Print out the man pages of the, say, 10 commands you use the most, and read them. Explore flags you can use and you didn't know about, put them in practice, see if other commands/tools are better for you, and study them.

Note: The CA University can provide examples of these techniques and teach new ones.

The Open Source Institute can help you developing new tools for improved performance.

This article was originally published by CyberArmy.net in the CyberArmy Library.

You must be logged in to vote on an article

About Us | Privacy Policy | Mission Statement | Help