admin管理员组文章数量:1130349
Linux 命令行访问名字中包含空格的文件或文件夹
Linux 命令行访问名字中包含空格的文件或文件夹
在 Windows 下命名文件或文件夹名有空格是可以的,甚至在 Windows 和 Ubuntu 虚拟机共享的文件中也可以这么做,但是在 Ubuntu 中空格要用下划线代替,养成好习惯。Linux 会把空格当成分割符处理,无法找到文件或文件夹。
文件夹 tensorflow boy 包含空格,访问方式为 cd tensorflow\ boy、cd "tensorflow boy"、cd 'tensorflow boy'。
strong@foreverstrong:~$ cd ForeverStrong/
strong@foreverstrong:~/ForeverStrong$ ll
total 20
drwxrwxr-x 5 strong strong 4096 Dec 22 10:28 ./
drwxr-xr-x 52 strong strong 4096 Dec 21 10:22 ../
drwxrwxr-x 2 strong strong 4096 Dec 22 10:18 tensorflow boy/
strong@foreverstrong:~/ForeverStrong$
strong@foreverstrong:~/ForeverStrong$ cd tensorflow\ boy/
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ ll
total 8
drwxrwxr-x 2 strong strong 4096 Dec 22 10:18 ./
drwxrwxr-x 5 strong strong 4096 Dec 22 10:28 ../
strong@foreverstrong:~/ForeverStrong/tensorflow boy$
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ cd ..
strong@foreverstrong:~/ForeverStrong$
strong@foreverstrong:~/ForeverStrong$ cd "tensorflow boy"
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ ll
total 8
drwxrwxr-x 2 strong strong 4096 Dec 22 10:18 ./
drwxrwxr-x 5 strong strong 4096 Dec 22 10:28 ../
strong@foreverstrong:~/ForeverStrong/tensorflow boy$
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ cd -
/home/strong/ForeverStrong
strong@foreverstrong:~/ForeverStrong$
strong@foreverstrong:~/ForeverStrong$ cd 'tensorflow boy'
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ ll
total 8
drwxrwxr-x 2 strong strong 4096 Dec 22 10:18 ./
drwxrwxr-x 5 strong strong 4096 Dec 22 10:28 ../
strong@foreverstrong:~/ForeverStrong/tensorflow boy$
References
/
Linux 命令行访问名字中包含空格的文件或文件夹
Linux 命令行访问名字中包含空格的文件或文件夹
在 Windows 下命名文件或文件夹名有空格是可以的,甚至在 Windows 和 Ubuntu 虚拟机共享的文件中也可以这么做,但是在 Ubuntu 中空格要用下划线代替,养成好习惯。Linux 会把空格当成分割符处理,无法找到文件或文件夹。
文件夹 tensorflow boy 包含空格,访问方式为 cd tensorflow\ boy、cd "tensorflow boy"、cd 'tensorflow boy'。
strong@foreverstrong:~$ cd ForeverStrong/
strong@foreverstrong:~/ForeverStrong$ ll
total 20
drwxrwxr-x 5 strong strong 4096 Dec 22 10:28 ./
drwxr-xr-x 52 strong strong 4096 Dec 21 10:22 ../
drwxrwxr-x 2 strong strong 4096 Dec 22 10:18 tensorflow boy/
strong@foreverstrong:~/ForeverStrong$
strong@foreverstrong:~/ForeverStrong$ cd tensorflow\ boy/
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ ll
total 8
drwxrwxr-x 2 strong strong 4096 Dec 22 10:18 ./
drwxrwxr-x 5 strong strong 4096 Dec 22 10:28 ../
strong@foreverstrong:~/ForeverStrong/tensorflow boy$
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ cd ..
strong@foreverstrong:~/ForeverStrong$
strong@foreverstrong:~/ForeverStrong$ cd "tensorflow boy"
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ ll
total 8
drwxrwxr-x 2 strong strong 4096 Dec 22 10:18 ./
drwxrwxr-x 5 strong strong 4096 Dec 22 10:28 ../
strong@foreverstrong:~/ForeverStrong/tensorflow boy$
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ cd -
/home/strong/ForeverStrong
strong@foreverstrong:~/ForeverStrong$
strong@foreverstrong:~/ForeverStrong$ cd 'tensorflow boy'
strong@foreverstrong:~/ForeverStrong/tensorflow boy$ ll
total 8
drwxrwxr-x 2 strong strong 4096 Dec 22 10:18 ./
drwxrwxr-x 5 strong strong 4096 Dec 22 10:28 ../
strong@foreverstrong:~/ForeverStrong/tensorflow boy$
References
/
本文标签: Linux 命令行访问名字中包含空格的文件或文件夹
版权声明:本文标题:Linux 命令行访问名字中包含空格的文件或文件夹 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/IT/1694668459a254837.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论