mv

mv equivalent rsync command [closed]

余生颓废 提交于 2019-12-20 09:54:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . i'm trying to move folders to another folders using command line , with overwrite if already exists, but i got error "Is a directory" when using mv.. example: mv src/test/ dest/ there are many files and folders on src/test/, there are also some files and some folders on dest/ and i want files and folders on dest

Python move files from directories that match given criteria to new directory

拜拜、爱过 提交于 2019-12-20 07:26:22
问题 I have a directory that looks something like this: . ├── files.py ├── homework ├── hw1 │ └── hw1.pdf ├── hw10 │ └── hw10.pdf ├── hw13 │ └── hw13.pdf ├── hw2 │ └── hw2.pdf ├── hw3 │ └── hw3.pdf ├── hw4 │ └── hw4.pdf ├── hw7 │ └── hw7.pdf ├── IntroductionToAlgorithms.pdf ├── p157 │ └── Makefile ├── p164 │ └── project ├── p171 │ ├── project ├── p18 │ └── project ├── p246 │ ├── project ├── p257 │ ├── project ├── p307 │ ├── project ├── p34 │ └── project ├── p363 │ ├── project ├── p431 │ ├── bit

How to rename with prefix/suffix?

房东的猫 提交于 2019-12-17 04:43:45
问题 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.filename new.~ or whatever - but I can't see anything like this after looking at man mv / info mv pages. Of course, I could write a shell script to do this, but isn't there an existing command/flag for it? 回答1: In Bash and zsh you can do this with Brace Expansion. This simply expands a list of items

Rename file while keeping the extension in Linux?

孤者浪人 提交于 2019-12-14 04:09:26
问题 I have a directory that contains multiple files with different extensions (pdf, doc, txt...etc). I'm trying to rename all files according to the directory name while keeping the file extension the same. The code below works fine if all files are PDF otherwise it will change txt file extension to pdf too. How can I rename files while preserving the file extension mv "$file" "${dir}/${dir}-${count}.pdf" 回答1: you can do this through bash. can you please provide more details. how your deciding

Git recursive mv files

我怕爱的太早我们不能终老 提交于 2019-12-13 19:19:23
问题 I'm trying to add version numbers to all javascript files in a directory so that changes to the files won't be cached by our users. How can I move all Javascript files that are in several directories within one directory? With the example file structure: js/ --home/ ----main.js --apps/ ----main.js --handlers.js --ajax.js I would like to do something like git mv -r js/*.js js/*.1.js to append a .1 to the filenames. Obviously there isn't a flag for recursion for git mv, so I'm wondering what my

Error when trying to rename files with sed on mac os x

ε祈祈猫儿з 提交于 2019-12-13 05:09:54
问题 I have a set of files that are sequentially numbered from 0001. What I'm trying to accomplish is to rename alter the name of the file, while keeping some pieces (such as nw, w) intact and start the numbering from 0000. Original file names I have is as follows: knifer dying nw 0001.png knifer dying nw 0002.png knifer dying nw 0003.png knifer dying nw 0004.png knifer dying nw 0005.png knifer dying nw 0006.png knifer dying nw 0007.png knifer dying nw 0008.png knifer dying nw 0009.png knifer

mv: cannot stat error [closed]

不想你离开。 提交于 2019-12-12 03:09:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . mv: cannot stat error : No such file or directory error this is my error and this is my code #!/bin/sh printf "change word from read \n" read a read b mv ${a} ${b} printf "${b}\n" How can I solve it? 回答1: The file you are trying to mv does not exist. You can check if it exists with: if [ ! -f "$a" ] then echo

Getting value of parent model with Backbone.js

≯℡__Kan透↙ 提交于 2019-12-12 02:08:53
问题 I have a backbone application with the following architecture: A PageGroupCollection is a collection of PageGroupModel s. A PageGroupModel has a PageCollection as one of it's attributes. A PageCollection is a collection of PageModel s PageGroupModel has a permalink attribute PageModel has a permalink attribute. I need a function within PageModel that returns a permalink that includes both the permalink of PageModel thats PageCollection attribute contains PageGroupModel and also its own

Recursively renaming folders and files to sub-directory name and moving files

柔情痞子 提交于 2019-12-12 01:23:23
问题 I have several sub-directories with no unanimous naming pattern within my home directory (for example ~/123 , ~/456 , ~/789 ). Within each of these sub-directories, I have two folders named alignment1 and alignment2 . In the folders alignment1 and alignment2 there are several files. The files of interest to me are named alignment1 (no extension) in the alignment1 folder and the file alignment2 (no extension) in the alignment2 folder. Please remember that in the folders alignment1 and

A simple mv command in a BASH script

核能气质少年 提交于 2019-12-11 17:45:26
问题 The aim of my script: look at all the files in a directory ($Home/Music/TEST) and its sub-directories (they are music files) find out what music genre each file belongs to if the genre is Heavy , then move the file to another directory ($Home/Music/Output) This is what I have: #!/bin/bash cd Music/TEST for files in * do if [ -f "$files" ];then # use mminfo to get the track info genre=`mminfo "$files"|grep genre|awk -F: '{print $2}'|sed 's/^ *//g'|sed 's/[^a-zA-Z0-9\ \-\_]//g'` if [ $genre =