*nix Thread, Directory listings in Technical; In Windows I can do:
dir /ad win*
and I'll get a list of directories whose name starts with "win"
...
-
12th June 2009, 12:00 PM #1 Directory listings
In Windows I can do:
dir /ad win*
and I'll get a list of directories whose name starts with "win"
how can I do the same in Unix?
If I do
ls -l win*
I get the list of directories but I also get the contents of the directory and I don't want that (I'm looking at a list of home folders and want to see those which have not been used recently so I only want to see the folder details, not the contents)
I've tried using find - I suspect that this will do what I want but I can't work out the switches!
-
-
IDG Tech News
-
12th June 2009, 12:21 PM #2 ls -ld win* should work too?
If you want to make it more handy for comparing the modification dates, try
ls -ldtr win*
d = list directory name only, t=show in modification order, r=reverse (so last modded is first)
Last edited by OutToLunch; 12th June 2009 at 12:25 PM.
-
-
12th June 2009, 12:52 PM #3 Thanks for this; the ls -d command works (ls -ld lets me see the date which is what I most want!)
I had to do the find as:
find . -type d -iname "win*" -ls
which worked but is really slow - it obviously scans every sub-directory. I think I should be able to stick "- prune" in to tell it not to do that but it still takes as long!
Anyway, I've got what I need so many thanks again - now to get deleting :-)
-
SHARE: 
Similar Threads
-
By steveo2000 in forum Mac
Replies: 0
Last Post: 6th April 2009, 10:26 PM
-
By Neville in forum Windows
Replies: 6
Last Post: 25th June 2008, 03:24 PM
-
By AnnDroyd in forum Web Development
Replies: 3
Last Post: 12th February 2008, 12:27 PM
-
Replies: 7
Last Post: 31st January 2008, 12:17 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules