Script Help (ls) ??

...

I am leary this may be home work simply because of the word "apple", so I will only give you a suggestion. Look at the -exec option of find. You can use this with a cp command to copy the file to /tmp.

...

The "homework" thing is arising because the questions that you posting look very much like problem that an instructor would assign to a student. If a student cannot complete such an assignment, the student must seek more help from the instructor. If we simply do the assignment for the student we are sabotaging the class.

I will take your word that you are not enrolled in a formal unix class.

From your post it appears that you have the root password and that you are using to root account while you experiment with commands that you don't understand. This is a very big mistake. The root account has the power to do anything. Sooner or later you are going to make an error that will damage your system. And you don't have the knowledge to fix it. You need to experiment as a non-root user. Become root only when you absolutely must, do what you must, and then get out. Don't stay logged on as root.

As for your question, I don't like the -exec option very much because it is not very efficient. I would use:
find / -name apple -print | xargs ls -l > /tmp/namefile

And while you're experimenting, maybe you should just do "find /home/april" or something rather than "find /". A find from / like that can take a long time. You can get the syntax right by just experimenting with your own home directory. This is also somewhat safer.

Finally, you really do need to improve your skills at searching both at this site and at google. There is a lot information available on the web about the questions that you are asking. And it's not fair for you to expect us to type in another copy for each question that you have. Also you probably have the man pages installed on your system. If so, you can type stuff like "man find" and get some help.

Thank You All for Helping...:smiley:

Thank You Perderabo

April,

You don't have to delete your postings just because they seemed like homework.

Please leave them intact. They will provide good examples for others to see that you are doing "personal advancement" and not "homework for school".

:smiley: