Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
i became curious if it is possible to curl a website incl. all linked pages into a working (set of) offline .html?

I did some Googling and what I can see the curl utility won't really do that. That isn't in its feature set. But there is a tool called 'wget' which can do that. Unfortunately it isn't included in MacOS by default. So you'd either have to compile this tool yourself (probably not in the scope of your skills) or maybe it's part of the 'homebrew' system which is a way to install more command-line tools for Macs in an easier way. Look for it if you want to spend more time in the shell.

For everyone on this thread, having a Unix command-line shell on MacOS is a big bonus to old Unix-heads like myself. I've been using Linux systems on the command line for almost 30 years and the same skills mostly apply to the MacOS shell as well. I used NeXTStep systems back in the day and they were even more obviously a Unix workstation. MacOS is a direct descendant of NeXTStep but it tries very hard to hide the Unix underneath.

You will find a lot more information on the web about using the Unix shell on Linux systems because it is currently the most popular version of Unix-like systems. Most of the information on those pages will apply to MacOS except that MacOS has a different filesystem layout compared to Linux systems. The shell concepts are the same (pipes, common Unix utilities, etc). Commands like 'sed', 'ls', 'grep', 'find', etc. It's all the same.
 
i became curious if it is possible to curl a website incl. all linked pages into a working (set of) offline .html?
I don’t think you can do that easily with curl.
But you can download the page

Code:
curl -L https://www.howtogeek.com/312671/what-is-this-process-and-why-is-it-running-on-my-mac/ -o process.html

open it in the default browser

Code:
open ./process.html

I'm using MacOS Mojave and the Spotlight icon is displayed in the Menubar. I would like to delete this icon, but it cannot be done in the usual way.
Apple: “To remove an icon, press and hold the Command key and drag the icon out of the menu bar.”
https://support.apple.com/guide/mac-help/menu-bar-mchlp1446/10.14/mac/10.14
 
I don’t think you can do that easily with curl.
But you can download the page

yes, direct downloads and opening them (files also), has been pretty straight forward, even for me.
was just wondering what else you could do with that command.
judging by the scope of the manual, there's probably a lot more to it, but i didn't find something that would suggest "fetch whole websites"

But there is a tool called 'wget' which can do that.
yes, found out about wget by google too (and that it's not installed on my system 😂)

it's not too important for me (yet), i just want to learn my tools better and thought that would be an interesting feature

maybe it's part of the 'homebrew' system which is a way to install more command-line tools for Macs in an easier way.
now that you mention it, i had been considering downloading Apple's Command Line Developer Tools, but a quick googling showed that those tools are mostly aiming for coding / debugging / compiling, etc. (who would have thought! 🤡)

that brew thingie also looked impressive and you could probably get anything by that 🤘
but i'm not sure yet, what i'd actually need atm... any suggestions for something that are greatly helpful for general system managing / cleaning / tweaking that does not involve programming languages and tools for those?

at the moment i'm only eyeing on youtube-dl 😇

Look for it if you want to spend more time in the shell.

oh, i most certainly will!
it's very powerful, has some great tools that are not achievable by the GUI, or simply would require downloading some pretty specific apps for stuff that is already there by some command lines.
 
Yes, this I know, but not working for Spotlight icon.
Sorry, I forgot it didn’t work in Mojave.
There are some solutions from Terminal https://apple.stackexchange.com/a/58866
but you can use Deeper https://www.titanium-software.fr/en/deeper.html
You have to disable SIP first https://developer.apple.com/documen...ling_and_enabling_system_integrity_protection
Deeper.jpg
 
Sorry, I forgot it didn’t work in Mojave.
There are some solutions from Terminal

lol, simply rename that file?
i would have thought that something like that would give you an error message for "file <x> missing / could not be loaded" 😳
 
wow, just found out in another thread that you can write the results of quite a few commands into a file by "> file"

("top" or "netstat" didn't seem to work though, even with my miserable attempts to pipe into "> file" 🤪)

you (bogdanw) already mentioned this with "echo something > (>>) file", but i thought that the echo was the write instruction required for this, but it didn't occur to me that you could use something like "ls >> file" "date >> file" etc.
my mind is officially blown now! 😱
(though i'm still easily impressible at this point 😂)
 
The shell concepts are the same (pipes, common Unix utilities, etc). Commands like 'sed', 'ls', 'grep', 'find', etc. It's all the same.

Agreed re Linux vs MacOS, but want to put a finer point on it for newbies to shells/command line.

In general, the knowledge crosses OS boundaries, however, need to be aware that the commands can have some differences in options. In the Linux vs MacOS situation, Linux will at times have more options in a command vs the same command on MacOS. Or have a command that only exists in Linux. Same kind of things happens when going between Unix flavors.

So a script written for one environment might be 98% compatible with another, just need to tweak a switch and or command or two. Where one might run into the problem, and be aware of, is when finding an example/sample code online for Linux and it does not work on MacOS.

Ditto when it comes to shells. sh/ksh/bash/zsh have a shared similarity, but are different. Similar enough for basics, but will have differences that might need to deal with when moving from one shell to another.

And then you have csh/tcsh which is C language like (and scripts for it are not usable in the sh derivative family) but some of their functionality is copied into bsh/zsh.
 
but a simple "defaults read | grep adguard" gives me two findings
I’m not even sure what “defaults read” does, it reads all the preference files for the user? That’s not helpful.
You probably still have an AdGuard plist file in ~/Library/Preferences
You can use find ~/Library/Preferences -iname "*AdGuard*" or just search in Finder.
 
thanks, "find" didn't find anything though, and neither did Finder, even with system files included
 
reboot didn't help and both greps didn't find anything either

"defaults read" <RETURN> will still give me quite an extensive list, including both strings attached

no biggie though, as i'm still having my OCD under control atm (sorta)
and won't make a clean install of macOS... as of yet! 👍
 
Just forget about defaults. Yes, it's MacOS registry-y thing. The values you are seeing are domain names: "sandbox" names specific to vendors and apps, so that programs don't step onto each other.

Eg. there is com.apple.Mail for Mail, com.apple.Music for Music, com.google.Chrome for Chrome.

So to get rid of those values, need to know the domain it is under and then know the key that those strings are under. And not hurting anything if left.
 
knew about domains being used for default reads/writes, but right at the beginning when i "learned" about "defaults" i just typed defaults read + enter and found this.
just for giggles i did this again, after i deleted that Safari extension and didn't find any remaining traces otherwise
(other than in my installation history in about this Mac and system_profiler)

Though i have no clue where these info by just "defaults read" come from, so i thought that this must be some kind of "master" defaults list that's accessed that way.
but who knows, maybe it's still a collection of some other .plists somewhere.

but don't worry, i won't be losing sleep over this, was just curious 👍
 
noob assumption alert: but i'm beginning to think that the required plist(s) are simply still hidden from me.
i've found a folder (there are probably more too) that i can't access via finder (shows 0 bytes size there) or sudo cd / ls via terminal

only "du" seems to find something - a ton actually


in case anyone is still interested in my delusional thoughts:
"sudo du /private/var/root"for instance is giving me tons of possible findings listed, i can't seem to get otherwise
not sure if using csrutil, chown, chflags, chmod, xattr, or whatever would help, but i'll leave it at that for the moment, but Terminal has full disk access enabled for that matter


edit: weird. i can now sudo ls /private/var/root/, which i think gave me a 'permission denied' before?
not sure if \ls fixed this, as i'm having '-la -F -G" aliased to ls
but this way i just noticed that sudo ignores standard command aliases 🤡
 
i became curious if it is possible to curl a website incl. all linked pages into a working (set of) offline .html?

the man page for curl is quite gargantuan and i'm having a feeling that it might also not work on it's own without piping into some other command(s)?

(not of utmost importance, as i can easily view that site online, but still... 🤪)

Try httrack.

To download a website (and in my case ensure pdf files also were downloaded):

noglob httrack https://website-URL/ -W -O "/Users/your-home-dir/Documents" -%v +*.pdf

To make my situation more complex, the website required I log in first. I had to log in using my browser, extract the cookies into "cookies.txt" and place that into the directory I ran httrack from.
 
In general, the knowledge crosses OS boundaries, however, need to be aware that the commands can have some differences in options. In the Linux vs MacOS situation, Linux will at times have more options in a command vs the same command on MacOS. Or have a command that only exists in Linux. Same kind of things happens when going between Unix flavors.

So true, especially when you can be using a stripped down version of a command. A Busybox version of a command on an embedded Linux OS comes to mind immediately.
 
maybe i should wipe my old Win 7 laptop's SSD and put some Linux on instead 🤘
though sometimes having Windows can still be useful though 🙈
 
ok, after sudo ls finally worked for me in that root directory, i found parts of what i've seen with "defaults read + enter" inside /private/var/root/library/preferences/com.apple.xpc.activity2.plist 🤓

Apple could really make things easier for beginners like me 😂

will stop investigation for today though
 
ok, after sudo ls finally worked for me in that root directory, i found parts of what i've seen with "defaults read + enter" inside /private/var/root/library/preferences/com.apple.xpc.activity2.plist
I doubt defaults read would have read from /private/var/root/
From defaults’ man page
“read Prints all of the user's defaults, for every domain, to standard output.”
“find word Searches for word in the domain names, keys, and values of the user's defaults, and prints out a list of matches.”
So, defaults find adguard should return where the value is stored.

There are other plist files in the user directory that might contain a reference to com.adguard.safari.AdGuard, for example ~/Library/Application Support/CrashReporter/ Just the existence of a mention of AdGuard doesn’t mean much. :)
 
So, defaults find adguard should return where the value is stored.

Hallelujah! 😂🤘

~ % defaults find adguard
Found 1 keys in domain 'com.apple.Safari': {
OrderedToolbarItemIdentifiers = (
CombinedSidebarTabGroupToolbarIdentifier,
SidebarSeparatorToolbarItemIdentifier,
BackForwardToolbarIdentifier,
NSToolbarFlexibleSpaceItem,
PrivacyReportToolbarIdentifier,
"com.adguard.safari.AdGuard.Extension (TC3Q7MAJXF) Button",
InputFieldsToolbarIdentifier,
NSToolbarFlexibleSpaceItem,
ShareToolbarIdentifier,
NewTabToolbarIdentifier,
TabPickerToolbarIdentifier
);
}
Found 2 keys in domain 'com.adguard.safari.AdGuard': {
NSFullScreenMenuItemEverywhere = 0;
NSTreatUnknownArgumentsAsOpen = NO;

just removed the second set of keys by rm -r'ing several adguard folders inside ~/Library/Containers/

though i couldn't find the first string or associated location with certainty by finder or sudo find ~ -name (-path) "com.apple.Safari"

or would something like
Code:
defaults delete 'com.apple.Safari' <whateverkey>
work there?


and yes, had found strings inside crashreporter too, but since they looked different, i thought they were not the cause of my initial findings
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.