Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 1
    You mean the find solution I gave didn't working? Commented Sep 5, 2014 at 2:30
  • "didn't work" or " isn't working". Yes your find solution also works. Thanks. Commented Sep 5, 2014 at 2:43
  • 1
    Can you make it more details? How "didn't work? It does not remove other files, or it removed file.txt or anything else? Commented Sep 5, 2014 at 2:45
  • I meant that on the Debian OS "$rm !(file.txt)" returns "Badly placed ()'s". So I tried "$shopt -s extglob", but it returned: "shopt: Command not found". Then I tried the "find" solution. It does work. Commented Sep 5, 2014 at 2:55
  • 1
    Oh, so of course it doesn't work. shopt is not a tcsh builtin. Commented Sep 5, 2014 at 3:15