How to use file protocol to access a directory on local system?

前端 未结 5 1430
無奈伤痛
無奈伤痛 2021-02-15 23:39

like /usr/local?

I tried file:///usr/local but failed

[root@www2 robot]# cd file:///usr/local
-bash: cd: file:///usr/local: No          


        
5条回答
  •  星月不相逢
    2021-02-16 00:20

    The file: protocol only exists in web browsers. Try it in Firefox, it should work. To do it in a shell, just use

    cd /usr/local/
    

    Don't use file:. It's the same reason why you can't

    cat http://www.google.com
    

    Which would be awesome (but you have to use something like wget or curl).

提交回复
热议问题