mv Questions

4

Solved

Question Is there a simple way to move all the files in a directory up to its parent directory then delete the directory? Use Case I'm doing a zip extraction and the source zip contains a root f...
Hummingbird asked 10/10, 2014 at 3:51

4

Solved

I tried to deploy my personal blog website to my remote server recently. When I tried to move a few files and directories to another place by executing mv, some unexpected errors happened. The comm...
mv
Andraandrade asked 19/3, 2015 at 1:58

15

Solved

I would like to rename/move a project subtree in Git moving it from /project/xyz to /components/xyz If I use a plain git mv project components, then all the commit history for the xyz projec...
Herrick asked 22/2, 2010 at 22:11

8

Solved

I want to rename files in the format: img_MM-DD-YY_XX.jpg img_MM-DD-YY_XXX.jpg to: newyears_YYYY-MM-DD_XXX.jpg Where: YYYY = year MM = month DD = day XXX or XX = photo number ...
Passade asked 15/4, 2011 at 2:27

21

Solved

So, if I'm in my home directory and I want to move foo.c to ~/bar/baz/foo.c , but those directories don't exist, is there some way to have those directories automatically created, so that you would...
Harrier asked 13/2, 2009 at 21:15

11

Solved

How do I do mv original.filename new.original.filename without retyping the original filename? I would imagine being able to do something like mv -p=new. original.filename or perhaps mv original.f...
Niobium asked 16/10, 2008 at 11:37

5

Solved

As a rather novice Linux user, I can't seem to find how to do this. I am trying to move unique files all in one directory into another directory. Example: $ ls vehicle car.txt bicycle.txt airplane...
Comehither asked 22/12, 2016 at 6:33

8

I'm facing this simple task but, I'm also wondering about what's the easiest and short way to do it. My proposal is move a given number of random files from a directory to another. This task is par...
Embezzle asked 25/12, 2012 at 18:40

10

Solved

What is the right way to undo a rename in git, like: git mv file1 file2
Flung asked 4/2, 2011 at 20:49

5

Solved

I am trying to build an app which can list some values from the database and modify, add, delete if necessary using Spring 4 and i receive the following error(only if the "@Controller" annotation i...
Propel asked 29/4, 2015 at 16:25

12

Solved

I am wondering - how can I move all the files in a directory except those files in a specific directory (as 'mv' does not have a '--exclude' option)?
Thoroughfare asked 6/1, 2011 at 5:52

9

Solved

I have several folders, each with between 15,000 and 40,000 photos. I want each of these to be split into sub folders - each with 2,000 files in them. What is a quick way to do this that will crea...
Efficient asked 18/3, 2015 at 7:21

6

I have this directory called "mock", which contains 3 directories. I am trying to copy all the items from "mock" directory into the "projweek" directory using th...
Wat asked 13/12, 2015 at 17:39

4

Solved

I am trying to run a command mv /var/www/my_folder/reports.html /tmp/ it is running properly. But I want to put a condition like if that file exists then only run the command. Is there an...
Laity asked 7/11, 2017 at 9:33

3

I have a project under git. One day I moved all project files from current directory to foo/bar/ under the project. I did it using git mv. Then I added some more files and did some changes to alrea...
Indiscriminate asked 28/10, 2010 at 12:18

5

Solved

I am composing a script to process 20 files. All of them located in different directories. I have partial file name. In log directory, File1_Date_time.err change to File1__Date_time_orig.err cd ...
Spagyric asked 29/2, 2016 at 20:0

2

if I run: mkdir -p "$HOME"/old_foo && find "$HOME" -type d -name "*foo" -exec mv -vi {} "$HOME"/new_foo \; I get: /Users/medialab/old_foo -> /Users/medialab/new_foo but also: find: ...
Ignescent asked 7/8, 2017 at 22:7

4

Solved

I have a lot of files in /home/somedir/subdir/ and I'm trying to move them all up to /home/somedir programmatically. right now I have this: subprocess.call(["mv", "/home/somedir/subdir/*", "somed...
Antarctica asked 15/2, 2014 at 23:9

3

Solved

I want to use mv to rename a file: mv src.txt dest.txt If the file doesn't exist, I get an error: mv: cannot stat ‘src.txt’: No such file or directory How do I use mv only if the file already exi...
Der asked 29/10, 2015 at 12:50

1

Solved

I have a bash script that uses the rename command as follows: sudo rename 's/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/Date-$1-$2-$3__Time-$4:$5:$6/' 2019* According to the rename man page the c...
Fiann asked 11/7, 2019 at 3:29

1

Solved

I am trying to get a directory to replace an existing folder but can't get it done with mv - I believe there's a way and I just don't know it (yet). Even after consulting the man page and searching...
Contraction asked 3/3, 2019 at 17:14

2

I'm trying to rename a bunch of files which contain spaces in them, getting rid of the spaces. I thought I found the correct bash command: for f in *.txt; do mv \"$f\" ${f/ /}; done However, thi...
Breakneck asked 23/10, 2014 at 0:19

6

Solved

I moved a file using git mv. Now I would like to do a diff on the new file to compare it with the old file (with the old, now non-existent name). How do I do this?
Patsy asked 20/4, 2011 at 12:41

6

Angular 1.x (AngularJS) was following more or less the MV* design principle because of its two-way data binding functionality. Angular2 is adopting a component-based UI, a concept that might be fa...
Misfortune asked 30/4, 2016 at 4:5

4

I am trying to rename multiple files with extension xyz[n] to extension xyz example : mv *.xyz[1] to *.xyz but the error is coming as - " *.xyz No such file or directory"
Cerda asked 20/12, 2012 at 7:55

© 2022 - 2024 — McMap. All rights reserved.