The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-19-2007 10:52 PM
grep to find content in between curly braces, "{" and "}," keshav_rk Shell Programming and Scripting 4 08-09-2007 07:14 PM
Listing only directories in the current working directory using the "ls" command igandu UNIX for Dummies Questions & Answers 2 05-12-2006 01:47 AM
How to find out the exact year in "Last modified time" using ls command Dophlinne UNIX for Dummies Questions & Answers 6 04-11-2006 08:07 AM
chmod 777 on all directories below...how do I do that using the "find" command? Neko UNIX for Dummies Questions & Answers 7 07-12-2001 06:58 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 07-22-2008
Registered User
 

Join Date: Mar 2006
Posts: 41
Quote:
Originally Posted by vijayq8 View Post
Hi,
it should work man, i tried in my unix box then only i posted the reply. see my result.

[mipl@subversion ~]$ ls
coding dead.letter s2.sh scripting sname sorted_names test test1 vijay
[mipl@subversion ~]$ ls -a
. .bash_profile dead.letter .kde sorted_names .viminfo
.. .bashrc .emacs s2.sh test .xemacs
.bash_history .canna .emacs.d scripting test1 .zshrc
.bash_logout coding .gtkrc sname vijay
[mipl@subversion ~]$ find *.*
dead.letter
s2.sh
[mipl@subversion ~]$

Hope you clear now.

Thanks & Regards
Vijay.
Vijay, that does not work if a period is in the middle. See the following:
Code:
/tmp/tmp> ls -l
total 16
drwxr-xr-x   2   common       240 Jul 22 09:42 asdf.jkl
-rw-r--r--   1   common         0 Jul 22 09:40 one
-rw-r--r--   1   common         0 Jul 22 09:40 two
/tmp/tmp>
/tmp/tmp> find . *.*
.
./one
./two
./asdf.jkl
./asdf.jkl/three
./asdf.jkl/four
asdf.jkl
asdf.jkl/three
asdf.jkl/four
/tmp/tmp>
/tmp/tmp> find *.*
asdf.jkl
asdf.jkl/three
asdf.jkl/four
Again, you may think this is uncommon, but what you suggested did not work the first time I tried it in the directory I was already working in!
Reply With Quote
Forum Sponsor
  #9  
Old 07-22-2008
Registered User
 

Join Date: Jul 2008
Location: BlackMesh Managed Hosting
Posts: 66
Typical would be:

Code:
find . -maxdepth 1 -type f
Drop the "-type f" if you want the directories to be listed.

Alternately, if you also want symlinks, pipes and the other folderol:
Code:
find . -maxdepth 1 -not -type d
Reply With Quote
  #10  
Old 07-22-2008
Registered User
 

Join Date: Mar 2006
Posts: 41
BMDan, maxdepth is not standard; it only works on GNU find. My Solaris workstation does not have GNU find. Instead, a variation of a command posted by Perderabo should be used:
Code:
find . \( ! -name . -prune ! -type d \)
I think this covers all the cases.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:34 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0