Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like /usr/local?

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

[root@www2 robot]# cd file:///usr/local
-bash: cd: file:///usr/local: No such file or directory
like image 506
omg Avatar asked Jun 03 '09 21:06

omg


1 Answers

If you have a requirement to be able to access generic URLs from your shell, try using curl as a replacement for your cat:

curl file:///path/to/file.txt
curl http://www.domain.com/file.txt

But as other posters have pointed out, the shell itself doesn't understand URLs.

like image 111
MikeyB Avatar answered Nov 10 '22 00:11

MikeyB