1
vote
2answers
162 views

Can files be recovered after a failed mv command?

I used mv * .. in Unix to move all contents of a directory to its parent folder. There was a folder called "Downloads" in both the current directory and the parent. The one in the parent was empty to ...
0
votes
2answers
107 views

Linux move files from specific directory one directory up and delete empty folder

I need to move files out from a directory inside a directory inside a directory and remove folder that I move them from. I would need a recursive script. The directory structure: ...
0
votes
2answers
68 views

how to use grep and mv together in a directory in shell?

how do you grep the contents of all files in a directory for "TEST" then move those files to a different directory(like the home dir.)?
11
votes
2answers
322 views

Linux mv command moved data to an unknown location?

I accidentally executed this command in SSH: mv /var/www/vhosts/website/httpdocs/magento/* Now all the data in the magento dir is gone. Does anyone know where it moved to? Thanks!
2
votes
1answer
195 views

Move all files in sub-directories to current directory while renaming duplicates

I have a number of subdirectories and I would like to move any files contained therein to the current directory using a one line Terminal command on the Mac. I know that my file names are not all ...
10
votes
2answers
243 views

How to move folder in unix using mv, only when target is on the same drive

I need to move a folder using unix mv command, but only if the target is in the same drive or the same filesystem. What would be the best approach?
0
votes
1answer
80 views

mv command - parametric source and target

I have folder "F A" containing some subfolders and files and another folder "F B" containing the same folder structure but no file: find . -type d . ./F A ./F A/SF A ./F A/SF B ./F A/SF C ./F B ./F ...
0
votes
1answer
189 views

Prevent mv from overwriting the larger file by the same name

I need to move all files from a directory, discarding the directory structure. Unfortunately, some files have the same file name (Thumbnails). I'm looking for smth. like this: find /tmp/dirtree ...
-2
votes
2answers
494 views

Mac (Linux) - Restore file removed through mv command

I have one big problem. I had two files - main.c and logic.c. I have used sed for some modification in logic.c and then i saved it to main_updated.c and then run mv main_updated.c main.c BUT it ...
4
votes
4answers
8k views

How to move only files in Unix

How can I move only the plain files (not the directories) from one folder in Linux to another folder using the mv command? I have tried mv * ~/, but it copied everything including the directories.