Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
i guess my goal is mainly being able to alter plists and stuff to make tweaks on macOS i'm not perfectly fine with, bypass some restrictions that prevent me from doing things like cleaning my system from "unnecessary" protectecd files, removing certain processes from running and starting altogether, etc.,
defaults read / write is usually all you need. For more complex tasks, look into plutil or PlistBuddy.
For disabling processes, launchctl disable. Example and brief explanation
https://gist.github.com/b0gdanw/40d000342dd1ba4d892ad0bdf03ae6ea
 
  • Like
Reactions: chengengaun
defaults read / write is usually all you need.
thanks, that's what i thought too.
with that statement i just wanted to clarify that i don't necessarily plan to become a UNIX guru, but learn it enough to be able to hopefully get around most of the limitations of macOS's GUI side of things myself at one point, or at the very least, understand beforehand what some google searched instructions actually do.

For disabling processes, launchctl disable. Example and brief explanation
https://gist.github.com/b0gdanw/40d000342dd1ba4d892ad0bdf03ae6ea

thanks, a while ago i've found one of your posts when you were helping someone else out to disable Universal Control 👍

this link here seems to be some kind of batch process to disable a whole lot of things at once?

i also noticed that you mention the corresponding plists that will store the changes that you also have a disabled.205.plist, which i'm "lacking"
i'd hazard a guess that these are "user priority levels"?. google seemed to show that 501 is admin level on Mac, i think 0 would be root, but what is 205?

sorry for the bombardment with questions 😇

(please take your time, i'm not in a hurry!) 🤡
 
this link here seems to be some kind of batch process to disable a whole lot of things at once?

i also noticed that you mention the corresponding plists that will store the changes that you also have a disabled.205.plist, which i'm "lacking"
Yes, that script disables the included Launch Agents and Daemons from starting. I would not advise you to use it, just treat it like a list of what can be disabled. For example, if you use a laptop, you will not want to disable Wi-Fi functionality (com.apple.wifi.WiFiAgent and the rest).

Sorry about the 205 mention, I forgot to remove that after the last revision. It was from a previous test version that included launchctl disable user/205/com.apple.geod to disable location services.
501 is the User ID for the first admin account created https://support.apple.com/en-au/HT201548
 
It's just another way for what @MisterSavage and @mfram suggested in posts 19 and 20.
You can open and edit ~/.zshrc in TextEdit with
Code:
open -e ~/.zshrc
or you can edit it directly from Terminal
Code:
nano ~/.zshrc
 
yes, i noticed that that .zshrc file had been mentioned before.
I just couldn't find it at that time, so i assumed that i was just looking in the wrong place, or did something else wrong.
judging by the date of it, it seems that that file had just been created after i entered your instructions though?

I'm daft at times, so i might very likely be wrong (and blind too in this case) of course 😳

regarding that .zsh_history file that i also found in that directory, does it have a cap limit of instructions, or will it grow bigger and bigger, until it will eventually have millions of lines?

(i assume it is safe to clear it from time to time to prevent it from blowing out of proportion?)
 
yes, i noticed that that .zshrc file had been mentioned before.
I just couldn't find it at that time, so i assumed that i was just looking in the wrong place, or did something else wrong.
judging by the date of it, it seems that that file had just been created after i entered your instructions though?

I'm daft at times, so i might very likely be wrong (and blind too in this case) of course 😳

regarding that .zsh_history file that i also found in that directory, does it have a cap limit of instructions, or will it grow bigger and bigger, until it will eventually have millions of lines?

(i assume it is safe to clear it from time to time to prevent it from blowing out of proportion?)

So generally speaking config files will go into your home directory. When that's the case you can use this syntax:

ls -l ~/.zshrc

You can also to this to go there:

cd ~

And do this to go back

cd -
 
I mainly use it for "ping" and "ifconfig" commands--also traceroute.... those are handy with the terminal.
 
So generally speaking config files will go into your home directory. When that's the case you can use this syntax:

ls -l ~/.zshrc

You can also to this to go there:

cd ~

And do this to go back

cd -

yes, that's where i had been looking

google search also seems to indicate that it's not there from the get go at least on Mac and presumably needs to be created manually first?
 
google search also seems to indicate that it's not there from the get go at least on Mac and presumably needs to be created manually first?
Yes, ~/.zshrc isn’t created by macOS as part of the initial user configuration. But it’s recognized by the Terminal app and can be used to personalize it.
To create an empty file:
Code:
touch ~/.zshrc
or
Code:
echo > ~/.zshrc
To add content to an existing file
Code:
echo "some text" >> ~/.zshrc
Notice the difference between > and >>. One > overwrites the content of the file, two >> add the specified content to the file.
To quickly view the content in Terminal
Code:
cat ~/.zshrc
More details https://osxdaily.com/2021/11/18/where-the-zshrc-file-is-located-on-mac/

Regarding ~/.zsh_history, I don’t know the exact number of lines or dimensions of the full file, but at some point the history is automatically transferred to the ~/.zsh_sessions folder.
You can delete the file and the folder if you want.
 
Notice the difference between > and >>. One > overwrites the content of the file, two >> add the specified content to the file.
thanks, that was the first question i had in mind, when i saw just one > in that first echo example instead of the two in that write alias to the zshrc file you helped me with before, which sure would had been confused me for a good while, if not posing an impossible puzzle to overcome myself at all. 😂

Regarding ~/.zsh_history, I don’t know the exact number of lines or dimensions of the full file, but at some point the history is automatically transferred to the ~/.zsh_sessions folder.

Good to know, thanks. i'll have my OCD under control for now and only clear that, should i happen to see the Terminal history size taking some "serious GB" of disk space 😂
 
sorry for coming up with yet another question:
why is it that i'm getting an "operation not permitted" while doing a simple ls command (even when sudo'ed) in some directories?
i can view these easily in Finder!
 
Operations to files in certain folders are disabled by System Integrity Protection (SIP). You can also check if your Terminal app has Full Disk Access permission.
 
Operations to files in certain folders are disabled by System Integrity Protection (SIP).

yes, but why would it work in Finder?

You can also check if your Terminal app has Full Disk Access permission.
not sure if this has been the correct method for this, but ls -l shows
drwxr-xr-x 3 root wheel 96 14 Jul 10:48 Terminal.app/

shouldn't this be good enough, or do i have to look somewhere else?

the affected "unviewable" folders (inside Terminal only, as Finder has no trouble at all with this) also look not too much different permission wise than others i'm having no trouble listing.
example:
unviewable folder: ~/.trash
viewable folder: ~/..zsh_sessions

permissions for both:
drwx------+ 2 user staff 64 5 Aug 22:54 .Trash/
drwx------ 390 user staff 12480 7 Aug 11:55 .zsh_sessions/

the only difference seems to be the + for the trash folder, but i'm having no trouble ls-ing the ~/Downloads folder, which is having exactly the same attributes using ls -l as the "unviewable" trash folder
 
ah ok, that makes sense (a bit), as i'm not even trying to do some write / remove command, only some harmless reads?

but ok, seems to be the case for folders considered system critical, even though i'm not inclined atm to try CMD/backspace .Trash from Finder just to find out if it has higher priorities for that (i'm a ***** 😳)

but very good to keep that full disk access thingie in mind, should i be in need for that at one point. will leave it as it is for the moment though. thanks both!
 
  • Like
Reactions: chengengaun
I mainly use it for "ping" and "ifconfig" commands--also traceroute.... those are handy with the terminal.
This is a great point. When your Internet is "down" it might actually be up and be a DNS issue. You can trying pinging an address to see if you still connectivity. I use 8.8.8.8, which is for Google DNS. If you can ping that but can't resolve names then you know more for investigating the issue.
 
  • Like
Reactions: eltoslightfoot
ah ok, that makes sense (a bit), as i'm not even trying to do some write / remove command, only some harmless reads?
TCC = transparency, consent, and control
https://support.apple.com/guide/security/secddd1d86a6/web
This is a great point. When your Internet is "down" it might actually be up and be a DNS issue. You can trying pinging an address to see if you still connectivity. I use 8.8.8.8, which is for Google DNS. If you can ping that but can't resolve names then you know more for investigating the issue.
host, nslookup & dig

Code:
nslookup google.com
returns the IP of google.com as resolved by the current DNS server set on the system
Code:
nslookup google.com 1.1.1.1
asks CloudFlare what IP google.com has.

To change the DNS servers from Terminal for Ethernet
Code:
networksetup -setdnsservers Ethernet 8.8.8.8 8.8.4.4
Code:
networksetup -setdnsservers Ethernet 1.1.1.1 1.0.0.1
for Wi-FI
Code:
networksetup -setdnsservers Wi-FI 8.8.8.8 8.8.4.4
Code:
networksetup -setdnsservers Wi-FI 1.1.1.1 1.0.0.1

Cloudflare DNS Servers https://1.1.1.1/dns/
1.1.1.1
1.0.0.1
1.1.1.2 (No Malware) & 1.1.1.3 (No Malware or Adult Content)
https://blog.cloudflare.com/introducing-1-1-1-1-for-families/
OpenDNS https://www.opendns.com/setupguide/
208.67.222.222
208.67.220.220
OpenDNS FamilyShield https://www.opendns.com/setupguide/?url=familyshield
208.67.222.123
208.67.220.123
Quad9 DNS https://www.quad9.net
9.9.9.9
 
TCC = transparency, consent, and control ...

lots of info to swallow for a complete noob! (both in your linked video and your own notes) 😱

still looks like some pretty awesome (if a bit overwhelming) stuff to learn one thing or two... if i just re-watch it enough (a couple of dozen) times 😂

as always: 👍
 
lots of info to swallow for a complete noob! (both in your linked video and your own notes) 😱

still looks like some pretty awesome (if a bit overwhelming) stuff to learn one thing or two... if i just re-watch it enough (a couple of dozen) times 😂

as always: 👍
Yep, but it can be super helpful. Last time I thought I was having an Internet outage I figured out it was a DNS issue. Pointed my router to a different set of DNS servers and *BAM*, problem fixed.
 
lots of info to swallow
The main thing worth remembering about TCC is how to reset it.

- reset all permissions

Code:
tccutil reset All

- reset Contacts

Code:
tccutil reset AddressBook

- reset Microphone

Code:
tccutil reset Microphone

-reset Camera

Code:
tccutil reset Camera

- reset Full Disk Access

Code:
tccutil reset SystemPolicyAllFiles

- reset permissions for an app, example Terminal

Code:
tccutil reset All com.apple.Terminal
 
you’re awesome!

(That vid definitely had quite a lot of great info too, but for a noob with no previous knowledge quite a lot in a very short time to (fully) comprehend) 👍
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.