0

On my machine I have repeating patterns of directories.

E.g,:

notes/2019-01
records/expenses/2019-01
records/taxes/2019-01
customer/project/notes/2019-01

Links in the Favourites bar show up as:

2019-01
2019-01
2019-01
2019-01

To get around this, I'm creating symlinks to point to the folders I'm regularly using.

MacOS lets me rename the symlink in the gui, and it seems to accept unusual characters, even '/'.

so I can create symlinks like:

notes/01
exp/01
tax/01
proj/notes/01

But... on the command prompt, the '/' is a ':', which is a surprise. I've not seen this done in other Unixes.. maybe I've never noticed.

Is there a pitfall to this? am I tempting fate with slashes and colons here?

1
  • Seems there is a massive pitfall to this. Symlinks in the shortcuts on the finder don't allow you to drag files into their linked folders. Which completely negates their value. – mgjk Jan 19 '20 at 11:50
1

The filesystem internal separator is : on HFS which is why other Unix don’t existing that generally. There’s no harm I can see to what you propose as its portable across Unix in my experience and harmless on macOS

1

You can't use the forward slash character in a macOS filename - it is reserved for directories as you indicate in the first half of your question. macOS substitutes forward slash characters with colons, which is portable across all varieties of Unix.

Space | Separator between command arguments

/ | Path delimiter

\ | Escapes the following character

- | Can indicate a command option

[] | Shell scripting tokens

{} | Shell scripting tokens

* | Wildcard (multiple characters)

? | Wildcard (single character)

' | Command argument grouping delimiter

" | Command argument grouping delimiter

More information at this page

1
  • From your link it sounds like MacOS did allow for slashes in filenames, and the underlying filesystem supported it. For backward compatibility MacOS changed colons to slashes in the GUI when MacOS went to Unix... nearly 20 years ago. – mgjk Nov 29 '19 at 11:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .