0

Just received some “expert” tech support due to a botched grammarly release.

Expert told me to:

rm -r ~/Library/Application\ Support/Grammarly/

Beyond the fact that I’m 90% sure this person meant /Application Support/Grammarly (which does not exist), will this command cause catastrophe?

I don’t want to be the one to try it, I don’t have a VM on this machine, and I don’t know enough about rm to judge whether or not this will just return a fail or will go for ~/Library/.

5
  • I should say, I'm 1/2 posting this question because I'm legitimately curious about rm-r in this context, and 1/2, because this looks like a boilerplate response from their tech and I'm concerned a lot of people might be very unhappy with the result. – Gryph Aug 6 '18 at 16:03
  • Why would you think they meant /Application Support/Grammarly (even more so, when it does not exist)? And did you try ls -la ~/Library/Application\ Support/Grammarly/ to see what's there? Finally, I feel the title describes a problem that's off topic, as it's not an actual problem you're facing. – Arjan Aug 6 '18 at 16:13
  • 1
    I changed the title because I am 100% sure that rm -r ~/Library/ will screw up your system. But doing that to a specific directory like rm -r ~/Library/Application\ Support/Grammarly/? I see no issues. Maybe you would have to reinstall the software but at least your system is fine. But genuine kudos for you asking since there are people who will run that command with sudo on / (root) and boy howdy! Is that a disaster. – Giacomo1968 Aug 6 '18 at 17:10
  • @quick this is for MacOS. I wasn't worried about deleting the app. I was worried because I didn't understand blanks as delimiters, and thought if this was somehow in error, perhaps it would revert to it's last known proper, eg. ~/library/application support/ or ~library/, either of which would be not great. I knew it was unlikely, but again it's nice to not have to tinker with things like rm -r – Gryph Aug 7 '18 at 3:03
  • 1
    @Quick “In the future, you can install timeshift on Linux Mint…” What makes you think this is about Linux? Especially when the question is tagged “macOS” and “Terminal?” – Giacomo1968 Aug 7 '18 at 11:29
3

I don't see any reason to expect this to be a problem, much less a catastrophe. The command (typed correctly) will only delete that directory and anything in it.

Blank spaces in directory or file names have to be escaped (\) because blanks are delimiters. Many Unix experts abhor blanks in file names (yeah, yeah, "citation needed") for this reason.

Update: Thanks to the following answer, I'll add that I use an alias to "delete" files: alias del mv !* ~/.trash (I use tcsh, but it should work similarly on bash). Also, if you use filename completion on this, or the rm command, you'll see that the escaped blank is filled in automatically.

2
  • 1
    As an aside: one could also surround the path with double quotes, to avoid the escaping, like ls -l "/Users/arjan/Library/Application Support/". That won't expand the tilde to the user's home folder though, so ls -l "~/Library/Application Support/" won't work then, though ls -l ~/"Library/Application Support/" will (but is horrible, I feel). – Arjan Aug 6 '18 at 16:20
  • True... there's more than one way to cope with blanks in filenames. None are pretty. – Steve Smith Aug 6 '18 at 16:24
1

While Steve Smith’s answer is correct—in that blank spaces in a file/directory name need to be escaped (\)—there is really a simpler way of dealing with someone telling you to ditch a file/directory in an attempt to fix a system: Just rename it or move it somewhere else!

The core problem with the advice you were given is the assumption that deleting a directory like that must happen via a command line in the Terminal. This is simply not the case.

The reality is while macOS hides the ~/Library/ directory by default, you can easily enable it in the Finder. Just open up a Finder window and go to your home directory—either manually or via Command+Shift+H—and then choose “View -> Show View Options” or hit Command+J.

At the very bottom of the list of options you’ll see “Show Library Folder.” Just check that off—and even push “Use as Defaults” if you wish—and you will have instant Finder access to the ~/Library/ directory. Screenshot below for reference:

Screenshot of home directory view options that show’s the “Show Library Folder” option.

Or, just open up a Terminal and type:

open ~/Library/

And that will literally open open the ~/Library/ directory and allow you to poke around in there.

With that done, just rename Grammarly/ in ~/Library/Application\ Support/ to something like Grammarly-BACKUP/ and then launch the application again. For all intents and purposes renaming a directory like that will make it “invisible” to the application. Or you could even just drag that Grammarly/ directory to the Desktop—or even Trash—and do the same. Remember, computers don’t know where things are if you move or rename files.

2
  • 1
    Yeah exactly, this is my feeling as well - having a blanket response to use a terminal command seems overkill, e.g. just move the folder/file, as you suggest. As I mentioned, it was 50% that I was concerned with my individual scenario using rm -r and 50% putting it there with the application name because I am 100% sure I won't be the only quasi-technical person to have alarm bells going off in regards to it. – Gryph Aug 7 '18 at 3:05
  • Good point, and I updated my answer with a similar idea... but hopefully the tech support at least knows that the directory in question is safe to delete. – Steve Smith Aug 7 '18 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.