help understanding 'exec' command plz


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help understanding 'exec' command plz
# 1  
Old 10-29-2010
help understanding 'exec' command plz

plz someone explain me what does -exec ls -Fd do?


SmilieSmilieSmilieSmilieSmilieSmilie

Thanks in advance !!
# 2  
Old 10-29-2010
In what context? Is it an option to find, or being run as a command in a shell?

Also. "plz" is not a word.
# 3  
Old 10-29-2010
if it's for the find command, it will execute the command after the -exec for each item found.
# 4  
Old 10-29-2010
Each file or directory found by the "find" will have its directory entry displayed in a special format. If it happens to be a directory, only the line for the directory will be displayed not its contents.

Code:
Extract from a "man ls" (Yours may differ slightly). 

          -d   If an argument is a directory, list only its name (not its
                contents); often used with -l (ell) to get the status of a
                directory.

         -F   After each file name, put one of:

                +  A slash (/) if the file is a directory or a symbolic link
                   to a directory.
                +  An asterisk (*) if the file is executable;
                +  An at-sign (@) if the file is a symbolic link to a file;
                +  A vertical bar (|) if the file is a fifo.


It only really makes sense if the "find" looks roughly like this:
The {} means the name of the file found by the find.
Code:
find . -name myfile -exec ls -Fd {} \;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Linux find command seems to not transmit all the result to the '-exec command'

Hello. From a script, a command for a test is use : find /home/user_install -maxdepth 1 -type f -newer /tmp/000_skel_file_deb ! -newer /tmp/000_skel_file_end -name '.bashrc' -o -name '.profile' -o -name '.gtkrc-2.0' -o -name '.i18n' -o -name '.inputrc' Tha command... (3 Replies)
Discussion started by: jcdole
3 Replies

2. UNIX for Dummies Questions & Answers

Need help with SED command plz

I need two solutions 1) How can i swap the first and last character in each line of file temp 2) How can i display content of the file using sed command Please help (2 Replies)
Discussion started by: champu
2 Replies

3. Shell Programming and Scripting

exec command

How can I use the exec command to log my korn shell session to the screen and the log file? Currently I have this command: $exec 1> ${LOG} 2>&1 This logs the output to the log file only. I want it to go to the screen also. Is this possible with this command? thanks. (10 Replies)
Discussion started by: djehresmann
10 Replies

4. Shell Programming and Scripting

exec command help

All, I am using below shell script to output the content to outputfile.txt. What I am looking for is in addition to outputfile.txt, I want the output to be on standard output too. exec > outputfile.txt echo "Starting " echo "ending" (5 Replies)
Discussion started by: basic_shell
5 Replies

5. Solaris

Plz help me in understanding SUDO !!

Hello, I 'am trying to understand how sudo works. OS: Solaris 10 on SPARC I have 3 OS users: Oracle,App,Vendor. User : Group Oracle : oinstall,dba App : oinstall,dba,work Vendor : work What i want to do I need to run sqlplus from VENDOR using APP as... (3 Replies)
Discussion started by: JohnJacobChacko
3 Replies

6. UNIX for Dummies Questions & Answers

am a newbie to unix. plz help in understanding this code.

hi everybody. please help me in understanding this code. echo "************* starting job on `date +\"%d/%m/%Y at %T\"` **************" # scriptdir=`dirname $0` . ${scriptdir}/env_params.sh # SHLIB_PATH=${ORACLE_HOME}/lib: export SHLIB_PATH export... (1 Reply)
Discussion started by: gokulj
1 Replies

7. UNIX for Dummies Questions & Answers

explain command plz

echo -n "1. Updating Password Policy in OID..." | tee -a $logfile set ldap_v1 = `ldapsearch -b "" -h $oid_host -p $oid_port -D "cn=orcladmin" -w $admin_pwd -s sub "cn=PwdPolicyEntry" dn | head -1` echo "dn:$ldap_v1" > ldap1.out echo "changetype:modify" >> ldap1.out echo... (2 Replies)
Discussion started by: maoro
2 Replies

8. UNIX for Dummies Questions & Answers

Plz Help : How to use write command to execute command on some other terminal

Hi Group , I m trying to execute commands on some other system using write command but inspite of executing the commands they r passed as simple messages. - i m writing >write user-id ! ls o ctrl-d inspite of executing the command ls,other terminal shows ! ls. Thnx in advance. (2 Replies)
Discussion started by: Aashish
2 Replies

9. UNIX for Dummies Questions & Answers

using the -exec command

linux redhat 8.0 I am getting accustomed to using the -exec command to get around my databse.. and use it to edit and update files..! is this more apllicable than jumping from one directory to the other.. I have set up the databse so that the inode #'s are accessable and can get me from one... (0 Replies)
Discussion started by: moxxx68
0 Replies

10. UNIX for Dummies Questions & Answers

plz Help How should I configure cc compiler output file plz help???

i.e configuration of C compiler :confused: (4 Replies)
Discussion started by: atiato
4 Replies
Login or Register to Ask a Question