- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to save simple commands
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2003 03:01 AM
тАО03-07-2003 03:01 AM
how to save simple commands
cp m_gload* /var/mgm/log
is there a way i can save this command and make it work by just typing a key word for example "reptile"
cheers
bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2003 03:04 AM
тАО03-07-2003 03:04 AM
Re: how to save simple commands
Create an alias in your .kshrc or .shrc (whichever startup file you use, according to your shell):
alias spodcp="cp m_gload* /var/mgm/log"
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2003 03:04 AM
тАО03-07-2003 03:04 AM
Re: how to save simple commands
alias reptile='cp m_gload* /var/mgm/log'
If I remeber correctly
then log out and back in, or reread you .profile by doing
cd
. ./.profile
alias
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2003 03:07 AM
тАО03-07-2003 03:07 AM
Re: how to save simple commands
you can use the alias command like
alias psg="ps -ef | grep "
you can put this in a file which can be executed by .profile
HTH
Donald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2003 03:19 AM
тАО03-07-2003 03:19 AM
Re: how to save simple commands
sorted!
knew it was possible but couldnt remember how
Happy Friday!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2003 05:19 AM
тАО03-07-2003 05:19 AM
Re: how to save simple commands
An alternative, which is also handy for directory names you can't remember easily, is to create a file in your home directory, with command commands and directories in it,...
eg.
# Start Sample file
exit 0
/var/opt/OV/monitors/OpC/customer/hp/hpux # opc script
/var/spool/cron/crontabs
/usr/lbin/modprpw -l -k # userid enable
# End Sample file
What I do if I can't remember the precise command or directory, is grep in the file for what I remember (eg cron or userid) and I get shown the matching lines, which I can then drag and drop into the command line.
I also have set up an environment variable on every HP-UX Server called DIRS, and use this alias when searching for files.
Share and Enjoy! Ian