Difference between revisions of "Find"
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | ``` | ||
+ | find ./internal -type f -name "*.go" -exec gofmt -w {} + | ||
+ | find internal/ -type f -name "*.go" -print0 | xargs -0 gofmt -w | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | find /var/ -xdev -type f -exec du {} \; | sort -rn | head -20 | ||
+ | ``` | ||
+ | |||
``` | ``` | ||
find . -name versions.tf -type f -print0 | xargs -0 sed 's/required_version = \">= 0.13\"/required_version = \">= v1.12.2\"/g' | find . -name versions.tf -type f -print0 | xargs -0 sed 's/required_version = \">= 0.13\"/required_version = \">= v1.12.2\"/g' | ||
Line 5: | Line 14: | ||
find . -name filename.txt -type f -print0 | xargs -0 cp /tmp/newfilecontents.txt | find . -name filename.txt -type f -print0 | xargs -0 cp /tmp/newfilecontents.txt | ||
+ | ``` | ||
+ | |||
+ | # Permissions | ||
+ | ``` | ||
+ | find /var/www/html -type d -exec chmod 755 {} \; | ||
+ | find /var/www/html -type f -exec chmod 644 {} \; | ||
+ | |||
+ | |||
+ | find /var/www/html -type d -exec chmod u=rwx,go=rx {} \; | ||
+ | find /var/www/html -type f -exec chmod u=rw,go=r {} \; | ||
``` | ``` |
Latest revision as of 18:30, 15 April 2024
find ./internal -type f -name "*.go" -exec gofmt -w {} + find internal/ -type f -name "*.go" -print0 | xargs -0 gofmt -w
find /var/ -xdev -type f -exec du {} \; | sort -rn | head -20
find . -name versions.tf -type f -print0 | xargs -0 sed 's/required_version = \">= 0.13\"/required_version = \">= v1.12.2\"/g' find . -name versions.tf -type f -print0 | xargs -0 sed '/.*source.*/i \ \ version = \"~> 1.12.2\"' find . -name filename.txt -type f -print0 | xargs -0 cp /tmp/newfilecontents.txt
Permissions
find /var/www/html -type d -exec chmod 755 {} \; find /var/www/html -type f -exec chmod 644 {} \; find /var/www/html -type d -exec chmod u=rwx,go=rx {} \; find /var/www/html -type f -exec chmod u=rw,go=r {} \;