Page 1 of 1

Opening &PH& Directory

Posted: Wed Jan 30, 2008 12:34 pm
by sri75
HI ,

I would like to open &PH& directory and see all the files in it.But I am not able to open it.Can you please tell me how to open it.I tried to open it with 'cd &PH&'

Thanks

Re: Opening &PH& Directory

Posted: Wed Jan 30, 2008 12:38 pm
by gateleys
sri75 wrote:I tried to open it with 'cd &PH&'
:shock:

cd => change directory

How about ls?

Posted: Wed Jan 30, 2008 12:43 pm
by sri75
gateleys ,Thanks for your reply.

I tried with 'ls' too.but it gave all the files that are under projects folder, that included &PH& directory too.

Thanks

Posted: Wed Jan 30, 2008 12:46 pm
by gateleys
sri75 wrote: I tried with 'ls' too.but it gave all the files that are under projects folder, that included &PH& directory too.
Good! Now, if you do a list on the &PH& folder, it will list all the files and directories within it. See!!!

Posted: Wed Jan 30, 2008 12:51 pm
by throbinson
Escape the ampersands.

cd \&PH\&

Posted: Wed Jan 30, 2008 12:57 pm
by sri75
Thanks throbinson.It worked perfect

Now I am able to open the directory.

Thanks

Posted: Wed Jan 30, 2008 1:20 pm
by kcbland
& is a reserved character in unix, it runs a command in the background. This particular annoying directory needs special handling.

From now on, just use quotes around it: cd "&PH&"

Posted: Wed Jan 30, 2008 4:12 pm
by ray.wurlod
You probably need "hard quotes" (single quotes).
You don't need to cd.

Code: Select all

ls -lrt '&PH&'