Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

find and execute a command

find . -name "*.txt" -exec echo {} ; -exec grep banana {} ;
Comment

find and execute a command

find . -type d -exec sh -c "echo -n {}; echo -n ' x '; echo {}" ;
Comment

find and execute a command

multiple_cmd() { 
    tail -n1 $1; 
    ls $1 
}; 
export -f multiple_cmd; 
find *.txt -exec bash -c 'multiple_cmd "$0"' {} ;
Comment

find and execute a command

find ... | while read -r file; do
    echo "look at my $file, my $file is amazing";
done
Comment

PREVIOUS NEXT
Code Example
Shell :: ubuntu watch log file command 
Shell :: linux convert files in folder 
Shell :: bluetooth linux 
Shell :: how to run sudo without password 
Shell :: jupyter notebook not rendering permission denied ubuntu 
Shell :: install antigen mac 
Shell :: centos zip folder 
Shell :: network manager restart ubuntu 
Shell :: how to delete a branch in github 
Shell :: target lcobucci jwt parser is not instantiable while building laravel passport 
Shell :: bash add or subtract one column from another 
Shell :: commit convention 
Shell :: git log format online 
Shell :: batch delete folder 
Shell :: git default branch name config 
Shell :: ubuntu install latest node with nvm 
Shell :: linux remove empty lines 
Shell :: git pasar de https a ssh 
Shell :: stop docker container 
Shell :: list git config 
Shell :: get all the branch in git 
Shell :: install node brew 
Shell :: jq windows 
Shell :: add i386 architecture ubuntu 
Shell :: turn of raspberry 
Shell :: git list aliases 
Shell :: vmware workstation merge vmdk files 
Shell :: git delete tag from commit 
Shell :: execute as another user linux 
Shell :: how to see pip installed packages 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =