-2

how to find my files due to misuse mv?

for example, I change folder /var/lib/a And I typed, "sudo mv /var/lib/b/* ./*"

then, I couldn't find my files nowhere how can I find my files?

mong
  • 1
  • 1

1 Answers1

-1

When you use the mv command all the files and folders in the following list are moved to the last place in your argument list. By using the * you are first passing all elements in the folder /var/lib/b/ as arguments for mv and afterwards all elements in the current folder ./ If you have two files b1,b2 in /var/lib/b/ and two folders f1,f2 in ./ your command would be expanded to

mv /var/lib/b/b1 /var/lib/b/b2 ./f1 ./f2

That would mean all your files b1 and b2 should be moved to ./f2 now together with ./f1

eraenderer
  • 107
  • 5