Using Terminal to Enter File Path

I am trying to run a program to modify particular files I have personally created to remove metadata before I upload them to Youtube or FB. I found a tool called MAT2 but I it is CLI only and I can't get it to recognize the file path I have typed in. Here is an Example:


mat2 -s Computer/Users/xxx/Movies/Lab 10 HCL + CaCO3 Reaction.mp4


and I get back:


[-] Computer/Users/xxx/Movies/Lab doesn't exist.


[-] 10 doesn't exist.


[-] HCL doesn't exist.


[-] + doesn't exist.


[-] CaCO3 doesn't exist.


[-] Reaction.mp4 doesn't exist.


What am I doing wrong? I have tried different types of CMDs, putting in quotes etc. I have 2 different names for the computer so I tried the network name and the SSD name. I have tried changing from zsh to bash as well. Thanks in advance.

MacBook Air 13", macOS 10.15

Posted on Apr 2, 2020 10:12 AM

Question marked as Top-ranking reply

Posted on Apr 2, 2020 12:48 PM

UNIX abhors white space and reserved symbols in filenames. You have two choices to satisfy the shell, provided that the mat2 switch argument is the correct one:


mat2 -s ~/Movies/"Lab 10 HCL + CaCO3 Reaction".mp4


or the escaped white-space and reserved character symbol:


mat2 -s ~/Movies/Lab\ 10\ HCL\ \+\ CaCO3\ Reaction.mp4


9 replies
Question marked as Top-ranking reply

Apr 2, 2020 12:48 PM in response to Community User

UNIX abhors white space and reserved symbols in filenames. You have two choices to satisfy the shell, provided that the mat2 switch argument is the correct one:


mat2 -s ~/Movies/"Lab 10 HCL + CaCO3 Reaction".mp4


or the escaped white-space and reserved character symbol:


mat2 -s ~/Movies/Lab\ 10\ HCL\ \+\ CaCO3\ Reaction.mp4


Apr 2, 2020 12:41 PM in response to Community User

Do you have access to the folder of the user in question (the 'xxx')? If not, then sudo is required.


If sudo isn't working, then you've probably got the wrong path.


A shortcut for a user's home directory would be the '~user' format, e.g. the path would be '~xxx/Movies...'.


Then the next thing I like to do if I'm not 100% sure of the path is to use file completion, e.g. type...


mat2 -s ~xxx/Mov


...and then hit the tab key and it should expand Mov to Movies/, then expand it to...


mat2 -s ~xxx/Movies/Lab


...and hit tab, and it should add an escaped space (\ ), and maybe the next character(s), e.g. adding on the "1" from "10" if there are multiple options starting with "1" after that.


If the tab expansion doesn't give you anything, you can hit control-d and you'll get a list of all of the files and directories in the current context which match your string so far.

Apr 2, 2020 12:19 PM in response to xnav

That worked. It spit something like this out:


mat2 -s /Users/xxx/Movies/Lab\ 10\ HCL\ +\ CaCO3\ Reaction.mp4


I didn't think to use the "\" key. Thanks for your help. Much appreciated.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Using Terminal to Enter File Path

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.