![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Deleting end of line $ character in file | bwrynz1 | UNIX for Advanced & Expert Users | 3 | 01-08-2008 10:17 AM |
| Special character in my file | Ryan2786 | UNIX for Dummies Questions & Answers | 3 | 07-05-2007 08:35 PM |
| delete a special character in file | srivsn | Shell Programming and Scripting | 1 | 03-15-2006 03:45 AM |
| delete a special character in file | srivsn | Shell Programming and Scripting | 3 | 03-07-2006 05:18 AM |
| Mount a character special file | MuellerUrs | SUN Solaris | 1 | 07-15-2005 09:36 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Problem deleting file with special character
I'm having problems deleting a file with a special character and I'm hoping that somebody here can help. The file "-osample1.c" will not remove from my directory. Here is an example of what happens. Any ideas would be appreciated.
> ls *sample1* ls: illegal option -- . usage: ls -1ARadeCxmnlogrtucpFLbqisf [files] > ls -osample1.o demo_proc.mk makefile test.sh test1.c test1.o testing asdf.log inst scripts test1 test1.lis test1.pc > rm *sample1* rm: illegal option -- o rm: illegal option -- s rm: illegal option -- a rm: illegal option -- m rm: illegal option -- p rm: illegal option -- l rm: illegal option -- e rm: illegal option -- 1 rm: illegal option -- . rm: illegal option -- o Usage: rm [-Rfir] file ... > rm -osample1.o rm: illegal option -- o rm: illegal option -- s rm: illegal option -- a rm: illegal option -- m rm: illegal option -- p rm: illegal option -- l rm: illegal option -- e rm: illegal option -- 1 rm: illegal option -- . rm: illegal option -- o Usage: rm [-Rfir] file ... |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
From man sh
Code:
-- A -- signals the end of options and disables further option
processing. Any arguments after the -- are treated as file-
names and arguments. An argument of - is equivalent to --.
Code:
sh-2.05b$ touch -- -123 sh-2.05b$ ls -l -- -123 -rw-r--r-- 1 abcdefgh g900 0 Dec 7 07:17 -123 sh-2.05b$ rm -- -123 sh-2.05b$ ls -l -- -123 ls: -123: No such file or directory sh-2.05b$ |
|
#3
|
|||
|
|||
|
Worked like a charm
|
|||
| Google The UNIX and Linux Forums |