In this article, we will see How to create and use alias command in linux . An alias is a short cut command for long command. We may type short alias name to run a longer command or sql.
An alias is a short cut command for long command. We may type short alias name to run a longer command or sql script file.
Below we will create and user alias command in linux
$ alias shortName=”custom command here”
Aliases can be creates as temporary or permanent. A temporary alias will use for existing session only and permanent alias will work any time for quick execution of command.
Temporary alias:-
$ alias space=’df -h’
$alias lg=’sqlplus apps/apps’
To run the command not need to type log command just type lg to login in oracle database using apps credential.
[appltest@apps scripts]$ lg
SQL*Plus: Release 10.1.0.5.0 – Production on Fri Sep 25 19:32:36 2020
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show user
Permanent alias:-
To keep permanent alias we need to add below in .bash_profile.
$vi .bash_profile
. /oracle/apps/apps_st/appl/APPS*.env
alias stopall=’$ADMIN_SCRIPTS_HOME/adstpall.sh apps/***** ;sleep 20;pkill -fu applmgr’