Hello! I am normally in the PHP / Web Development section of DaniWeb. It's a pleasure to finally have a reason to check out other sections of DaniWeb!

So, I am logged in as root at the Command Line Interface over SSH - on Debian 7 Wheezy running on a BeagleBone Black Rev B6 - and I am running into an unexpected problem.

I have made a folder ~/folder/pythonversion
I go to ~/folder/
I type "ls -l python*/"

I expect ls -l to match the "python" part, and match "version" to the * - therefore returning the pythonversion folder name

But I get nothing back. According to the man page, I should be able to do this: ls [option] [file].

I copied this right out of SSH just so you can see what I am seeing. Anyone have any ideas? After I figure this out, I'll be putting this in a bash script. I would like to avoid havng to apt-get install mlocate or other tools such as this, ls should be sufficient.

I'll be around for the rest of the day until about 5:30pm PST, then back here again on Monday.

Thank you for your help, suggestions and time!!

From SSH:

root@beaglebone:~/folder# ls -halt
total 12K
drwxr-xr-x 3 root root 4.0K Aug 15 18:03 .
drwxr-xr-x 2 root root 4.0K Aug 15 17:49 pythonversion
drwx------ 6 root root 4.0K Aug 15 17:33 ..
root@beaglebone:~/folder# ls -l
total 4
drwxr-xr-x 2 root root 4096 Aug 15 17:49 pythonversion
root@beaglebone:~/folder# ls -l python*
total 0
root@beaglebone:~/folder# ls -l *p*
total 0
root@beaglebone:~/folder# ls -l *  
total 0
root@beaglebone:~/folder# ls -l
total 4
drwxr-xr-x 2 root root 4096 Aug 15 17:49 pythonversion
root@beaglebone:~/folder# ls py*

I missed the last line, Line 19:

root@beaglebone:~/folder#

Do you have any file inside the directory? You didn't try to access the directory at all. I have found only a weird case when the system runs out of inodes. Maybe you need to look into increasing the inodes number?

Leave off the trailing '/'. IE: ls -l python*
Assuming that the directory is not a soft-link, then you will see the contents of the directory (or directories).

Taywin, I did not have files inside the directory! That was the issue - it was working but not as I expected: it was trying to list the contents of the pythonversion directory, since it was empty, I got nothing.

(And sorry, it took me a couple weeks to get back to your guys here.)

That was it - I was trying to list the contents of the python* directory which was empty. I fixed the issue by using grep:

ls -l ~/folder/ | grep python*

Thanks for your help guys :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.