Find a folder from a directory

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find a folder from a directory
# 1  
Old 07-26-2011
Find a folder from a directory


I have a folder name XX and a directory N:.
Now I want to find the folder on that directory and print the path.

I tried with grep "XX" N:
but also search for files named as XX, but I want to find onlt folder and print.

please help me..

Thanks in advance
# 2  
Old 07-26-2011
find XX -name N -type d

# 3  
Old 07-26-2011
FIND: Parameter format not correct

I have tried .. but it shows the error

FIND: Parameter format not correct

can you help me on that
# 4  
Old 07-26-2011
Please try the below one

find /N/  -type d -name "XX"

# 5  
Old 07-26-2011
What system do you use?
% find /usr -name include -type d | wc -l

# 6  
Old 07-26-2011
I have a folder name XX and a directory N

you mean, XX has the directory N ?


so, you wan the path of somefolder ? (xx/N/somefolder) ?
# 7  
Old 07-26-2011
This makes no sense in a unix or Linux context.
Are you looking at a Microsoft partition of some sort using unix or Linux?

Please post the exact output from these commands (some or all of which will error). The solidii and backslashes are important.

cd /
ls -lad /N
ls -lad /N:
ls -ald /N\:
ls -ald /N/XX
ls -ald /N:/XX
ls -lad /N\:/XX
Please post the Operating System and version you are running and your preferred Shell.

Ps. The command you need is more likely to be "find" than "grep". Please post exactly what you typed and what happened.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies

2. Shell Programming and Scripting

Create a folder under different user directory

Hello All, I have to write a shell script and use it in informatica. The script has to perform below actions: The script gets executed from edw user. Through the script, a DT folder has to be created under edw_sca user. Is this scenario possible through a SHELL script or not. ... (2 Replies)
Discussion started by: bghosh
2 Replies

3. What is on Your Mind?

Directory vs. Folder?

How would you call it? (24 Replies)
Discussion started by: absorber
24 Replies

4. Shell Programming and Scripting

Delete folder in a directory which are two months old

I need help. I have to create a script which will delete multiple directory (folders) that are two months old. Example, I have folders dated April, May, June and July. I have to delete folders April and May and retain June and July and as such that when the July month lapse, the folder June will be... (2 Replies)
Discussion started by: jasperux
2 Replies

5. UNIX for Dummies Questions & Answers

Printing directory starting from a particular folder

Hi there!:o I have a question if I have a directories ~/MyFolder/Files/PersonalFiles/databases/food/tomato ~/MyFolder/Files/PersonalFiles/databases/items/cup and I want my program to output food/tomato and items/cup, i.e. everything from the folder database but without... (5 Replies)
Discussion started by: FUTURE_EINSTEIN
5 Replies

6. Shell Programming and Scripting

Find folder within folder, then find other folder in same dir

Hi all I'm new to your forum but not new to shells. I'm having a little trouble though as it's been quite some time since I scripted. Here's what I'm trying to do: I'm trying to search a directory named '/var/root/Applications' for another directory 'fooBar'. The "Applications" directory... (9 Replies)
Discussion started by: DC Slick
9 Replies

7. Shell Programming and Scripting

Replace last 2 folder directory string with sed

Hi guys, Im trying to replace the 2 last folders name in a list of directories with a new string, but Im dont know which regex to apply. Directories list: C/my user/documents/games & music C/my user/documents/photos 09-24-2008 C/my user/settings/config ?1_2 * The last folder may have... (11 Replies)
Discussion started by: cgkmal
11 Replies

8. Shell Programming and Scripting

Find all text files in folder and then copy to a new folder

Hi all, *I use Uwin and Cygwin emulator. Im trying to search for all text files in the current folder (C/Files) and its sub folders using find -depth -name "*.txt" The above command worked for me, but now I would like to copy all found text files to a new folder (C/Files/Text) with ... (4 Replies)
Discussion started by: cgkmal
4 Replies

9. Shell Programming and Scripting

Take a folder name and find it in another folder (Complicated)

Hi Script Experts, Here is my scenario: 1. /var/mqm/qmgrs folder will contain 11 folders as follows: 1. /var/mqm/qmgrs/Folder_Name1 ....................../Folder_Name2 ....................../Folder_Name3 ....... ...................../Folder_Name11 2. if Folder_Name1 exists... (5 Replies)
Discussion started by: hkhan12
5 Replies
Login or Register to Ask a Question