Move all files except one

Léo Léopold Hertz 준영 picture Léo Léopold Hertz 준영 · Mar 22, 2009 · Viewed 154.7k times · Source

How can I move all files except one? I am looking for something like:

'mv ~/Linux/Old/!Tux.png ~/Linux/New/'

where I move old stuff to new stuff -folder except Tux.png. !-sign represents a negation. Is there some tool for the job?

Answer

sth picture sth · Mar 22, 2009

If you use bash and have the extglob shell option set (which is usually the case):

mv ~/Linux/Old/!(Tux.png) ~/Linux/New/