Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Linux and finding a directory name

Posted on 2014-11-15
1
460 Views
Last Modified: 2014-11-15
I can find a name as follows:

[root@mmclnt13 home]# cd util
[root@mmclnt13 util]# ls
net
[root@mmclnt13 util]# find . -type f -name "net"
./net
[root@mmclnt13 util]#

Open in new window


However I have difficulty finding directory names

[root@mmclnt13 util]# cd ..
[root@mmclnt13 home]# ls
download  hosts  util
[root@mmclnt13 home]# find . -type f -name "util"
[root@mmclnt13 home]#

Open in new window


Is there a command to find both names and directory names when searching ?

Thanks
0
Comment
Question by:Anthony Lucia
1 Comment
 
LVL 23

Accepted Solution

by:
savone earned 500 total points
ID: 40444664
Your using type -f which means it is looking for "files".

find . -type d -name "util"

Will look for directories.

If you want to fine both files and directories name "util" just remove the "type"

find . -name "util"
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question