Offcourse, mv them to a directory higher. Try not to mv them to a subdirectory you are deleting...
–
KonerakJan 8 '13 at 19:21

10

This will overwrite files with the same name in the destination directory
–
MatteoJan 9 '13 at 9:29

4

I am downvoting this because while it can be handy, it also is non-atomic and effectively removes all files from the directory during a short period of time; this would not be acceptable if, for instance, the files are being shared on the network.
–
Sam HocevarJan 10 '13 at 12:19

Somewhat similar to this answer but no special options are needed, as far as I know the following is "ancient" functionality supported by any (vaguely) /bin/sh resembling shell (e.g. bash, zsh, ksh, etc)

This works for the 1-char filenames. For longer names, sparkie's answer is better.
–
glenn jackmanJan 8 '13 at 15:31

3

What would be wrong with rm [^up]*? I do similar things rather often.
–
Michael KjörlingJan 8 '13 at 15:33

3

@MichaelKjörling - this would delete all files beginning with either u or p, not just those with the names u and p. I think the OP (@Ashot) meant the a-z and u,p,etc. symbolically and not literally.
–
Sudipta ChatterjeeJan 9 '13 at 9:07

4

@HobbesofCalvin That would delete all files not beginning with u or p, not those beginning with them.
–
rjmunroJan 9 '13 at 10:48

For those preferring to specify arbitrary complex exclude patterns (spanning all affected filenames) in a full blown regexp emacs, posix-awk or posix-extended style (see find man page) I would recommend this one. It excludes u and p in current dir in this example. This may be handy for scripts.