I need to open a file with filename that contains forward slashes. I am wondering how I can do that. I have been searching through Google and I can't seem to find a way.
Thanks
Turning my comment into a bit of a possibly useful answer. Try renaming the file.
ls -i
Will give you the inode number of the file. You can then use a combination of find and mv to rename the file as follows:
find . -inum "inode-number-from-ls -i" -exec mv {} "newfilename" \;
Give the file a "normal" new file name and you're good to go.
find
can pass a valid name to mv
, then it's not a problem for a user to do the same.
Apr 18, 2017 at 22:55
It must be a Windows file. You have several ways to solve this:
vi "file/name"
. *
. If the name of the file is file/name
, you can do vi fil*
and this will be opened (together with others that can have same pattern). /
as the directory separator regardless of how it's specified on the command line.
Jun 4, 2013 at 22:35
namei
. It treats a few values special, one of them is ASCII0x2f
(/
). One could use an encoding (encodings are only relevant for user level programs, not kernel functions) which translates/
to another value than0x2f
.