Operating System - HP-UX
1822713 Members
3548 Online
109644 Solutions
New Discussion

how to search for .tar and .pcb files on HPUX11?

 
Amiko
Frequent Visitor

how to search for .tar and .pcb files on HPUX11?

Hi,

 

I dont come frrom a Unix background and would like some help in what commands I should use to locate all .tar and .pcb on a HPUX11 machine please

thanks

2 REPLIES 2
Sush_S
HPE Pro

Re: how to search for .tar and .pcb files on HPUX11?

Hi  Amiko ,
 
If you are looking for commands to find all .tar and .pcb files use the following commands.

1. Command to find all .tar files
find / -name "*.tar"
This will search the entire file system starting from the root directory("/") and list all files with the .tar extension.

2. Command to find all .pcb files
find / -name "*.pcb"
This  will search the entire file system starting from the root directory("/") and list all files with the .pcb extension.

As searching from root directory can give you all the results it would be time-consuming, so you might want to narrow down the search to specific directories if you have an idea of where the files might be located by specifying directory name in the place of "/" in this example.

Regards,
SUSH_S



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Steven Schweda
Honored Contributor

Re: how to search for .tar and .pcb files on HPUX11?

> [...] on a HPUX11 machine [...]

   Vague.

      uname -a

> This will search the entire file system starting from the root
> directory("/") [...]

   In my experience, specifying "/" as a path for "find" seldom ends
well.  Too many things in "/dev" which can't be read in finite time, for
example.

   Also, if NFS (or some other file-sharing software) is in use, you
might end up trying to search a significant fraction of the known
universe.

   I might use a command like "mount" or "df" to try to identify the
local file systems, and then specify one or more of those instead of
"/".  And then use the "-xdev" option to avoid straying into dangerous
territory.

> I don[']t come frrom a Unix background [...]

      man find

   You might discover operators which would let you do more a more
complex search with one command. For example:

      find /opt /usr -xdev -name '*.pcb' -o -name '*.tar'