UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.


Tutorials
| Forums

Download to Enter
| Contest Rules

DOWNLOAD INTEL® GPA FOR FREE

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 26th, 2005, 06:05 AM
bubu1979 bubu1979 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 29 bubu1979 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 23 m 45 sec
Reputation Power: 0
ls files not directorys

Hi,
Just looked at the man page for ls and counldnt seem to find what I was looking for... I want a way to do an ls and ONLY shows files and not directories.. Theres an option -F which puts a / at the end of the directory names, maybe theres a way to filter out the directory names using this option and something like grep...

However the option -F puts a * at the back of some of my filters so I reckon I need some this like....

we are doing like this but there must be a simpler way right?

ls -F | grep -v "/" | sed "s/\([^*]*\)\*/\1/g"

Thanks in advance...

Anthony

Reply With Quote
  #2  
Old January 26th, 2005, 06:35 AM
NickPickering NickPickering is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Horley, Surrey
Posts: 3 NickPickering User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 30 sec
Reputation Power: 0
try find command

find . -type f -ls any use?
it will traverse lower directories tho

Reply With Quote
  #3  
Old January 26th, 2005, 07:12 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,200 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Week 1 Day 11 h 47 m 52 sec
Reputation Power: 11
Quote:
ls -F | grep -v "/" | sed "s/\([^*]*\)\*/\1/g"



if you DO not want a recursive 'ls', i whoud say

Quote:
ls -p | grep -v "/"
or the equivalent sed sersion
ls -p ¦ sed '/\//d'


else follow NickPickering suggestion.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > ls files not directorys


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap