Re: How to use cd with special chars in a network directory name?
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Wed, 15 Mar 2006 18:11:12 -0500
On 2006-03-15, Jeff wrote:
(Sorry if this is a dumb question--I'm a bit of a Linux newbie.)
I need to access some files on a Novell server from
a (debian) Linux machine. I mount the server with a
command like this:
mount -t smbfs username=myname ServerMountPointName LocalDir
and then I can cd into LocalDir and ls the files and subdirs just fine.
The problem is that the directory structure on the server has some
directories whose names start with the minus sign, like "-main",
and I cannot get Linux to cd into those directories. From reading
various docs and faqs on the internet, I thought that one of these
should work, but none do:
cd -main
cd '-main'
cd `-main'
cd `-main`
cd "-main"
(In all cases, the Linux complaint suggests to me that it thinks
-main is some kind of cd option switch.)
I guess it isn't _just_ a network-related problem, because even on
the local drive I am also unable to make a new directory called
"-main" with any version of a command like:
mkdir -main
mkdir `-main'
etc
Any suggestions other than renaming all of the directories
on the server?
cd ./-main
cd -- -main
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
.
- References:
- Prev by Date: Re: Root pivoting, resizing reiserfs & upgrading SuSE
- Next by Date: Re: How to use cd with special chars in a network directory name?
- Previous by thread: How to use cd with special chars in a network directory name?
- Next by thread: Re: How to use cd with special chars in a network directory name?
- Index(es):
Relevant Pages
|