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.
$ 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.
[[email protected] 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.
Oracle Database 11g Enterprise Edition Release 188.8.131.52.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show user
To keep permanent alias we need to add below in .bash_profile.
alias stopall=’$ADMIN_SCRIPTS_HOME/adstpall.sh apps/***** ;sleep 20;pkill -fu applmgr’