logoalt Hacker News

torben-friis • yesterday at 1:54 PM • 1 reply • view on HN

So you can be at A, run a successful absolute path cd, then do something bad like a bulk remove in the current directory, and you nuke A?

What a footgun.


Replies

andOlga • yesterday at 2:00 PM

`cd` does not travel to an "absolute path". It changes the working directory for the specified drive. Your prompt will still show you the old path (at A:), because you've not changed the folder for the current working drive, which yes, is kind of an insane concept.

If you want to actually change the working directory and drive at the same time (which is the "absolute path" idea you have), you do `cd /d D:\whatever\`.

➕ show 1 reply