rename

Move usr/bin/java in Terminal

落爺英雄遲暮 提交于 2019-12-19 05:23:07
问题 After updating to OS X 10.11, my java stopped working. I read multiple places that I should do a: sudo mv /usr/bin/java /usr/bin/java.old sudo ln -ns /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin/java But the issue is when I run the first line of code, I just get: mv: rename /usr/bin/java to /usr/bin/java.old: Operation not permitted Any ideas what I can do to fix this? 回答1: Seems like the problem with the new System Integration Protection (a.k.a rootless

Rename files by reordering pattern in bash

左心房为你撑大大i 提交于 2019-12-19 04:25:54
问题 I have a pdf files in the format: Author-YYYY-rest_of_text_seperated_by_underscores.pdf John-2010-some_file.pdf Smith-2009-some_other_file.pdf I need to rename the files so that the year is first e.g. YYYY-Author-rest_of_text_seperated_by_underscores.pdf 2010-John-some_file.pdf 2009-Smith-some_other_file.pdf So that would mean moving the 'YYYY-' element to the start. I do not have unix 'Rename' and must rely on sed, awk etc.I happy to rename inplace. I have been trying to adapt this answer

Rename extracted file based on zip file in Batch

淺唱寂寞╮ 提交于 2019-12-19 03:31:34
问题 I have multiple zip files with names such as 001.zip, 002.zip, 003.zip and have the potential to go up to 999.zip. Each zip file has exactly one text file. I would like to extract each zip file using Batch, and then rename the text file it extracted to the file name of the zip. For example, if I extract 001.zip, I want the text file that gets extracted (all the text files that get extracted have different names) to be name 001.txt. I at least am extracting all the files right now, but I am

Renaming a File() object in JavaScript

本秂侑毒 提交于 2019-12-18 18:53:58
问题 I'd like for my users to be able to re-name a file before uploading it. I have a File object in Javascript which has a name property that is already set, but i'd like for this to be able to be updated. Right now doing the obvious myFile.name = "new-name.txt" returns an error that this property is read only. What's the best way of changing the name property on a JavaScript File object? 回答1: You can add an input tag with the name on it and hide the name property from the user. On the server,

How to rename a file in .NET?

我的未来我决定 提交于 2019-12-18 18:34:14
问题 Using System.IO.File or another .NET class, what is the best way to rename a file? I want to be able to rename files on local drives or on network locations. If using System.IO.File , is Move the best way? 回答1: Alternatives System.IO.File.Move You can rename a file with System.IO.File.Move like this: var sourcePath = @"C:\folder\oldname.txt"; var destinationPath = @"C:\folder\newname.txt"; File.Move(sourcePath, destinationPath); You may be interested in keeping the same location and just

NodeJS笔记: 文件操作大全

断了今生、忘了曾经 提交于 2019-12-18 18:27:03
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 文件I/O fs模块的基本用法 开发中我们经常会有文件I/O的需求,node.js中提供一个名为fs的模块来支持I/O操作,fs模块的文件I/O是对标准POSIX函数的简单封装。 writeFile函数的基本用法 文件I/O,写入是必修课之一。fs模块提供writeFile函数,可以异步的将数据写入一个文件, 如果文件已经存在则会被替换。用法如下: 例: fs.writeFile(filename, data, callback) var fs= require("fs"); fs.writeFile('test.txt', 'Hello Node', function (err) { if (err) throw err; console.log('Saved successfully'); //文件被保存 }); appendFile函数的基本用法 writeFile函数虽然可以写入文件,但是如果文件已经存在,我们只是想添加一部分内容,它就不能满足我们的需求了,很幸运,fs模块中还有appendFile函数,它可以将新的内容追加到已有的文件中,如果文件不存在,则会创建一个新的文件。使用方法如下: 例: fs.appendFile(文件名,数据,编码,回调函数(err)); var fs= require(

Change filenames to lowercase in Ubuntu in all subdirectories [closed]

北城以北 提交于 2019-12-18 11:04:39
问题 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 7 years ago . I know it's been asked but what I've found has not worked out so far. The closet I came is this : rename -n 'y[A-Z]/[a-z]/' * which works for the current directory. I'm not too good at Linux terminal so what should I add to this command to apply it to all of the files in all the sub-directories from which I am

How to rename an SVN branch and update references in an existing sandbox?

只谈情不闲聊 提交于 2019-12-18 10:48:07
问题 I needed to rename a SVN branch, so I did: $ svn move https://server/repos/myrepo/branches/oldbranch \ https://server/repos/myrepo/branches/newbranch So far, so good -- the branch has been renamed. The trouble is, we have existing sandboxes checked out from this branch and when I try to update I get this error: $ svn update svn: Target path '/branches/oldbranch' does not exist A fairly self-explanatory error. After a quick search I thought I had found the solution: Relocating SVN working copy

git rename many files and folders

匆匆过客 提交于 2019-12-18 10:40:46
问题 I am trying to rename many files in my application and need to be able to do a rename in all subdirectories from the app root through git (i.e. git mv %filenamematch% %replacement%) that only replaces the matching text. I'm no good with bash scripting though. update: would be good it if also renamed directories that match as well! 回答1: This should do the trick: for file in $(git ls-files | grep %filenamematch% | sed -e 's/\(%filenamematch%[^/]*\).*/\1/' | uniq); git mv $file $(echo $file |

How to rename git root folder?

◇◆丶佛笑我妖孽 提交于 2019-12-18 10:17:41
问题 I've just started using git in Vista, with my repository under /path/to/project/git repo . I've now found that the space in the folder name is a minor irritation when working in git bash. Can I just rename the folder to /path/to/project/gitrepo ? Is everything within the git config relative, or is there anything that explicitly refers to the parent folder? I've tried just taking a windows copy of the main folder, and run git bash on that, and 'git log' shows the changes I had previously made.