Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash perform operation on all files in directory

# Basic syntax:
find . -maxdepth 1 -type f -exec your_command {} ;
# Where:
#	- . specifies the current directory (this can be changed to any
#		directory)
#	- -maxdepth 1 prevents find from searching directories recursively
#	- -type f specifies that the operation should only be performed on
#		files (not directories)
#	- -exec runs your_command on all files that are found
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #perform #operation #files #directory
ADD COMMENT
Topic
Name
5+1 =