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.
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
I am facing a weird issue while executing a code below -
sh UKBA_publish.sh UKBA 28082015 3
echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below.
echo "The script is called"... (2 Replies)
I am using blow script :--
FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not
# echo "process found"
echo "process not found"
exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file.
echo " $2 $3 $4 $5 $6 $7
isql -w400 -U$2 -S$5 -P$3 << xxx
print"**Changes to the table... (0 Replies)