Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to open a folder in Terminal

Folks

Sorry, but I'm 'way out of my depth dealing with unix, but I know it's mighty interesting, and I just wish I had time to learn it, but...! Here's my need:

My Trash is so full it won't open just by mouse click! I need to check it before I Empty Trash. What is the command/string I need to open the folder, please?

Anybody help me, please?

Regards

Roy

G5 Dual 1.8ghz 1.5mb RAM, Mac OS X (10.4.10), 2nd Seagate 500gb HD; Ext LaCie 120gb; Ext Seagate 400gb

Posted on Aug 6, 2007 8:54 AM

Reply
Question marked as Best reply

Posted on Aug 6, 2007 10:31 AM

You don't really 'open' directories in the terminal. You can change to a directory using cd, and you can list the contents of a directory using ls. You can also remove files using rm:

<pre class=command>$ cd ~/.Trash
$ ls
<file listing>
$ rm some.file</pre>
7 replies

Aug 6, 2007 10:56 AM in response to Roy Close

I guess "~" is my user name, so "$ cd username/.Trash", am I correct?


No. ~ means 'home directory' and the shell will automatically work that out (so you don't need to). Writing the command exactly as I posted is valid.

BTW — just where is .Trash located?


Umm... it's in your home directory (which is what ~/.Trash means).
Since the filename begins with a period it will be hidden from normal view (including in the Finder).

Sep 20, 2007 4:22 PM in response to Carla Hufstedler

You can actually, should you desire a more GUI experience, drag-and-drop a folder onto Terminal.app, which will accomplish the same task as Unix's cd.


That is not correct.

Dragging a folder to a terminal window is in no way related to cd.

All that happens is that the path to that folder is written out, as if you'd typed it.

This does not cd to that directory, it doesn't even imply you will cd to that directory after pressing return (unless you manually typed cd before you dragged the folder to the terminal, but the cd is entirely up to you - you might prefer to ls or even rmdir that directory, which are just as valid uses for the drag-and-drop).

Sep 28, 2007 2:44 PM in response to Roy Close

If you really needed to open a folder from terminal, you could type in +open /pathtofolder/foldername+
(eg +open .Trash+ )

This may not work if there's something "wrong" with .Trash (meaning it needs to be cleared), but should work for other folders. You can open a new terminal window, which should make your working directory your home directory (~), and then issue +open Desktop+.
For giggles, you can type in +open De+ and then click tab and see what happens.

How to open a folder in Terminal

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