Solved

Linux and finding a directory name

Posted on 2014-11-15
1
441 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
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é.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

773 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