print friendly version

Questions and answers

181
How can I avoid retyping long commands in the Unix system?


The commands described below need to be entered while logged in to the Unix server.   Normally you'll see a prompt ending with $ when the command interpreter (or shell) is ready for another command.

You can normally recall previous shell commands (even commands given in earlier login sessions) by using the up-arrow and down-arrow cursor keys. This means you need only type a long command once per session.

You can also define aliases in the following way.

alias ltx='latex mydescriptivefilename'

You can then give the command :-

ltx

which will then execute the command

latex mydescriptivefilename

You can make this permanent by putting the alias command in your .bashrc file if you are using bash, the "Bourne-again Shell" which is standard on the IT Services Unix system.  Other shells will be similar but with varying command syntax for the alias command.

Help us to improve this answer

Please suggest an improvement
(login needed, link opens in new window)

Your views are welcome and will help other readers of this page.

Categories

This is question number 181, which appears in the following categories:

Created by Andy Clews on 27 July 2001 and last updated by Andy Clews on 4 August 2015