Solved

LINUX, whereis

Posted on 2013-05-17
4
345 Views
Last Modified: 2013-05-17
I am running RHEL 6.4,

I want to find all file anmes of *.trc in my current directory and all subdirectories

However, wher I use "wehreis *.trc":, I only gets hits on the current dir

I examined how to do this in the whereis doc, but could not find a subdir option

How can I find all occurences of a file named this way in subdirs ?

Thanks
0
Comment
Question by:Los Angeles1
  • 3
4 Comments
 
LVL 3

Accepted Solution

by:
GhostInTheMacheen earned 500 total points
ID: 39176189
Give this a go from the working directory you want to search:
find . -name *.trc

Open in new window

0
 
LVL 3

Expert Comment

by:GhostInTheMacheen
ID: 39176199
An alternate syntax using grep for about the same result -- a little more flexible if you're running complex searches that require regular expressions:
find . | grep '\.trc$'

Open in new window

0
 
LVL 84

Expert Comment

by:ozo
ID: 39176200
find . -name '*.trc'
0
 
LVL 3

Expert Comment

by:GhostInTheMacheen
ID: 39176232
Good point, ozo, that should be quoted to avoid unintentional shell expansion.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now