An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
Page 3 of 3 1 2 3
Re: Permissions for Trash
artie505 #60977 02/26/22 11:21 PM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
Do you think it will let me toss things I probably shouldn't with my new powers?

Originally Posted by artie505
Originally Posted by plantsower
If it does something I don't like, can I reverse it in Terminal? Being careful like Joe says.
I'm not authoritative about Terminal, but I don't see how this command can do anything you don't like.

The "chown" command simply changes the ownership of the targeted file, so it will either restore your lost ownership or just be a redundant affirmation of your existing ownership.


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
plantsower #60979 02/27/22 12:49 AM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Originally Posted by plantsower
Do you think it will let me toss things I probably shouldn't with my new powers?
It shouldn't enable you to do anything more than what you were originally able to do.


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Permissions for Trash
artie505 #60980 02/27/22 01:03 AM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
OK, good, because I don't always know what's allowed, though somethings just won't go in the trash, and they probably shouldn't. I try to only get rid of things that I am pretty sure are okay to get rid of. I have a folder I put on my desktop with (iffy) things I have trashed. Nothing bad has happened, so I imagine I can go ahead and trash them for good.



Originally Posted by artie505
Originally Posted by plantsower
Do you think it will let me toss things I probably shouldn't with my new powers?
It shouldn't enable you to do anything more than what you were originally able to do.


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
plantsower #60981 02/27/22 02:23 AM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
Got this message when I did the terminal thing: Operation not permitted
username@MacBook-Pro ~ %
. I did actually use my user name with the spacing you showed me.

Originally Posted by plantsower
OK, good, because I don't always know what's allowed, though somethings just won't go in the trash, and they probably shouldn't. I try to only get rid of things that I am pretty sure are okay to get rid of. I have a folder I put on my desktop with (iffy) things I have trashed. Nothing bad has happened, so I imagine I can go ahead and trash them for good.



Originally Posted by artie505
Originally Posted by plantsower
Do you think it will let me toss things I probably shouldn't with my new powers?
It shouldn't enable you to do anything more than what you were originally able to do.


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
plantsower #60982 02/27/22 04:15 AM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Please do it again, and post a command-C copy of what's on your screen.


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Permissions for Trash
artie505 #60983 02/27/22 04:40 AM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
OK, not quite understanding. I did post a Command-C copy. I just put in the word user name instead of my name. Here you go again only the whole thing.

Last login: Sat Feb 26 20:32:34 on ttys000
username@MacBook-Pro ~ % sudo chown username ~/.Trash
Password:
chown: /Users/username/.Trash: Operation not permitted
username@MacBook-Pro ~ %




Originally Posted by artie505
Please do it again, and post a command-C copy of what's on your screen.


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
plantsower #60988 02/28/22 10:15 AM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Originally Posted by plantsower
OK, not quite understanding. I did post a Command-C copy. I just put in the word user name instead of my name. Here you go again only the whole thing.

Last login: Sat Feb 26 20:32:34 on ttys000
username@MacBook-Pro ~ % sudo chown username ~/.Trash
Password:
chown: /Users/username/.Trash: Operation not permitted
username@MacBook-Pro ~ %
A wonderful example of why I ask posters to post screenshots rather than try to describe what they're seeing on their screens!

If you didn't post "the whole thing," you didn't post a copy!

In my experience, Terminal never returns an error without including a reason, and if I weren't aware of that and hadn't asked to see it, it's altogether possible that this thread would have died because of your failure to post it.

As I read it,
Code
/Users/username/.Trash
is the correct format for your command, as opposed to the
Code
username ~/.Trash
you used. (I've got no idea if it's because the command you used was formatted incorrectly by its poster or because the correct format has changed since it was posted in 2013, but giving it a second look, I see that "username ~" is redundant, because ~ means Users/username.)

The correct command for you to run, then, is, again, as I read Terminal's output,
Code
sudo chown /Users/rita.../.Trash
Fingers crossed!


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Permissions for Trash
artie505 #60989 02/28/22 04:50 PM
Joined: Aug 2009
Likes: 16
Moderator
Online
Moderator

Joined: Aug 2009
Likes: 16
As I have mentioned previously, I avoid command line tools and among the reasons I do that is the d@^* things change (and a wrong character can completely change the effect of a command) and the only clue is the date at the bottom of the man listing. That said I just looked at man chown and found there have been changes. The big difference being the addition of the —x command option and the use of a colon instead of period particularly related to the handling of symbolic links. Taken together with Rita's error message and the fact symbolic links are a huge item in Big Sur and Monterey that jumped out as a possible problem with your command version. The full text of the latest version of man chown follows with the major change highlighted.

Originally Posted by man chown
CHOWN(8) BSD System Manager’s Manual CHOWN(8)

NAME

chown — change file owner and group

SYNOPSIS

chown [−fhnvx] [
−R [−H | −L | −P] ] owner[:group] file ...
chown [−fhnvx] [ −R [−H | −L | −P] ] :group file …

DESCRIPTION

The chown utility changes the user ID and/or the group ID of the specified files. Symbolic links named by arguments are silently left unchanged unless −h is used.
The options are as follows:

−H

If the −R option is specified, symbolic links on the command line are followed and hence unaffected by the command. (Symbolic links encountered during traversal are not followed.)

−L

If the −R option is specified, all symbolic links are followed.

−P

If the −R option is specified, no symbolic links are followed. Instead, the user and/or group ID of the link itself are modified. This is the default. Use −h to change the user ID and/or the group of symbolic links.

−R

Change the user ID and/or the group ID of the file hierarchies rooted in the files, instead of just the files themselves. Beware of unintentionally matching the ‘‘..’’ hard link to the parent directory when using wildcards like ‘‘.*’’.

−f

Do not report any failure to change file owner or group, nor modify the exit status to reflect such failures.

−h

If the file is a symbolic link, change the user ID and/or the group ID of the link itself.

−n

Interpret user ID and group ID as numeric, avoiding name lookups.

−v

Cause chown to be verbose, showing files as the owner is modified. If the −v flag is specified more than once, chown will print the filename, followed by the old and new numeric user/group ID.

−x

File system mount points are not traversed

The −H, −L and −P options are ignored unless the −R option is specified. In addition, these options override each other and the command’s actions are determined by the last one specified.

The owner and group operands are both optional, however, one must be specified. If the group operand is specified, it must be preceded by a colon (‘‘:’’) character.

The owner may be either a numeric user ID or a user name. If a user name is also a numeric user ID, the operand is used as a user name. The group may be either a numeric group ID or a group name. If a group name is also a numeric group ID, the operand is used as a group name.
\
The ownership of a file may only be altered by a super-user for obvious security reasons. Similarly, only a member of a group can change a file’s group ID to that group.

If chown receives a SIGINFO signal (see the status argument for stty(1)), then the current filename as well as the old and new file owner and group are displayed.

EXIT STATUS

The chown utility exits 0 on success, and >0 if an error occurs.

COMPATIBILITY

Previous versions of the chown utility used the dot (‘‘.’’) character to distinguish the group name. This has been changed to be a colon (‘‘:’’) character so that user and group names may contain the dot character.
On previous versions of this system, symbolic links did not have owners.

The −v and −x options are non-standard and their use in scripts is not recommended.


LEGACY DESCRIPTION

In legacy mode, the −R and −RP options do not change the user ID or the group ID of symbolic links.

SEE ALSO

chgrp(1), find(1), chown(2), fts(3), compat(5), symlink(7)

STANDARDS

The chown utility is expected to be IEEE Std 1003.2 (‘‘POSIX.2’’) compliant.

HISTORY

A chown utility appeared in Version 1 AT&T UNIX.
BSD January 7, 2017 BSD

As I said this is not my area of expertise and I don't know if this is your problem or not but I thought I would pass it along, just in case confused.

Last edited by joemikeb; 02/28/22 04:57 PM.

If we knew what it was we were doing, it wouldn't be called research, would it?

— Albert Einstein
Re: Permissions for Trash
joemikeb #60991 02/28/22 06:19 PM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Originally Posted by joemikeb
As I have mentioned previously, I avoid command line tools and among the reasons I do that is the d@^* things change (and a wrong character can completely change the effect of a command) and the only clue is the date at the bottom of the man listing. That said I just looked at man chown and found there have been changes. The big difference being the addition of the —x command option and the use of a colon instead of period particularly related to the handling of symbolic links. Taken together with Rita's error message and the fact symbolic links are a huge item in Big Sur and Monterey that jumped out as a possible problem with your command version. The full text of the latest version of man chown follows with the major change highlighted.

<snip>

As I said this is not my area of expertise and I don't know if this is your problem or not but I thought I would pass it along, just in case confused.
I'm certainly no more, probably much less, of a UNIX expert than you are, but since the man page you quoted is dated March 31, 1994, and Rita is running Catalina, it looks like your concerns probably aren't relevant to her situation. (Ha! This is the first time in, literally, ages that we've actually needed Hal's, V1's, or ganbustein's UNIX knowledge.)

That said, I think it's worth taking Terminal at face value and running the command it apparently suggested on the (yeah, I know) assumption that it would have compensated for Rita's situation if necessary. The command is a pretty straightforward one that will either run with no serious consequences or fail.

Now I just hope that if it runs it does what I'm expecting it to do.


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Permissions for Trash
artie505 #60997 02/28/22 11:27 PM
Joined: Aug 2009
Likes: 16
Moderator
Online
Moderator

Joined: Aug 2009
Likes: 16
Originally Posted by artie505
but since the man page you quoted is dated March 31, 1994, and Rita is running Catalina, it looks like your concerns probably aren't relevant to her situation. (Ha! This is the first time in, literally, ages that we've actually needed Hal's, V1's, or ganbustein's UNIX knowledge.)

That said, I think it's worth taking Terminal at face value and running the command it apparently suggested on the (yeah, I know) assumption that it would have compensated for Rita's situation if necessary. The command is a pretty straightforward one that will either run with no serious consequences or fail.

Now I just hope that if it runs it does what I'm expecting it to do.

BSD Unix was initially released in 1977. Spend any time browsing "man documents and you will find the bulk of the command line code and its accompanying documentation in Monterey, particularly in the shell commands, date back to those 45 year old roots. That is the essence of Unix. Nothing is thrown out, that might break someone else's code, or lots of someone else's code. That is also why any change to those commands take years — if not generations — to work their way through the approval process and into release. As in the case of chown dealing with symbolic links, which came about many years after chown, just add an argument such as -x and rules on if and when that argument is functional and go for it. Changing colon to a period in the command can break someone else's code, but that is the sort of thing that gets "fixed" by consensus, after many many coding errors.


If we knew what it was we were doing, it wouldn't be called research, would it?

— Albert Einstein
Re: Permissions for Trash
artie505 #60998 03/01/22 02:44 AM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
Originally Posted by artie505
Originally Posted by plantsower
OK, not quite understanding. I did post a Command-C copy. I just put in the word user name instead of my name. Here you go again only the whole thing.

Last login: Sat Feb 26 20:32:34 on ttys000
username@MacBook-Pro ~ % sudo chown username ~/.Trash
Password:
chown: /Users/username/.Trash: Operation not permitted
username@MacBook-Pro ~ %
A wonderful example of why I ask posters to post screenshots rather than try to describe what they're seeing on their screens!

If you didn't post "the whole thing," you didn't post a copy!

In my experience, Terminal never returns an error without including a reason, and if I weren't aware of that and hadn't asked to see it, it's altogether possible that this thread would have died because of your failure to post it.

As I read it,
Code
/Users/username/.Trash
is the correct format for your command, as opposed to the
Code
username ~/.Trash
you used. (I've got no idea if it's because the command you used was formatted incorrectly by its poster or because the correct format has changed since it was posted in 2013, but giving it a second look, I see that "username ~" is redundant, because ~ means Users/username.)

The correct command for you to run, then, is, again, as I read Terminal's output,
Code
sudo chown /Users/rita.../.Trash
Fingers crossed!
This is the command you gave me on Feb 18th except I substituted my user name. sudo chown your_user_name ~/.Trash tilde included.


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
plantsower #61000 03/01/22 02:48 AM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
The 2nd command up is the original command you ran.

The bottom one is brand, spanking new.


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Permissions for Trash
artie505 #61001 03/01/22 02:54 AM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
So, just use this one (sudo chown /Users/rita.../.Trash) minus the parentheses and with only a space between sudo, chown and the forward slant before Users? I want to get the spacing right.


sudo chown /Users/rita.../.Trash
Originally Posted by artie505
The 2nd command up is the original command you ran.

The bottom one is brand, spanking new.


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
artie505 #61002 03/01/22 02:55 AM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
So nothing Joe said spooked you from me trying this?

Originally Posted by artie505
The 2nd command up is the original command you ran.

The bottom one is brand, spanking new.


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
plantsower #61005 03/01/22 03:34 AM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Originally Posted by plantsower
sudo chown /Users/rita.../.Trash
Thats the correct command (assuming that your name is l.c.).

No, nothing joemike has said has dissuaded me. It's basically irrelevant technical stuff mixed with his reluctance to use Terminal.

Honestly, I wouldn't be as stuck on this as I am if it weren't for my very clearly remembering your problem having come up more than once, many years ago, with the solution being a chown (change ownership) command.

And the fact that Terminal itself supplied the syntax is reassuring.


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Permissions for Trash
artie505 #61006 03/01/22 04:01 AM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
Originally Posted by artie505
Originally Posted by plantsower
sudo chown /Users/rita.../.Trash
Thats the correct command (assuming that your name is l.c.). Huh? Anyway, I entered the code into Terminal and got this:

Last login: Mon Feb 28 19:56:46 on ttys000
username@MacBook-Pro ~ % sudo chown /Users/username/.Trash
Password:
usage: chown [-fhnv] [-R [-H | -L | -P]] owner[:group] file ...
chown [-fhnv] [-R [-H | -L | -P]] :group file ...
username@MacBook-Pro ~ %

Is this what we wanted?





No, nothing joemike has said has dissuaded me. It's basically irrelevant technical stuff mixed with his reluctance to use Terminal.

Honestly, I wouldn't be as stuck on this as I am if it weren't for my very clearly remembering your problem having come up more than once, many years ago, with the solution being a chown (change ownership) command.

And the fact that Terminal itself supplied the syntax is reassuring.


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
plantsower #61007 03/01/22 09:58 AM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Originally Posted by plantsower
l.c.. Huh? Anyway, I entered the code into Terminal and got this:

Last login: Mon Feb 28 19:56:46 on ttys000
username@MacBook-Pro ~ % sudo chown /Users/username/.Trash
Password:
usage: chown [-fhnv] [-R [-H | -L | -P]] owner[:group] file ...
chown [-fhnv] [-R [-H | -L | -P]] :group file ...
username@MacBook-Pro ~ %

Is this what we wanted?
l.c. = lower case

That's not what I was expecting/hoping, anyhow, to see, nor have I got the foggiest idea what it means.

But what really counts is does your trash now work as expected?

If not, I'm throwing in the towel. frown


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Permissions for Trash
artie505 #61009 03/01/22 10:54 AM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Well, maybe not.

If your trash isn't working yet, you can try two more commands (with which I came up as a result of poking around in my own installation):

sudo chown /Users/username/.Trashes (es added at the end of .Trash) I don't have much faith in this one.

sudo chown /Users/username/Trash (dot preceding Trash deleted) This one may be the answer.

Yeah, I am casting about here, but not dangerously, because I'm not messing with the essence of the command, just its object.


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Permissions for Trash
artie505 #61010 03/01/22 04:54 PM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
If not, I'm throwing in the towel. frown [/quote] Into the trash? smirk


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
artie505 #61011 03/01/22 04:55 PM
Joined: Sep 2009
Likes: 3
OP Offline

Joined: Sep 2009
Likes: 3
It seems to work for some things and not others. Not having any trouble yet, so I will save those commands for if it comes in again. Thanks, Artie!


Originally Posted by artie505
Well, maybe not.

If your trash isn't working yet, you can try two more commands (with which I came up as a result of poking around in my own installation):

sudo chown /Users/username/.Trashes (es added at the end of .Trash) I don't have much faith in this one.

sudo chown /Users/username/Trash (dot preceding Trash deleted) This one may be the answer.

Yeah, I am casting about here, but not dangerously, because I'm not messing with the essence of the command, just its object.


MacBook Pro - M2, Ventura 13.6
Safari Tech Prev 17.0
Safari 16.6
Firefox 116.0.2
iPhone 7 Version 15.8




Re: Permissions for Trash
artie505 #61031 03/03/22 02:55 AM
Joined: Aug 2009
Likes: 3
Moderator
Offline
Moderator

Joined: Aug 2009
Likes: 3
Looks to me like the format of the command requires a subject (the owner) AND an object (the file). Hence

chown [-fhv] [-R [-H | -L | -P]] owner[:group] file ...

Since none of the bracketed options are being employed, subtracting them for clarity leaves

chown owner file ...

which accounts for what you took as the redundancy of your_user_name and ~ both appearing in the original command: ~/.Trash is the file path.

That said, I have (sadly) no contribution to make regarding the failure of the original command to produce the desired result, being savvy about neither file ownership nor Terminal. I do think you're perhaps being a tad blithe about the dangers of command line experimentation as the superuser, though.

Last edited by dkmarsh; 03/03/22 03:13 AM. Reason: replaced Users/username with your_user_name


dkmarsh—member, FineTunedMac Co-op Board of Directors
Re: Permissions for Trash
dkmarsh #61212 03/23/22 11:09 AM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
In a stunning display of utter contempt for the laws of physics, this has escaped from the black hole commonly known as my to-do list.

Thanks for translating that Terminal response into English. After digesting it, it occurred to me to examine the Catalina clone I saved to see if I could learn anything about why the original command didn't run.

And it turned out that there's no such path, in my macOS 10.15.7 installation, anyhow, as ~/.Trash.

The only path to trash is /Volumes/XYZ/.Trashes.

I'm officially dead-ended!

(I'm also confused about why my running the original command returns
Code
Last login: Wed Mar 23 06:55:37 on ttys000
artie@Artie's-MacBook-Pro-2 ~ % sudo chown artie /Volumes/HDza/~/.Trash   
Password:
chown: /Volumes/HDza/~/.Trash: No such file or directory
artie@Artie's-MacBook-Pro-2 ~ % 
rather than the
Code
chown: /Users/username/.Trash: Operation not permitted
that Rita reported.

I'd love to be able to look over her shoulder!)


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Page 3 of 3 1 2 3

Moderated by  alternaut, dianne, MacManiac 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.043s Queries: 59 (0.030s) Memory: 0.7109 MB (Peak: 0.8912 MB) Data Comp: Zlib Server Time: 2024-04-18 04:14:17 UTC
Valid HTML 5 and Valid CSS