1

Attempted to move all files and directories not ending with .srt to the parent directory by using these commands:

shopt -s extglob
mv !(*.srt) ..

Checked dir contents with ls and everything looked correct, only .srt files remaining:

abc.srt xyz.srt 123.srt etc.srt

When I went up a directory to check the contents, the sub-directory I was just in was not there and only about half the files were moved to the parent directory. mv threw no errors during the operation.

I've tried recursively searching for the missing directory from the root of my system (fd -H 'missingfile' /) but nothing is showing up.

What happened to my files? Did the pattern matching result in renaming and overwriting instead of the intended move?

3
  • Strange, can't reproduce that, everything works fine for me
    – xezo360hye
    Commented May 24, 2023 at 15:27
  • I don't see any potential side-effect of this glob substitution that would do what you say, there is no string transformation nor recursive globbing that could have generated name collision. My first feeeling is that you follow a red herring. The hypothesis is too speculative and we have too few elements to help you or prove anything Commented May 28, 2023 at 18:03
  • Did the moved files include directories and/or symbolic links?
    – Kusalananda
    Commented Aug 29, 2023 at 17:48

0

You must log in to answer this question.

Browse other questions tagged .