简体   繁体   English

-bash: cd: /tensorflow1: ubuntu 中没有这样的文件或目录,但文件在那里

[英]-bash: cd: /tensorflow1: No such file or directory in ubuntu, but the file is there

I am using ubuntu 16.04 and created a virtual environment called 'tensorflow1' as shown above.我正在使用 ubuntu 16.04 并创建了一个名为“tensorflow1”的虚拟环境,如上所示。 I am using putty to access a machine remotely.我正在使用腻子远程访问机器。 So I was trying to change directory by typing "cd /tensorflow1/models/research" but it says "-bash: cd: /tensorflow1: No such file or directory" in ubuntu, but the file is there.所以我试图通过键入“cd /tensorflow1/models/research”来更改目录,但它在ubuntu中显示“-bash:cd:/tensorflow1:没有这样的文件或目录” ,但文件在那里。 I typed "ls" and it also shows the file.我输入了“ls” ,它也显示了文件。 Why is it so?为什么会这样?

When you type ls you see the content of the current directory.当您键入ls您会看到当前目录的内容。 When you type cd /tensorflow1 you're trying to enter a directory tensorflow1 at the root ( / ) of the filesystem and the directory is certainly not there.当您键入cd /tensorflow1您试图在文件系统的根( / )输入目录tensorflow1并且该目录肯定不存在。 You just need您只需要

cd tensorflow1/models/research

to enter a subdirectory of the current directory.进入当前目录的子目录。 Or或者

cd ./tensorflow1/models/research

because .因为. means "the current directory".表示“当前目录”。

You probably want cd ./tensorflow1/models/research or just cd tensorflow1/models/research .您可能想要cd ./tensorflow1/models/research或只是cd tensorflow1/models/research

Read about root directory , home directory , working directory then about path_resolution(7)阅读根目录主目录工作目录,然后了解path_resolution(7)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM