Using ls on a directory prefaced by a minus sign
I would like to view all files located in a given directory using something like:
Code:
ls myDir -LRa | more How can I accomplish this? Thank you Code:
-sh-4.1$ ls "-2" |
rename the directory first. simple.
if you can't from the shell, you have to do it through php. |
Thanks ondoho,
Can't use mv either. But I can if I use full file path, and for that matter, could use ls as well. All good. Thanks |
Try it with
Code:
ls -LRa -- myDir | more |
Thanks TobiSGD,
I already fond that the following would work, and after searching the directories, deleted them. Code:
ls '/bla/bla/bla/-2' -LRa | more Code:
ls -LRa -- -2 | more |
I usually precede the "unlistable" with a simple ./
Thus "ls ./-2" will work. |
Quote:
Code:
[tobi@demon test]$ touch -- -2 |
mc usually can rename unusual file/directory names easily.
|
Thanks jpollard, Yes your approach is simpler.
Thanks TobiSGD, I really should be less afraid of testing! Thanks Doug, Never used Midnight Commander and don't have it currently installed, but maybe I will explore. |
All times are GMT -5. The time now is 10:12 AM. |