Answers for "find and execute a command"

0

find and execute a command

multiple_cmd() { 
    tail -n1 $1; 
    ls $1 
}; 
export -f multiple_cmd; 
find *.txt -exec bash -c 'multiple_cmd "$0"' {} \;
Posted by: Guest on April-27-2021
0

find and execute a command

find . -name "*.txt" -exec echo {} \; -exec grep banana {} \;
Posted by: Guest on April-26-2021
0

find and execute a command

find ... | while read -r file; do
    echo "look at my $file, my $file is amazing";
done
Posted by: Guest on April-27-2021
0

find and execute a command

find . -type d -exec sh -c "echo -n {}; echo -n ' x '; echo {}" \;
Posted by: Guest on April-27-2021

Code answers related to "find and execute a command"

Browse Popular Code Answers by Language