LINUX, whereis

Posted on 2013-05-17
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 ?

Question by:Los Angeles1
  • 3

Accepted Solution

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


Expert Comment

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

LVL 84

Expert Comment

ID: 39176200
find . -name '*.trc'

Expert Comment

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

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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 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…
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.

863 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

22 Experts available now in Live!

Get 1:1 Help Now