Linux命令行下文件或文件夹名字中包含空格的访问

来源:互联网 发布:幼儿编程教育 编辑:程序博客网 时间:2024/06/10 01:55

Linux命令行下文件或文件夹名字中包含空格的访问

       在Windows下命名文件或文件夹名有空格是可以的,甚至在Windows和Ubuntu虚拟机共享的文件中也可以这么做,但是在Ubuntu中空格要用下划线代替,养成一个好习惯。Linux会把空格当成分割符处理,无法找到文件或文件夹。

strong@foreverstrong:~$ cd ForeverStrong/strong@foreverstrong:~/ForeverStrong$ lltotal 20drwxrwxr-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$ lltotal 8drwxrwxr-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$ lltotal 8drwxrwxr-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/ForeverStrongstrong@foreverstrong:~/ForeverStrong$ strong@foreverstrong:~/ForeverStrong$ cd 'tensorflow boy'strong@foreverstrong:~/ForeverStrong/tensorflow boy$ lltotal 8drwxrwxr-x 2 strong strong 4096 Dec 22 10:18 ./drwxrwxr-x 5 strong strong 4096 Dec 22 10:28 ../strong@foreverstrong:~/ForeverStrong/tensorflow boy$