Solved

Linux and finding a directory name

Posted on 2014-11-15
1
478 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
[X]
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
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

733 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