Questions tagged [mv]
mv is a Unix command that moves a file to a target location.
661 questions
1 vote
0 answers
58 views
What can go wrong with this command for flatten a directory recursively?
I have a very messy deep file hierarchy tree of files with duplicate names in different directories and possibly even duplicate files with different names. $ find mp4/ -type f | more mp4/._.DS_Store ...
6 votes
2 answers
146 views
mv affected by bind mounts (feels like a bug)
Originally, mv(1) was a rename operation; it updated names in filesystems and did not copy files. More recently, a convenience feature was added, whereby if the source and target were on different ...
1 vote
6 answers
359 views
Move a lot of folders with spaces in the name
I have a lot of webpages saved in my Download folder and I want to move all html files together with its folder (for every "NAME.html" exists "NAME_files/" folder). The big ...
1 vote
1 answer
247 views
Why does my bash shell script not work in MacOS Terminal?
I have a bash shell script change_filename.sh containing the line of code: mv "dir\ 1/file1.txt" "dir\ 1/file2.txt" which does not change the name of file1.txt to file2.txt as ...
0 votes
1 answer
420 views
How can I restore the /usr/lib/x86_64-linux-gnu folder?
I'm new to Linux and did something stupid. I'm using Kali and after apt-get update and apt-get upgrade, I encountered some issues. The desktop items were missing and windows no longer had a "bar&...
0 votes
1 answer
85 views
Where did i put my directory?
I wanted to move my World file from my Terraria Server and used (I was currently in the .local directory) sudo mv share/ /terraria because I wanted to move the share folder into the terraria directory....
0 votes
1 answer
143 views
To move files only; To copy folders only
Tested in Bash and Zsh: copy nondot files | cp ~/dir1/* ~/dir2/ copy dot files | cp ~/dir1/.* ~/dir2/ copy both nondot and dot files | cp ~/dir1/{.,}* ~/dir2/ ...
0 votes
5 answers
363 views
How can I move a subdirectory to overwrite the parent directory?
Let's say I run, cd /tmp/ mkdir -p foo/bar/ echo test > foo/bar/1 Now I have a very simple $ tree foo foo └── bar └── 1 2 directories, 1 file Now if I want to move foo/bar to overwrite foo, ...