Is there any shortcut for go back to previous folder?
170 次查看(过去 30 天)
显示 更早的评论
Sometimes I need to navigate among some folders. I need the "go back" in a convenient way, like "cd -". But, this is not supported in Matlab. Is there any way to achieve this? If not, a keyboard shortcut to pop up the recent directory list is OK,too.
Thank you very much.
8 个评论
采纳的回答
Cris LaPierre
2020-5-24
There is a Back button in the Current Folder toolbox. That takes be back to the folder that was previously the current folder. Does that help or are you specifically looking for a keyboard shortcut?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/298998/image.png)
2 个评论
Walter Roberson
2021-7-12
support for . and .. is present because NTFS and all Unix filesystems literally have entries named . and .. inside them. MATLAB does not need to do any special parsing for either one: it can just ask the operating system to change directory (and then query to find out where it ended up.)
There is special processing for ~ as that is not handled by the operating system. It is, however, only necessary to construct the mapping of ~ to a folder name once at startup time using environment variables HOME, or USERDRIVE and USERPATH, as changes to those are ignored (iirc).
Supporting cd - would require that cd keeps history, which it does not do at the moment. I don't think it would be a difficult change to support one level of history, but it would be different in character than what is already implemented.
更多回答(1 个)
soon kiat
2020-5-29
cd ..
can also help to go back to previous folder
6 个评论
omid zandi
2021-7-12
Does anyone have any suggestion about doing the same thing, but this time for going forward in folders ??
Walter Roberson
2021-7-12
cd does not keep any kind of history. It has no idea that you used to be in a folder inside the current folder and want to go back there.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Search Path 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!