 I am on my desktop here. I'm gonna ADB shell to connect to my phone through USB now I can say echo test echo hello and run a command like date now if I hit up arrow You can see I have a history of those things, but if I was to exit out and go back in I hit up arrow I have lost that history. Why is that? Well if I echo out home You can see my home directory is set to the root system of the phone, which I don't have right access to Even as root it's a read-only system now I do have busybox installed which also allows me to run the busybox shell which in my opinion is a better shell than the default shell on The Android system and it also allows for history, but again It doesn't save it because it still thinks my home directory is the root directory now I can change what my root directory is or my home directory is Let me go ahead and exit out of this what we're going to do is I'm going to start ADB with this command What I'm doing is I'm running ADB shell and say dash t to basically execute this next thing I'm gonna say export the variable home and I'm using data local temp Which is the default temporary directory on your Android system Although it's a little different than the temp directory on a standard Linux system that gets wiped every time you reboot your system Nothing in here gets wiped when you reboot as far as I know But you can use any directory you should be able to use your internal storage or your SD card It's something that you have right access to this particular directory all users on your phone have right access to after that We're gonna start busybox sh, so I'm gonna run that and now I Can say echo hello? Echo this is a test run the date command again if I hit up arrow a couple times You can see that I have that history, but if I exit out and Run that command again. You can see my history has been saved. So that is great Now let's do the same thing, but let's add something to it I do have my phone rooted so what I'm going to do here is I'm gonna run the same command But add su dash c and run the same command So now I've started up as root and you can see that I have that history built in there now because I gave it The same home directory the two users are sharing the same history You may or may not want that you can give them different home directories if you want to have separate history files Now of course you don't want to type out that that full command every time So what you can do is in the RC file on your desktop for your system You can create aliases like so there'll be links to all this in the description of the video So you just copy and paste this but now I can say adb shell without a space It starts up busy box with my home directory set and now you can see I have my history if I exit out I can now say adb su again. No space and now I'm running as root adb and I have my history and If I cd to my home directory, you can see my home directory is set to that temp directory Of course you pick what directory you want to use. That's it quick little simple tutorial I hope you found this useful. Please visit filmsbychrist.com Remember that I do have a patreon page. There's a link in the description of this video I also now do YouTube membership check that out if you want to get at early access to stuff or of course through patreon I do thank you for watching as always. Please visit filmsbychrist.com. That's Chris the K There's a link in the description. Have a great day