Hot answers tagged

595

┌── ln(1) link, ln -- make links │ ┌── Create a symbolic link. │ │ ┌── the optional path to the intended symlink │ │ │ if omitted, symlink is in . named as destination │ │ │ can use . or ~ or other relative paths │ │ ┌─────┴────────┐ ln -s /path/to/...


81

You can use dot_clean command to remove or merge the ._ files: dot_clean PATH_OF_FOLDER_OR_DRIVE If you move files to linux, or have Git Bash on your PC, and have access to the find command, you might also be able to do this: find . -type f -name '._*' -delete And they're gone!


79

The command is called ln. If used with the option -s it will create a symbolic link in the current directory: ln -s /any/file/on/the/disk linked-file


72

You can also do this in Terminal. Go to the directory where you want to create the file, then run the following: touch file.txt Or redirect 'nothing' to a text file > file.txt


71

It's generally safe, though a little dangerous depending, to do it but often not worth the effort. The caches in /System/Library/Caches are generally small and useful, the ones in /Library/Caches are less system caches and much more readily cleared. If you have a look in ~/Library/Caches you will find a bunch of applications have a cache in there, none of ...


42

This is SilverInstaller, adware to download more adware and ‘potentially unwanted programs’. This was likely distributed through fake Flash popups, which someone on the system clicked on, downloaded, opened, installed and provided administrator credentials to. Installed software in this package likely includes MacKeeper, VSearch, A Pirrit injector,...


38

I know this question is explicitly asking about the Terminal, but if you're in GUI Land and don't want to enter Terminal Land, you can use SymbolicLinker. This puts a "Make Symbolic Link" option in your Services menu in Finder.


35

The simplest version does not require a file or folder to be selected, and adds a keyboard shortcut of your choice. Part 1: Create a new Quick Action (was Service) In Automator, create a new Quick Action (previously called a Service): From the left site, click Utilities then drag "Run Applescript" over to the right panel. Change the two pulldown menus at ...


33

mdls lists file metadata. A sample below for a folder kMDItemContentCreationDate = 2011-11-20 04:05:42 +0000 kMDItemContentModificationDate = 2014-10-22 01:52:53 +0000 kMDItemContentType = "public.folder" kMDItemContentTypeTree = ( "public.folder", "public.directory", "public.item" ) kMDItemDateAdded = 2014-...


32

It's just ln -s <source> <destination>.


24

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 ...


24

If you have the Finder window open, use Spotlight to open TextEdit. When you're ready to save the file, option+drag the text file icon from the title bar of TextEdit into the Finder window where you want to save it.


21

This is because it loads the previews of the files, which replace the default file icons. To disable icon previews on the desktop, click on the desktop, press ⌘J and uncheck ‘Show icon previews’.


20

Just typing the operand NOT before the criteria will do the trick. So, in this case, typing NOT .txt will show all the files but the ones with the .txt extension.


20

I found the culprit ! Thanks to the suggestion of @Mark Thalkman I made a DTrace script to monitor applications accessing that file. The application that creates the file is called AppWrapper. The way I discovered it was to look at the folders created in October in /Library/Application Support. There were only two, appWrapper and eSellerate. So I ...


20

Zipping from the Finder adds a folder __MACOSX, invisible on Macs, that contains OS X resource forks like custom icons and such. From Wikipedia: The resource fork is a fork or section of a file on the Apple Mac OS operating system used to store structured data along with the unstructured data stored within the data fork. A resource fork stores information ...


18

You might also use fdupes. It doesn't have an option to search for duplicates of a specific file, but you can just grep the output for the filename: fdupes -r1 .|grep filename -r recurses into directories and -1 prints each group of duplicate files on a single line. Other useful examples: fdupes -r . finds all duplicate files under the current directory;...


17

Here is my workaround: Do this once, create an empty text file in your desktop to serve as template. Opt/Alt-drag this file to the folder to make a copy.


17

You can do this quite simply and quickly in Terminal: cd /path/to/start/renaming find . -name '*\<*' | while read f; do echo mv "$f" "${f//\</}"; done The command above is a "dry-run" of the command below: find . -name '*\<*' | while read f; do mv "$f" "${f//\</}"; done This will remove any < characters recursively on files and folders ...


16

These files are created by the operating system to speed up searches, store metadata (data used by the OS) about a folder preferences, etc. Windows and OS X both have these kinds of files. Following, is a description of these files pulled from http://annoying-file-be-gone.snack.ws/faq.html: .DS_Store – The name of a file in the Apple OS X operating system ...


15

There's two ways to do this, the easiest is the first option; Open TextEdit and type whatever you need into it then save it to the location you want the file to live. You can open TextEdit quickly by invoking Spotlight and being typing Tex..., you should see the top hit is the app you want so you can just press enter to open it. This is more involved and ...


14

Hallelujah! I figured it out. Okay, so first thing I did was create a new account, as suggested by another answer. The problem did not occur in there, so clearly the problem was limited to my account. I then went into Safe Mode into my account. The problem did not occur as well. So clearly something was loaded in normal mode but not in safe mode that was ...


14

In your open/save window, press Cmd-Shift-G to open a window where you can paste the path. This also works in Finder.


14

It's up to individual apps to decide whether to show hidden files and to provide options to change it. The ‘AppleShowAllFiles’ key is written to ‘com.apple.Finder’, so it only applies in Finder. Finder's GUI option for changing this setting is ⇧⌘.. Other apps may have their own options, which you'll need to investigate on a per-app basis. For example, How ...


13

fs_usage is your tool for this. The file system usage tool is ideal since it taps in to the real time file system events and dumps activity to a file or the screen. Since you know the exact path of the file, you can filter out all the thousands of irrelevant (to this case) filesystem changes and see what reads / writes to that file pretty quickly. If your ...


12

From the font of all knowledge, the maximum file name size in the default HFS+ file system is 255 UTF-16 encoding units, so basically 255 characters. Technically, any unicode character can be used, but this may be practically limited by the application you are using - for example, the / character is used to delineate directories in pathnames, so you may not ...


12

Preview only works with PDF files and some image files (png, jpg, gif, tiff, bmp) so you won't be able to open a text file on Preview. To open your info.txt file from terminal you need to choose an application that can open text files, like TextEdit or any other text editor. You also could use open -e file, to open any file using TextEdit.


12

This command is for comparing values, checking file types etc. Here's a man page: NAME test, [ -- condition evaluation utility SYNOPSIS test expression [ expression ] It's usually used like this: if [ -f /etc/passwd ] then echo "Yes" else echo "No" fi For more info, please read the man page ( man [ ).


11

Check my answer at - SuperUser. NOTE: After the introduction of SIP, this app does not work unless you disable it. Read more on how to do it, but it is ill-advised. Try XtraFinder. This app is just great, solved all my basic needs after switching from a windows platform like adding "New File" in context menu and finder toolbar, etc. Some of the ...


11

It's safe to delete this file. It is a file left behind by the OS X installer in later versions. It seems to always be there after installation, so its existence does not indicate a failure in it self. What the installer actually uses the file for is not known to me. It might be used if the installer fails/crashes, to indicate what the installer was doing ...


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