[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What's the Unix Command To do a Global Search on a file on AIX?

Posted on 2011-10-19
9
Medium Priority
?
540 Views
Last Modified: 2012-06-27
I need to perform a global search for a file on AIX Unix because when I try to run a script it says a specific file is missing. I copied an entire directory structure from one AIX to this new AIX server. But apprently there was a file missed.

So I'm trying to locate the missing file.

Thanks
0
Comment
Question by:matrix0511
9 Comments
 
LVL 8

Accepted Solution

by:
pilson66 earned 2000 total points
ID: 36992887
locate filename
find / -type f -name filename
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 36992914
did you see on your server from where you copied the files that the file is there also? how you did the copy? it could be a missing soft link that or a soft link pointing to wrong dir especially if you change dir structure
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36992972
Why don't you just copy the missing file again from the source AIX server?

wmp
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 2

Expert Comment

by:speculatrix
ID: 36993002
if it's a script, run it with -x to see where the error is coming from?

sh -x /path/scriptname

?
0
 
LVL 14

Expert Comment

by:sentner
ID: 36994817
One thing I'd suggest is to ensure your permissions, symbolic links, etc, get copied properly by doing it as a "tar copy".  This can be done over a shell session, such as through SSH.  

For example, to copy the tree /home from host1 to host2, you could do (from host1):

cd /home
tar cf - . | ssh host2 '(cd /home; tar xBpvf - )'

This should give you a complete copy of every file, including special files, directories, symlinks, named pipes, etc.

0
 
LVL 5

Expert Comment

by:hossamshaaban
ID: 36999031
find path_of_directory -name "filename"
0
 
LVL 6

Expert Comment

by:Tomunique
ID: 37000325
One issue to watch if you used tar, is LONG filenames.  it will drop them.

0
 
LVL 14

Expert Comment

by:sentner
ID: 37000416
Standard tar does have a maximum filename length of 100 characters, and a total path length limit of 255 characters.  However, GNU tar does not have this limitation.
0
 
LVL 2

Expert Comment

by:speculatrix
ID: 37005970
rsync is better than tar, and works across hosts too

e.g.

rsync -av /path/source/ /path/target

rsync -avz srchosst:/path/source /path/localtarget

rsync -avz /path/source host:/path/remotetarget

be careful about trailing slashes, as that affects what rsync actually copies and to where omit trailing slash on source to copy the directory to the target for example.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

825 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