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

前端 未结 5 1411
無奈伤痛
無奈伤痛 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:32

    If you have to deal with file:///usr/local on the command line, you could just remove the "file://" part. And do then a normal your command, e.g.:

    echo "file:///usr/local/" |  sed 's/file:\/\///' | cd
    

提交回复
热议问题