Reply
Thread Tools
Kevstacey's Avatar
Posts: 400 | Thanked: 76 times | Joined on Nov 2009 @ uk
#1
I searched round and couldnt find the appropriate place to ask.

Once ive run a command in xterm it sometimes remembers previous commands and when i open xterm and keep pressing the up key it shows a few previous commands.What can i type so it remembers a specific command when i open xterm?
e.g im running psx4m but it doesnt seem to keep that specific command in memory after running psx4m and closing xterm.

Any help appreciated
 
Posts: 162 | Thanked: 52 times | Joined on Feb 2010
#2
If you type 'exit' at the prompt it will be there next time. If you hit the X it won't.

If you want to save it as a command you could create it as a script and then open Term and type ./myscript

To be further helpful if you need it:
type out the command with "echo " in front. Eg,
echo /the/full/command/typed here >psx4m.script

Then type chmod +x psx4m.script

So you can open a terminal and type ./psx4m.script

Last edited by Marlon; 2010-08-10 at 11:47.
 

The Following 4 Users Say Thank You to Marlon For This Useful Post:
dchky's Avatar
Posts: 549 | Thanked: 299 times | Joined on Jun 2010 @ Australian in the Philippines
#3
If you type 'history' (without the quotes) in your x-term, it'll pop up a list of the last 500 commands you've attempted to execute. Each one is numbered.

Say you scroll back in the list a bit and you see psx4m is number 437, in your x-term simply type:

!437 (and hit enter)

It'll run that command.

You can also create aliases in your shell config file - for bash it's .bashrc (if you are root), for the 'user' account I believe you can use .profile - though don't quote me on that : )
 

The Following 3 Users Say Thank You to dchky For This Useful Post:
atilla's Avatar
Posts: 1,210 | Thanked: 597 times | Joined on Apr 2010 @ hamburg,germany
#4
history didnt work for me
__________________


Nobody likes us but we dont care....
 
Posts: 284 | Thanked: 74 times | Joined on Mar 2010 @ Wigan, UK
#5
Originally Posted by atilla View Post
history didnt work for me
+1

Even as root
 
manvik60's Avatar
Posts: 128 | Thanked: 46 times | Joined on Mar 2010 @ Switzerland
#6
Command history is stored in .ash_history file.
To get command history, You can press Alt + up/down arrow to get the last command, but it has a limit of storing only last 15 commands. This has already been filed a bug for this.
 

The Following 2 Users Say Thank You to manvik60 For This Useful Post:
Posts: 486 | Thanked: 251 times | Joined on Oct 2009
#7
Originally Posted by dchky View Post
If you type 'history' (without the quotes) in your x-term, it'll pop up a list of the last 500 commands you've attempted to execute. Each one is numbered.

Say you scroll back in the list a bit and you see psx4m is number 437, in your x-term simply type:

!437 (and hit enter)

It'll run that command.

You can also create aliases in your shell config file - for bash it's .bashrc (if you are root), for the 'user' account I believe you can use .profile - though don't quote me on that : )
bash is not present on a new n900, It needs to be installed.

The default n900 shell only saves a few commands, and the history command is not a part of the default shell.
__________________
The Mini-USB plug is an improvement over both the Type B plug and the Micro-B plug.
 

The Following User Says Thank You to j.s For This Useful Post:
dchky's Avatar
Posts: 549 | Thanked: 299 times | Joined on Jun 2010 @ Australian in the Philippines
#8
Originally Posted by j.s View Post
bash is not present on a new n900, It needs to be installed.

The default n900 shell only saves a few commands, and the history command is not a part of the default shell.
Apologies, thanks for the correction, you are absolutely right - as is manvik60. I believe I was on autopilot when I noticed that and installed bash without even thinking about it. I like to live dangerous, on the N900 I do everything as root : )
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:17.