Solved How to use cd command in Windows

July 21, 2011 at 08:40:59
Specs: Windows 7, Dual core AMD
Hi all, I'm a Linux user just starting to get the hang of Windows 7. How can one perform these functions with the Windows cd command:
1) Go back to the previous directory (cd - in Bash)
2) Go to the user's home directory (cd ~ in Bash)
3) Bookmark a directory (not built into bash, but cdargs or DerB can be added)

Thanks


See More: How to use cd command in Windows

Report •

✔ Best Answer
July 21, 2011 at 09:40:54
1. Use pushd and popd, not cd for this.

2. Cd %HOMEPATH%.

3. Can you explain what you mean by "bookmarking" a directory?



#1
July 21, 2011 at 08:51:56
1) If you want to go back to the previously viewed directory just click on the arrow pointing left in an open explorer window.
2) If by a "User's home directory" you mean their storage area then you need to just click the Start Button, then click your username in the top right-hand corner of the Start Menu.
3)You need to find the "Favorites" menu in the explorer window, then you can add an open directory to your favorites.

Windows 7 doesn't use very many hotkeys for everyday user use, it is more built around a graphical interface.

Ask and Answer. The way of learning.

Dell Dimension 8300
Intel Pentium 4 HT @ 3.20 GHz
4 GB RAM
Nvidia Geforce FX5200


Report •

#2
July 21, 2011 at 09:10:49
Thank you RMT2. I was referring to navigation in the CLI, not Windows Explorer.

Report •

#3
July 21, 2011 at 09:13:29
Through CLI, the command cd just changes the directory. I really don't know much about CLI, so I'm sorry but I can't help much more with this.

Ask and Answer. The way of learning.

Dell Dimension 8300
Intel Pentium 4 HT @ 3.20 GHz
4 GB RAM
Nvidia Geforce FX5200


Report •

Related Solutions

#4
July 21, 2011 at 09:40:54
✔ Best Answer
1. Use pushd and popd, not cd for this.

2. Cd %HOMEPATH%.

3. Can you explain what you mean by "bookmarking" a directory?


Report •

#5
July 21, 2011 at 10:00:35
cd.. goes back one directory

type cd /? for more info

Appears bash bookmarks are what we refer to as shortcuts in the windows gui. There isn't an equivalent in command line in windows though you can make batch files that accomplish the same thing.

for example you would create a batch file called home.bat
by typing home you would execute
cd %homepath%

Answers are only as good as the information you provide.
How to properly post a question:
Sorry no tech support via PM's


Report •

#6
July 21, 2011 at 10:01:12
> 1. Use pushd and popd, not cd for this.

Thanks. This works if I know that I will need to go back, which I usually do. But it doesn't help for flipping between two directories, as I sometimes do.

> 2. Cd %HOMEPATH%.

Thank you!

> 3. Can you explain what you mean by "bookmarking" a directory?

I mean to assign an alias to a directory, something like this (made up, not bash):
C:\Users\dotancohen>save d
C:\Users\dotancohen>cd C:\Windows
C:\Windows>save w
C:\Windows>cd d
C:\Users\dotancohen>cd w
C:\Windows>
It would be like pushd and popd, but with multiple "saves".

Thanks.


Report •

#7
July 21, 2011 at 10:31:26
> for example you would create a batch file called home.bat
> by typing home you would execute
> cd %homepath%

Thanks, I will look into batch files. I suppose that I could just put them all in one directory and then add it to the path.

Thank you!


Report •

#8
July 21, 2011 at 10:39:18
Just define environment variables for the directories that you wish to alias.

If you want to do complicated things in a Windows shell you would be advised to study PowerShell, which is the replacement for the command shell in newer versions of Windows. It's rather too complicated to explain here, but it makes even Bash look fairly primitive. Check it out

As for flipping between directories, in both Linux and Windows I would just open a couple of command shells; much easier than flipping.


Report •

#9
July 21, 2011 at 12:18:05
Thanks, ijack. I will definitely look at powershell.

As for opening multiple command shells, is there an equivalent of "screen" for Windows?

Thanks!


Report •

#10
July 21, 2011 at 12:34:07
Not that I am aware of. but I don't really find it a very useful command in a Windowed environment. You mustn't expect Windows to have equivalents to all Linux commands, anymore than you can expect Linux to have equivalents to all Windows commands.

Report •

Ask Question