views:

29

answers:

2

Is there a way to trigger/fire the UP key in the command line?

Instead of me having to press UP key.

A: 

If you have xvkbd installed, you an use its -text option to send any string to the focused window as:

xvkbd  -text "\[Up]"
codaddict
A: 

This sounds like an XY Problem to me.

If what you really want to do is to be able to access and execute a previous command in the history without pressing up-arrow, there are various ways to do that:

  • !! will execute the previous command
  • Ctrl-rstring will allow you to search for previous commands
  • !string searches for a command beginning with "string"
  • !?string searches for a command containing with "string"
Dennis Williamson