- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to edit the already used command and runni...
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
тАО04-02-2009 09:17 AM
тАО04-02-2009 09:17 AM
I can get my previous commands (command history) by pressing "esc+k".
But i can't edit that commmand.
Since i want to change some option and run that command.
pls explain me on what are the keys are used to edit the previously entered commands.
what are the methods you are following?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 09:25 AM
тАО04-02-2009 09:25 AM
Re: how to edit the already used command and running that again
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 09:28 AM
тАО04-02-2009 09:28 AM
Re: how to edit the already used command and running that again
.x from vi will run a command after editing.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 09:28 AM
тАО04-02-2009 09:28 AM
Re: how to edit the already used command and running that again
It is assumed that you are running either the standard HP-UX Poxix shell ('/usr/bin/sh' or '/sbin/sh') or the Korn shell ('/usr/bin/ksh').
Then, in your ${HOME)/.profile make sure you have:
export HISTFILE=${HOME}/.sh_history
export HISTSIZE=100
Add these lines; logout and login again. Now do 'esc+k' then 'j' or 'k' to move backward and forward exactly as you would navigate a file with 'vi'. You can now use any 'vi' command to edit the line and hit the ESC key and the ENTER key to execute the modified line.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 10:57 AM
тАО04-02-2009 10:57 AM
Re: how to edit the already used command and running that again
Command line editting is possible and is like vi editting.
1)move to the end of the line ... $
2)delete the characters .... x
3)Insert any other characters .. i
4)replace one character ..... r
You can do more if you are interested in learning vi editor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 11:26 AM
тАО04-02-2009 11:26 AM
Re: how to edit the already used command and running that again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-02-2009 11:36 AM
тАО04-02-2009 11:36 AM
Re: how to edit the already used command and running that again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2009 03:20 AM
тАО04-03-2009 03:20 AM
Re: how to edit the already used command and running that again
I added the following line in ".profile" of user's home directory
export HISTFILE=$HOME/.sh_history
export HISTORY=100
then i log out from that user.
then i logged in.
but i am not able to get the command history.
pls help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2009 03:23 AM
тАО04-03-2009 03:23 AM
Re: how to edit the already used command and running that again
type couple of commands like
$ls
$pwd
now
$history
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2009 03:32 AM
тАО04-03-2009 03:32 AM
Re: how to edit the already used command and running that again
You can edit command in command prompt as you edit in "vi"
Here you need to export HISTFILE not HISTORY
export HISTFILE=$HOME/.sh_history
export HISTFILE=100
Suraj