How to rename with prefix/suffix?

You could use the rename(1) command: rename ‘s/(.*)$/new.$1/’ original.filename Edit: If rename isn’t available and you have to rename more than one file, shell scripting can really be short and simple for this. For example, to rename all *.jpg to prefix_*.jpg in the current directory: for filename in *.jpg; do mv “$filename” “prefix_${filename}”; done; or … Read more

Is there a way to make mv create the directory to be moved to if it doesn’t exist?

How about this one-liner (in bash): mkdir –parents ./some/path/; mv yourfile.txt $_ Breaking that down: mkdir –parents ./some/path # if it doesn’t work; try mkdir -p ./some/path creates the directory (including all intermediate directories), after which: mv yourfile.txt $_ moves the file to that directory ($_ expands to the last argument passed to the previous … Read more

Is it possible to move/rename files in Git and maintain their history?

Git detects renames rather than persisting the operation with the commit, so whether you use git mv or mv doesn’t matter. The log command takes a –follow argument that continues history before a rename operation, i.e., it searches for similar content using heuristics. To lookup the full history, use the following command: git log –follow … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)