Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about programming within the scope defined in the help center.
Improve this question
I have an bundle directory with full permissions (777) (includeing subdirectories)
whenever I copy it to another directory using cp -r I see that it loses some of its permissions.
What is the cause of that and how can I move this bundle while keeping its permissions intact?
I have a Lion version.
Thank You
Use the -p flag:
cp -Rp whatever whereever
From the cp manpage:
Cause cp to preserve the following attributes of each source file
in the copy: modification time, access time, file flags, file mode,
user ID, and group ID, as allowed by permissions. Access Control
Lists (ACLs) and Extended Attributes (EAs), including resource
forks, will also be preserved.
If the user ID and group ID cannot be preserved, no error message
is displayed and the exit value is not altered.
If the source file has its set-user-ID bit on and the user ID can-
not be preserved, the set-user-ID bit is not preserved in the
copy's permissions. If the source file has its set-group-ID bit on
and the group ID cannot be preserved, the set-group-ID bit is not
preserved in the copy's permissions. If the source file has both
its set-user-ID and set-group-ID bits on, and either the user ID or
group ID cannot be preserved, neither the set-user-ID nor set-
group-ID bits are preserved in the copy's permissions.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 12 months ago.
Improve this question
This maybe easy on linux users, but I am having a hard time figuring out how to delete multiple files (partial files) using wildcard.
sudo rm logs/archived/remove_me.2022.* or sudo rm logs/archived/remove_me.2022.? seems not to work.
I am getting the error rm: cannot remove 'logs/archived/remove_me.*': No such file or directory
I am currently on /var/lib/tomcat8/ trying to remove these logs inside logs/archived.
I am remove them one by one but there are a lot of files to remove .. (example. from 2020 and there are daily and in partial files).
Example I am inside /var/lib/tomcat8/logs/archived/ and I want to remove all log files starting with remove_me.2021.*
Below are the sample list of files that I want to remove.There are also other files in this directory that should not be removed.
remove_me.2022-03-02.1.log.gz
remove_me.2022-03-02.2.log.gz
remove_me.2022-03-02.3.log.gz
remove_me.2022-03-02.4.log.gz
remove_me.2022-03-02.5.log.gz
remove_me.2022-03-03.1.log
remove_me.2022-03-03.2.log
remove_me.2022-03-03.3.log
remove_me.2022-03-03.4.log
remove_me.2022-03-03.5.log
remove_me.2022-03-03.6.log
remove_me.2022-03-03.7.log
remove_me.2022-03-03.8.log
remove_me.2022-03-03.9.log
remove_me.2022-03-03.10.log
I believe the issue here is that the asterisk (*) is resolved by the current user, i.e., before becoming the superuser. Hence, it resolves to nothing, because the current user is not able to even read that directory.
Solve this by becoming superuser first, and then doing everything normally:
sudo -i
cd /var/lib/tomcat8/logs/archived/
rm remove_me.2022.*
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I have a file running from this directory:
C:\Windows\Fonts\com4.{208d2c60-3aea-1069-a2d7-08002b30309d}, When I want to open that directory it says System cannot find the specified path and when I want to delete the file inside that folder with PowerShell, it says Access Denied!
How can I delete the file and folder?
COM4 is a special reserved 'DOS Device' name. Files or Folders with these types of names can not be created or accessed by normal means. Also the appended string .{208d2c60-3aea-1069-a2d7-08002b30309d} is the Shell CLSID for My Network Places, It will cause the folder with this appended sting to appear as such in Windows Explorer to hide the contents.
It can be renamed to a normal name so it can be be accessed afterwards. But since it is located in the system folder C:\Windows\Fonts, Administrative rights are needed for doing so.
In an elevated Command Prompt (CMD.EXE) this command can be used to rename the folder
ren "\\.\C:\Windows\Fonts\com4.{208d2c60-3aea-1069-a2d7-08002b30309d}" "NewName"
But for the rename to be successful, any program(Most probably a malware as you mentioned) that is running from this folder must be terminated beforehand.
A malware can have other protections mechanisms to prevent you from doing any of the above actions or easily undo what you have done, So you should protect your system with an updated Antivirus product and keep it updated until it is detected and removed completely.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
The default Shared folder in MacOSX does not seem to live up to its name. Sure, all users on the local Mac can create folders and add files to the Shared folder, however other users cannot open the files or make any changes, unless it is files & folders they created/added.
Using the permissions GUI (ACLs and POSIX), I failed to find a solution to my needs which are essentially to make the Shared folder a place where all local Mac users (or a subset of users) have full permissions.
I am hoping that someone would have a suggestion.
Cheers
You can't do this with the GUI; it doesn't allow you to control (or even see) some of the necessary settings. So you need to use the Terminal, and run some chmod (change "mode", i.e. change permissions), and you need to use sudo to run them with root permissions (note that sudo will prompt for your admin password to allow this, but the password won't echo as you type). Also, be careful with these commands (or anything else involving sudo) -- the specific commands I'll give you should be safe, but if you change the wrong permission on the wrong file, you can completely break the OS.
You need to do two things: remove the "sticky" bit (which prevents users from deleting/moving/renaming other users' files):
sudo chmod -t /Users/Shared
Then add an inheritable ACL granting everyone full read+write access. The Finder's Get Info window will let you add ACLs, but not control inheritance, so again you use sudo chmod ... and include a long list of exactly what types of file access need to be allowed:
sudo chmod +a "group:everyone list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" /Users/Shared
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I was editing an emacs file abc, and prior to saving, had a crash. There is now a file .#abc, and I would like to find out what is in that file, to perhaps recover what I was working on.
I know the file is there because when I type
ls -a
it lists
.#abc
However, when I type
more ".#abc"
or simply
more .#abc
I get the error
.#abc: No such file or directory
The same error occurs with cp in place of more.
How do I see what is in that file? Why does ls list it and then other commands can't find the file?
(Is .#abc actually an alias file? If so, how would I know that? And how, nevertheless, do I see the content of it, even if this is only what it is an alias to?)
[Note: I do not want to use emacs to try to find out what is in the file or restore it, because the situation is somewhat more complicated than described: the above is all occurring inside a Time Machine backup, which I need to access because of an emacs autosave overwrite problem on the primary file. I don't want to have the same problem occur on the backup of the autosave file!]
This is all on Mac OS10.8.4.
Whereas autosave files use a tilde ~, lock-files use a dot number-sign .#:
http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Locks.html
Creation of lock-files can be disabled with the following setting:
(setq create-lockfiles nil)
https://stackoverflow.com/a/12974060/2112489
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I'm trying to change a folder to read and write but everytime i check it again its read only
the folder is the oracle db home. When i untick read-only it it applies it but when i press ok check it again it's read-only
anyone know a solution?
i've got windows xp
The read-only attribute on folders doesn't actually mean the folder is read-only.
It doesn't mean anything much at all to the filesystem but it is used by the Windows shell, and maybe other applications, as a tag. For example, the Windows shell will only look for a Desktop.ini file if a folder has the read-only attribute set. (Thus the attribute allows it to avoid the lookup if it is missing, since the lookup can be quite slow on network drives.)
Unless you have a reason to care about the attribute the solution is to ignore it and let whatever is setting it have its way. It's probably setting it for a reason.
On the other hand, the read-only attribute on files is significant.