Reputation: 87
After using Ubuntu for a while, I'm in situation to switch to Windows for something.
In linux, you can access previous command easily with arrow-up in keyboard, even after opening new terminal.
In windows, I can use F7 to extract previous commands executed in the current terminal. However, when I open new terminal and F7, it's empty, even after saving all necessary commands in /User/name/Desktop/commands.txt
Is there a way to bring commands in commands.txt when I open a new terminal in Windows?
Upvotes: 0
Views: 1140
Reputation: 30662
Please note that you can also use Windows Subsystem for Linux (WSL) on Windows that gives you an option to run several Linux distributions on your Windows computer. Therefore you can use bash on Windows as if you were using Linux.
Upvotes: 0
Reputation: 410
It is not natively supported on Windows command terminal.
I recommend you to use Windows PowerShell since you have just switched back to Windows. Or even better, switch to Windows Terminal (you will be able to customize your terminal as on Linux)
On Powershell, you can press arrow-up key to see your previous command, even if you restart a Powershell session.
If you type the command 'Get-History' (or the alias 'history') you will only the history of your current session.
If you want to get the whole history from all your previous/current session, you can do this command
Get-Content (Get-PSReadlineOption).HistorySavePath
It will list all your history. (If you want by default to have all the history by typing "history" instead of the current session only, you can change the default alias "history" by this command above then)
Upvotes: 2