Notices


Reply
Thread Tools
Guest | Posts: n/a | Thanked: 0 times | Joined on
#1
Ubuntu is my main OS on my laptop, so I've used the command line quite a bit and therefore also like to play with it on the N900. Some of the basic commands I like are "history" and "history | grep keyword" since I tend to forget commands that I don't use often.

Unfortunately this does not seem to work on the N900. Is there a way to show previous commands I've used after I close and reopen the terminal application (I know the up arrow does this, but only for the commands I've used since opening the terminal)?
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#2
Only "cat ~/.ash_history" I'm afraid, but that will only show the history saved by the previous shell session.
 
Posts: 226 | Thanked: 47 times | Joined on Jan 2008 @ Poland / Bialystok
#3
History is shell specific.
I use bash on n810 and it gives me full history as on my desktop.
 
Guest | Posts: n/a | Thanked: 0 times | Joined on
#4
Originally Posted by lma View Post
Only "cat ~/.ash_history" I'm afraid, but that will only show the history saved by the previous shell session.
I am guessing you meant "cat ~/.bash_history"? Either way, I don't have such a file on my N900.

Originally Posted by XTC View Post
History is shell specific.
I use bash on n810 and it gives me full history as on my desktop.
So what shell is used on the N900 or is there a way to use bash on it?
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#5
Originally Posted by sgleo87 View Post
I am guessing you meant "cat ~/.bash_history"?
No, the default shell is (busybox) ash.

Either way, I don't have such a file on my N900.
You are probably suffering from bug 5137.
 

The Following 2 Users Say Thank You to lma For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#6
Originally Posted by lma View Post
No, the default shell is (busybox) ash.



You are probably suffering from bug 5137.
Oh...just noticed that "busybox" and "ash" is written at the top every time the terminal is opened....

Thanks for the link to the bug report. I never considered before that this is a bug, so I googled the issue and found another thread in this forum that solved my problems! (http://talk.maemo.org/showthread.php?t=37178)

Short version: The history was not saved because I always hit the "X" when closing it instead of using Ctrl+D. If you execute
Code:
echo 'trap exit SIGHUP' >> .profile
the history is also saved even when hitting "X".
 

The Following User Says Thank You to For This Useful Post:
Posts: 135 | Thanked: 158 times | Joined on Sep 2009 @ Germany
#7
How can remove ?

Code:
echo 'trap exit SIGHUP' >> .profile
 
Posts: 16 | Thanked: 5 times | Joined on Mar 2010 @ S.E. Michigan USA
#8
The command added a line to the end of your profile, which is a hidden file in your home directory. If you hadn't done anything previously to create a profile, it made a new file containing just this one line.

You can edit your .profile file to remove the new line, but if it only has that one line, you can delete it entirely by opening a terminal and typing:

Code:
rm .profile
To check the contents of the file before deleting it, enter:

Code:
cat .profile
If you need to edit it to remove just this one line, you can use vi. The arrow keys move the cursor to the line you want to edit, then just type dd to delete the line, and :wq to enter command mode, write the file, and quit the editor.

Code:
vi .profile
dd
:wq
Vi doesn't use the return key and the dd won't show up on the screen anyway so these commands are shown on separate lines above just for clarity. If you make a mistake, :q! will exit vi without saving and if you get into a mode where those commands don't seem to work, press the Esc key on the virtual keyboard to get back to the normal mode.

Good luck!
 
Reply


 
Forum Jump


All times are GMT. The time now is 13:43.