CP 命令提示 Windows 7 无法识别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21734377/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CP Command Prompt Windows 7 not recognized
提问by Satch3000
I am trying to run the command CP at the command prompt on windows 7 but I'm getting:
我试图在 Windows 7 上的命令提示符下运行命令 CP,但我得到:
'cp' is not recognized as an internal or external command, operable program or batch file.
Do I need to install any software to run cp command?
我需要安装任何软件来运行 cp 命令吗?
If so what?
如果是什么?
采纳答案by Bobby
it is a unix/linux command. Download the cygwin package from cygwin.com
它是一个 unix/linux 命令。从 cygwin.com 下载 cygwin 包
回答by GabrielF
By default, there's no cp
in Windows Command Prompt (cmd.exe). The equivalent cmd.exe command is copy
. cp
is a Unix command.
默认情况下,cp
Windows 命令提示符 (cmd.exe) 中没有。等效的 cmd.exe 命令是copy
. cp
是一个Unix 命令。
If you can use PowerShellinstead, which should come pre-installed in modern Windows systems, you can use cp
and some other Unix commands directly in it.
如果您可以使用PowerShell(它应该预装在现代 Windows 系统中),您可以cp
直接在其中使用和其他一些 Unix 命令。
If PowerShell isn't an alternative, you can use cp
directly in Windows Command Prompt if you install Cygwin.
如果 PowerShell 不是替代方案,则可以cp
在安装Cygwin 的情况下直接在 Windows 命令提示符中使用。
Moreover, Cygwin also includes the rsync
command, which has many more features than cp
, and might be preferable if you're not just copying a single file (e.g. for backup purposes).
此外,Cygwin 还包括rsync
命令,它比 具有更多功能cp
,如果您不只是复制单个文件(例如用于备份目的),则可能更可取。
回答by Stefan Steiger
Necromancing.
死灵法术。
There's a way to do run cp without cygwin and powershell and without admin rights.
有一种方法可以在没有 cygwin 和 powershell 并且没有管理员权限的情况下运行 cp 。
Download the respective package (CoreUtils) from the Gnu-Win32 package repository.
从Gnu-Win32 包存储库下载相应的包 ( CoreUtils) 。
You need the zipped binariesand the zipped dependencies. Unpack, and copy bin from deps to bin from coreutils.
您需要压缩的二进制文件和压缩的依赖项。解压,并将 bin 从 deps 复制到 coreutils 的 bin。
Now add the bin folder to the path environment variable (system or user, depending on if you're admin or not), and open a new console. Type cp, and you'll see standard cp command output.
现在将 bin 文件夹添加到路径环境变量(系统或用户,取决于您是否是管理员),并打开一个新控制台。键入 cp,您将看到标准的 cp 命令输出。