The file path represents the location of the file in the file system, which is inevitably required by Linux programmers operating on the command line or by the vast majority of users who use Windows.
The path of copying the current directory on Windows has a particularly convenient way, only need to click the path bar with the mouse, it will automatically become like "D:\Downloads\tmp" such as the path, if you want to copy the file path, only need to add directory path and file name together, Linux is also very convenient, readlink -f yourfile
will print out the absolute path of the file, although the Mac can also be used under the command line Greadlink (Mac on the Readlink and Linux features are not the same, greadlink meaning is GNU's readlink, Consistent with Readlink on Linux), but this is obviously not the best solution, after all, Mac is the best combination of graphics and command line, the preferred solution in the graphical interface to solve the problem
Search the next Baidu, roughly to the following two kinds of 3 programs
- Right click on the file, choose
显示简介
to see the directory of the file, which is the same as clicking on Windows on the path, but it is not easy to use, because it shows only the path of the directory where the file, the absolute path of the file also need to add a filename
- Drag the file into the browser, the file path will be displayed in the Address bar
- Open the text terminal program, drag the file in, the path will be automatically printed out
Each of the above methods have advantages and disadvantages, I expect the best solution should be the right mouse button click on the file, menu directly appear Copy path
options, click the file path is copied to the Clipboard, is not a one go feeling, in fact, the MAC system itself for us to provide such a way, just need a little bit of skill, We need to use automator here.
Open the Automator in the Application folder, select the File menu, create a new service, as follows
In the left Action Bar 拷贝至剪贴板
, locate the action and drag to the right, as follows
There are two places to modify, "services" received selected as files or folders, located in Finder, cmd+s
saved, named Copy path
, finished!
How to use it? In the Finder to find a random file, click the right mouse button, see if the service options appear Copy path
, the following
After clicking the file path is copied to the Clipboard, find a place to paste to see if the result is not what you want, if you want to delete the service, go to the ~/Library/Services/
directory, delete the corresponding workflow file can be
Finally I want to vomit trough, this question troubled me for a long time, in fact, I always want to use Automator to solve this problem, but automator so many operations I do not have a closer look, whether it is Baidu or Google search Mac下复制文件路径
such keywords, Search method is always only I gave a few, until one day I put this problem told a foreign classmate, he search on Google copy file path in mac
, all solved
So sometimes don't blame the search engine, only blame ourselves not to give the best answer
Quick Copy file path under Mac OS x