Question

I have to rename some folders. They have all this structure local-XXXX

local--pdf-preisliste- local--pdf-kundendienst local-navi_flash_home

and I have to drop the local- prefix. In order to maintain the current folders, I wanna create symbolic link to them

So navi_flash_home -> ./local-navi_flash_home

But I have problems with symbolic links thats starts with -

For local--pdf-kundendienst I must have -pdf-kundendienst

I've tried

10:19 webadmin@jomaora:~/media% ln -s local--pdf-kundendienst -pdf-kundendienst 
ln: invalid option -- p
Try `ln --help' for more information.
10:21 webadmin@jomaora:~/media% ln -s "local--pdf-kundendienst" "-pdf-kundendienst"
ln: invalid option -- p
Try `ln --help' for more information.
10:21 webadmin@jomaora:~/media% ln -s 'local--pdf-kundendienst' '-pdf-kundendienst'
ln: invalid option -- p
Try `ln --help' for more information.
10:21 webadmin@jomaora:~/media% ln -s ./local--pdf-kundendienst -pdf-kundendienst
ln: invalid option -- p
Try `ln --help' for more information.
10:22 webadmin@jomaora:~/media% ln -s ./local--pdf-kundendienst '-pdf-kundendienst'
ln: invalid option -- p
Try `ln --help' for more information.
10:22 webadmin@jomaora:~/media% ln -s ./local--pdf-kundendienst \-pdf-kundendienst 
ln: invalid option -- p
Try `ln --help' for more information.
10:22 webadmin@jomaora:~/media% ln -s ./local--pdf-kundendienst \-pdf\-kundendienst
ln: invalid option -- p
Try `ln --help' for more information.
10:22 webadmin@jomaora:~/media% ln -s ./local\-\-pdf\-kundendienst \-pdf\-kundendienst
ln: invalid option -- p
Try `ln --help' for more information.
10:22 webadmin@jomaora:~/media% ln -s ./local--pdf-kundendienst pdf-kundendienst

But nothing works. Any advice??

Thanks

Was it helpful?

Solution

No it's not illegal, but arguments starting with - are usually interpreted as command line switches.

You can use the -- command line switch to tell most such programs to not interpret the following arguments as command line switches.

ln -s -- ./local--pdf-kundendienst -pdf-kundendienst
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top