2

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)
studiohack
  • 13,468
  • 19
  • 88
  • 118
dotancohen
  • 11,278
  • 19
  • 67
  • 96
  • 1
    As pointed out in comments to answers, this duplicates two existing questions: [this](http://superuser.com/questions/129969/) and [this](http://superuser.com/questions/129969/). – JdeBP Oct 28 '11 at 15:12
  • 1
    Windows also supports the `pushd` and `popd` commands, though with much less flexibility than, say, their bash versions. – Keith Thompson Oct 29 '11 at 07:20
  • 1
    @JdeBP what you called "this and this" , the two links are the same, should just read "this". – barlop Nov 07 '11 at 13:26
  • No, barlop. **Please** apply some nous for once. A correct statement is that the second hyperlink, clearly a copy and paste error on my part, should be [this](http://superuser.com/questions/332871/), as given below in the comments _if you'd only thought_ to look. – JdeBP Nov 07 '11 at 13:34
  • @JdeBP You know you've written this this this and this so many times, in so many places, for this question, that it's difficult to see whether and when you're linking to a "this" that you've already linked to. I will clarify by putting them in one comment. and with no hovering required. http://superuser.com/questions/129969/navigate-to-previous-directory-in-windows-command-prompt http://superuser.com/questions/332871/ (journeyman also mentioned the 129969 one). – barlop Nov 16 '11 at 16:03

2 Answers2

2
1.  
C:\blah>pushd a
C:\blah\a>popd
C:\blah>


2. 
cd %userprofile%

3. 
C:\>doskey gocq=cd c:\cq
C:\>gocq <ENTER>
C:\cq>
barlop
  • 23,380
  • 43
  • 145
  • 225
0

cd .. to go one level up

cd \ to go to the root level of the drive

cd %UserProfile% to go to the equivilent of /home - its c:/users/username in windows 7

Journeyman Geek
  • 127,463
  • 52
  • 260
  • 430
  • I think by *the previous directory* they didn't mean to go *up*, but one step back in the "history", so to say. – slhck Oct 28 '11 at 13:24
  • 1
    ahh, that would be covered by this http://superuser.com/questions/129969/navigate-to-previous-directory-in-windows-command-prompt – Journeyman Geek Oct 28 '11 at 13:28
  • And the other `cd` command is covered by [this SuperUser question](http://superuser.com/questions/332871). – JdeBP Oct 28 '11 at 14:28
  • "cd /" really? come on man.. \\\\\\\\\\\\\\\\ You're not helping him by using forward slashes when writing what are blatantly windows directories. – barlop Nov 07 '11 at 12:28
  • my bad. fixed. surprised no one caught it ;p – Journeyman Geek Nov 07 '11 at 12:30