I have Cygwin installed on Windows 7 in a windows domain sign-on environment. I can run most typical commands without issue, but I cannot for the life of me use the "mv" command to move or rename files, regardless of the file or directory.
I can copy and create files without issue.
┌─[12:27:57]─[mbutl2@MYHOSTNAME]
└──> tmp $ >> pwd
/tmp
┌─[12:27:58]─[mbutl2@MYHOSTNAME]
└──> tmp $ >> touch test.txt
┌─[12:28:02]─[mbutl2@MYHOSTNAME]
└──> tmp $ >> mv test.txt hello
-bash: /usr/bin/mv: Permission denied
I have already tried running Cygwin terminal as Administrator and the problem is the same.
I'm open to workarounds, such as trying another exe for moving files and redirecting the mv command to it. Moving files works in the Windows Command Prompt.
UPDATE: It appears that there may be a security restriction on my laptop that either prevents accessing/copying/executing the "mv.exe" program by its name or by its heuristics. Still willing to accept workarounds that replace the mv command as mentioned above.
UPDATE 2: Screenshots in windows command line and when I open mv.exe in Windows.
UPDATE 3: output of file
command:
┌─[12:36:09]─[mbutl2@MYHOSTNAME]
└──> ~ $ >> file /usr/bin/mv
/usr/bin/mv: writable, executable, regular file, no read permission
┌─[12:36:15]─[mbutl2@MYHOSTNAME]
└──> ~ $ >> chmod 777 /usr/bin/mv
chmod: changing permissions of `/usr/bin/mv': Permission denied
┌─[✗]─[12:36:29]─[mbutl2@MYHOSTNAME]
└──> ~ $ >> mv
-bash: /usr/bin/mv: Permission denied
┌─[✗]─[12:36:35]─[mbutl2@MYHOSTNAME]
└──> ~ $ >>
ldd
also reports permission denied.
Best Answer
See if the file has been blocked by Windows.
Check the
properties
of the file, there may be a note sayingThis file came from another computer and might be blocked to help protect this computer
To check for and unblock the file, follow these steps: Right-click the blocked file and then clickProperties
. In the General tab, clickUnblock
if the option is available.Check to see if your antivirus is blocking the file.
You can check to see if your antivirus software is blocking a file by temporarily disabling it, and then trying to open the file.
Update:
Properties
.Security
tab.Result:
Update 2:
Try this:
Properties
.Security
tab.Advanced
.Owner
tab.Edit
.Replace owner on subcontainers and objects
.OK
.