![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
"find command" to find the files in the current directories but not in the "subdir"
Dear friends,
please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6, file7 what i need is when i am in current dir, and if use find command it shold display only file1, file2, file3 but not others, please help very eager to see ur replys.. regards, swamymns |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
#3
|
|||
|
|||
|
if u're using gnu find, u can use -maxdepth option
eg: $ find . -maxdepth 1 -name file will show file in the current dir only. |
|
#4
|
|||
|
|||
|
find *.*
|
|
#5
|
|||
|
|||
|
Vijay, that does not work if a sub directory name contains a ".". You may think that's uncommon, but the first time I tried your command, it failed because the directory I was in had a period!
|
|
#6
|
|||
|
|||
|
Quote:
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. |
|
#7
|
|||
|
|||
|
Quote:
1) If there is a sub-directory with a "." in the name, then it will search that sub-directory. 2) It will not find files that do not contain a "." in the name. It is very common for file names not to be of the form x.y. |
|||
| Google The UNIX and Linux Forums |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|