An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
Navigating directories in Terminal
#38179 01/09/16 03:17 AM
Joined: Jan 2010
OP Offline

Joined: Jan 2010
I use several different applications that were developed for generic Unix, and open up with the default directory set to something like usr/bin/

I need to access files that are in my documents folder. Usually, I'm able to find my way to the documents folder, but this time I'm stymied.
I've just installed the latest release of Octave, and it comes up with a Windows Explorer kind of directory listing on the left side of the window. For the life of me, I can't navigate from the current directory to documents.

What I see is:

Parent directory: /

Directories in list:
bin
boot
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
run
sbin
srv
syus
tmp
usr
vagrant
var



MacBook Pro 15" (2015)
Sierra 10.12.6
Re: Navigating directories in Terminal
Bob_00001 #38186 01/09/16 12:04 PM
Joined: Jan 2010
OP Offline

Joined: Jan 2010
I figured it out. I just created a file with a unique name from the software, and then searched for it with Findfile. Turns out that the directory is the same folder in which the application resides. Oddly, it doesn't appear possible to go higher up the directory hierarchy from within the software. Maybe this is OSX sandboxing at work?


MacBook Pro 15" (2015)
Sierra 10.12.6
Re: Navigating directories in Terminal
Bob_00001 #38217 01/11/16 01:23 PM
Joined: Aug 2009
Offline

Joined: Aug 2009
there's a lot to learn about terminal, but here are a few tips that will help your specific issue:

1) with a terminal window open, you can drag and drop both files and folders from Finder into the window (anywhere, it doesn't need to be by the cursor or even on the same line) for Finder to automatically enter the full path for you. You can use this to go to a folder using "cd" by typing "cd" and a space, drag and dropping the folder to go to, and hitting [return], or you can view a text file the same way using "cat". So if you can find the folder in Finder, you can drop it into terminal to CD to it or do other operations with it as needed.

2) once you are in a folder, you can hit [tab] to auto complete a path you've partially entered. If there is no match or you are at the end of a filename, you'll get a beep. If there's one entry, it will fully complete the path. If there are several possible completions, it will list them immediately if the list is short. If the list is long, it will prompt you to see if you really want to "show all 215 possibilities?" etc.

The content of the folder list you show looks similar to the root directory (/) but is missing things like System and Applications, and shouldn't have root in it, so I don't know exactly what you've got there.


I work for the Department of Redundancy Department

Moderated by  alternaut, dkmarsh, joemikeb 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.018s Queries: 20 (0.013s) Memory: 0.5770 MB (Peak: 0.6325 MB) Data Comp: Zlib Server Time: 2024-04-19 06:27:11 UTC
Valid HTML 5 and Valid CSS