【问题标题】:change directory error with Powershell使用 Powershell 更改目录错误
【发布时间】:2015-11-01 03:06:47
【问题描述】:

我开始学习 Zed Shaw 的命令行速成课程,并且正在学习更改目录课程。当我输入cd../../ pwd 时出现错误:

the term cd is not recognized as the name of a cmdlet, function, script file or operable program

我不确定这意味着什么以及在这种情况下。我知道我输入了它无法识别的内容,但似乎这是它应该识别的内容。我目前的理论是它正在读入一个空白区域,但这不是错误消息的内容。所以我有点失落。

谢谢。

【问题讨论】:

  • 旁注:请注意,“命令行速成课程”在 powershell 中使用了大量 别名 来简化 cmd/终端的体验。 cdpwd 不是 PowerShell 中的实际命令,而是分别为 Set-LocationGet-Location cmdlet 的别名。您可以输入Get-Alias 并按回车键检索所有别名(输出也将显示它们的定义)
  • 谢谢!我会试试的。

标签: windows powershell terminal directory cd


【解决方案1】:

cd../../ 之间是否缺少空格?

另外pwd是一个单独的命令,应该在你运行cd之后单独输入

cd ../../      # this changes the current working directory to its parent's parent (goes up two levels)
pwd            # this displays the current working directory (the original directory's parent's parent)

例如:

C:\users\you\dir1\dir2\dir3> cd ../../
C:\users\you\dir1> pwd
C:\users\you\dir1
C:\users\you\dir1>

【讨论】:

  • 谢谢!间距问题是造成麻烦的原因。下次遇到这样的错误时,我也会检查间距。
猜你喜欢
  • 1970-01-01
  • 2010-09-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多