Actually that would resolve to /
, if /.mp4
exists then we’d end up with mv /.mp4 /.mp4
which would be a different error.
The title says *.mp4
and $DOWNLOADS/*
, so it would result in this command
sudo mv /*.mp4 /*
/*
would presumably list all the files and directories in /
. If any files matched then something happened.
% ls
file file1 file2 test test2 test3
% mv *1 *
mv: cannot stat 'file1': No such file or directory
% ls
test3
% ls test3
file file1 file2 test test2
*1
results in file1
, then *
lists all the files and dirs, so we end up with this
mv file1 file file1 file2 test test2 test3
Which of course is a list of files and dirs to move to test3
.
If using zsh
and *.mp4
doesn’t match then you get an error, in bash
you get *.mp4
plus whatever comes after.
% echo *.mp4 *
zsh: no matches found: *.mp4
$ echo *.mp4 *
*.mp4 file file1 file2 test test2 test3
So if the command in the title is correct then this is roughly what was run
sudo mv /*.mp4 /bin /boot /desktopfs-pkgs.txt /dev /etc /home /lib /lib64 /lost+found /media /mnt /opt /proc /root /rootfs-pkgs.txt /run /sbin /srv /sys /tmp /usr /var
In bash
, mv
would try to move everything to /var
, and complain about 1 or more missing files (/*.mp4
). This would happen whether /*.mp4
matches or not, as there are other files that do exist.
zsh
would of course give zsh: no matches found: /*.mp4
, unless 1 or more matching files were found in which case it would also run the command and mv
would try to move everything to /var
, and complain about 1 or more missing files (listed twice).