Hot answers tagged

64

You can use zip command in Terminal to zip the files without the .DS_Store, __MACOSX and other .* files. Open Terminal (search for terminal in spotlight) Navigate to the folder you want to zip using the cd command Paste this: zip -r dir.zip . -x ".*" -x "__MACOSX" Example Let's say you have a folder on your desktop called Folder with ...


53

Is there a manual or guide to what all of the built-in directories should be used for? Like what is /home/, or /net/? Take a look at the File System Programming Guide for the most up-to-date information and at man hier in Terminal, which provides a "historical sketch" of the filesystem hierarchy (it's included at the end of this answer for reference). A ...


29

This is a classic use case for rsync: rsync -av /source-path/source-dir /destination-path rsync will copy only new and changed files to the new location. It is important to understand how a trailing slash on the source argument functions. If there is a trailing slash then the contents of /source-path/source-dir will be copied to destination-path. If ...


26

I had the same issue with an account folder, which I restored from a backup via rsync. The problem seemed to be the corrupt or missing creation date. After setting it manually the folder was acting normal again. I used the SetFile command from XCode's command line tools. So this should solve the issue: SetFile -d '12/31/1999 23:59:59' will-not-open


22

It's a bit messy, and there is a degree of cross-overs, but the quick tour, without really going into the subfolders of these: /etc, /tmp and /var are just symbolic links to subfolders in /private. /etc generally contains configuration files. /tmp is for temporary files used by running processes (also see /var/tmp) /var is also used for somewhat ...


20

Any person new to Apple and Mac would find lot of things un-intuitive or just forced on the user, w/o any options to change it. Or it might be that just many of us had their first experiences on Win/Linux systems. But just found this plugin to finder XtraFinder which among lot of other options allows you to ENTER/RETURN to open a file. Feeling a lot ...


20

This should just work: cd /path/to/-folderthatstartswithdash EDIT: According to this question, this works if you only want to input the name: cd -- -folderthatstartswithdash


20

I filed a bug report with Apple and this seems to finally be fixed now in Mojave 10.14.4 (18E226). To fix, update your OS to the latest version. Then reboot into recovery (CMD-R) and run disk first aid. It should show one or more error: directory valence check: directory (oid 0x123456): nchildren (1) does not match drec count (0) and / or error: ...


19

Get Info on the folder. Click the icon on the top-left of the window. Press ⌘X or Backspace Alternatively, cd into the directory and run rm Icon$'\r' To delete the icon from multiple folders at the same time, run the following command: find ~/Desktop -name Icon$'\r' -delete Replace ~/Desktop with the containing folder of the folders that you wish to ...


19

cd ./-folder usually works quite well here (and also with other commands)


18

If you hold option the (+) button to add a search criteria will become a (…) and an Any/All/None block. Set this to None. For the criteria select Document Container. It won't be in the default list alongside Name, Kind, etc. Select Other… to select it from a list of additional criteria so long it has its own search feature: Set this to the name of the ...


17

With the assistance of AppleScript you can accomplish this. Open AppleScript Editor, create a new document and paste the following stolen lines: tell application "Finder" try if exists Finder window 1 then set thisPath to (the target of the front window) as alias else set thisPath to (path to desktop) end ...


16

Experts recommend that you should set up the minimal hierarchical folder structure that is logical for you, and use tags for all other categories. For example, Kerry Gleeson's classic book The Personal Efficiency Program (1994, 4th edition 2009) recommends the following three folders: 1. Working, 2. Reference, 3. Archives. "Working" would contain ...


16

Terminal command to change screenshot save location: defaults write com.apple.screencapture location "/path/to/new/location" Put your desired screenshot path between the double quotes as it is required if any spaces exist in the location path! Locations without a space will still be executed properly. Example path with a space in new path: defaults ...


15

Just some extra information ... My understanding is that __MACOSX is a subdirectory artificially created by the Mac GUI tools to hold meta data such as extended attributes that can't be normally saved in a zip file. If you use the Mac GUI tools to unpack the zip file, then the tools will know what to do with __MACOSX and the directory won't actually get ...


14

/home is used as a mount point for the automounter (see /etc/auto_master and /etc/auto_home), you can't create your own directories in there. If you are looking for a place to store common administrator stuff shared between different administrators, create a directory in either /Users/(any admin account) or /usr/local/share and make it accessible to all ...


14

From this SO answer: Backup your old default Desktop folder If you have files in your existing Desktop folder, don’t worry. We’re going to back up your existing folder so you can copy your old Desktop files to your new DropBox Desktop folder afterwards. Simply open a terminal and enter the following command. sudo mv desktop desktop.bak ...


13

I find mouse/trackpad-clicking the triangle while holding the Alt/Option or Command key works too.


12

This was reported by several of our users as well so I did some digging. The Library folder itself is owned by root and only root has rwx access. The only folder inside on three different machines I tested was a Logs folder. This Logs folder was empty. All three machines had the same behavior and a similar setup. Deleting the folder was only temporary as it ...


11

There are many web pages that will walk you through this process, here is a good one: http://www.maclife.com/article/howtos/how_move_your_documents_folder Basically you create a symbolic link to a folder on an external drive. Here is information on how to use the console to create a symbolic link: http://hints.macworld.com/article.php?story=...


11

Unfortunately, Gmail doesn’t expose its “Categories” to IMAP. I'm using Mail.app as my email client, and I had the same desire to have my mail categorized with Gmail’s bayesian-or-whatever classifiers, so I found a fix. This workaround uses filters to automatically apply labels to categories. Once labeled the old fashioned way, they can then be exposed to ...


11

In Finder, select your Smart Folder (typically saved in ~/Library/Saved Searches, it's a .savedSearch file). Then from the menu in Finder, select: File > Add to Sidebar    ^⌘T Or after selecting the Smart Folder file, just press ^⌘T on the keyboard. Note that in OS X 10.8 and earlier the keyboard short cut was: ⌘T


10

In general, to find where something is mounted, you can run this command from the terminal: df -H This also provides useful information about the space on the drive.


10

According to the documentation for the Finder Sync Extension: You can also use the extension point’s API to add a toolbar button to the Finder window or a sidebar icon for the monitored folder. I would guess this is what Dropbox uses to achieve this and some/all the other functionality facilitated by this extension. For example you can also: ...


10

There's a CLI tag tool available via Macports/Homebrew: https://github.com/jdberry/tag It doesn't seem to have a recursion option, however, I would imagine you could use this in conjunction with the standard UNIX 'find'. e.g., (from inside the directory you want to tag files in) find . -exec tag --add tagname {} \; -print


10

There is a great write up and some easier solutions posted at http://ponderthebits.com/2017/01/mac-dumpster-diving-identifying-deleted-file-references-in-the-trash-ds_store-files-part-1/ Including this Terminal one-liner to convert a .DS_Store file to (mostly) text: xxd -p <path/to/.DS_Store> | sed 's/00//g' | tr -d '\n' | sed 's/\([0-9A-F]\{2\}\)/...


9

I was so sick of this, so I decided to write a fix once and for all. You can use the following AppleScript to resize the column widths when you notice the column is too wide. It works by resizing the Finder window really large, then back to it's original size, triggering a fluid layout resize. tell application "Finder" tell the front Finder window --...


9

In bash, there are two main ways to have spaces in path names: Backslash escape the spaces /path/to/folder\ with\ spaces/ Wrap with quote marks "/path/to/folder with spaces and $variable/" '/path/to/folder with spaces and a literal $/' Double quote marks expand shell variables. Single quote marks do not.


8

UPDATE: Recent versions of OS X have removed this ability. The answer below applies to OS X 10.9 or earlier. A simple right-click of the folder will enable you to view the contents using "Show Package Contents." If you're trying to access the folder from a Save/Open dialog, then try changing your view type from icons to Column mode.


8

Not sure if you still have this problem, but this confused me too. I have been using Sparrow during Mavericks. After upgrade to Yosemite I decide to give the native mail.app a try. It looks good, but I was confused that it seem when adding multiple email accounts, it will show the structures, like folders, labels, etc in separate, but has a together inbox, ...


Only top voted, non community-wiki answers of a minimum length are eligible