I am following a Java tutorial that I should first browse to the JAR file that I have saved in Documents folder on my Mac..How do we go there by terminal commands?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
You can type
cd /Users/yourusername/Documents to go to your documents folder.
cd is the terminal command to change the directory you're working in.
You can also type
cd ~/Documents (~ is short for your home directory).
Finally, if you go to your home folder in the Finder, you can drag Documents onto the terminal window, and it will show the path to it. This is useful if you ever have a file or folder that you want to learn the path to.
After macOS Catalina (10.15), SIP (macOS sandbox) prevents the general folder access from the Terminal. See https://apple.stackexchange.com/questions/395631/allow-all-applications-to-access-desktop-documents-and-downloads-in-catalina