Last active
October 22, 2023 12:10
-
-
Save hightemp/b5590da5c1fc3bb7cba28ca5659cd009 to your computer and use it in GitHub Desktop.
Revisions
-
hightemp revised this gist
Oct 13, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ du -c `find . -maxdepth 1 -name '*.php'` | tail -1 ## Count lines in files with mask ```bash find . -maxdepth 1 -name '*.php' -print | xargs wc -l ``` ## Exclude path from search by `find` -
hightemp revised this gist
Oct 13, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,9 @@ du -c `find . -maxdepth 1 -name '*.php'` | tail -1 ``` ## Count lines in files with mask ```bash find . -maxdepth 1 -name '*.php' | xargs echo | xargs wc -l ``` ## Exclude path from search by `find` -
hightemp revised this gist
Oct 13, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,10 @@ # Bash snippets ## Get size of files of current directory with mask ```php du -c `find . -maxdepth 1 -name '*.php'` | tail -1 ``` ## Count all lines in files ```bash (find ./ -name '*.*' -print0 | xargs -0 cat ) | wc -l -
hightemp revised this gist
Sep 14, 2018 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,4 +28,10 @@ find . -type f \( -name "*.shtml" -or -name "*.css" \) ### Method 2 ```bash find -type f -regex ".*/.*\.\(shtml\|css\)" ``` ## C++ calls graph ```bash clang++ -S -emit-llvm main.cpp -o - | opt -analyze -dot-callgraph dot -Tpng -ocallgraph.png callgraph.dot ``` -
hightemp revised this gist
Sep 14, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,6 +21,11 @@ ls -1 -- **/+(*.jpg|*.gif|*.png) ``` ## Use `find` with multiple extensions ### Method 1 ```bash find . -type f \( -name "*.shtml" -or -name "*.css" \) ``` ### Method 2 ```bash find -type f -regex ".*/.*\.\(shtml\|css\)" ``` -
hightemp revised this gist
Sep 14, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,9 @@ rename 's/(.*)/$1.jpg/' * ## Recursively output list of files with extensions ```bash ls -1 -- **/+(*.jpg|*.gif|*.png) ``` ## Use `find` with multiple extensions ```bash find . -type f \( -name "*.shtml" -or -name "*.css" \) ``` -
hightemp revised this gist
Sep 14, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,4 +13,9 @@ find ./ -name '*.*' -not -path "./pathname/*" ## Rename files by mask, add extension to files ```bash rename 's/(.*)/$1.jpg/' * ``` ## Recursively output list of files with extensions ```bash ls -1 -- **/+(*.jpg|*.gif|*.png) ``` -
hightemp revised this gist
Sep 14, 2018 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,9 @@ ## Exclude path from search by `find` ```bash find ./ -name '*.*' -not -path "./pathname/*" ``` ## Rename files by mask, add extension to files ```bash rename 's/(.*)/$1.jpg/' * ``` -
hightemp created this gist
Sep 14, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # Bash snippets ## Count all lines in files ```bash (find ./ -name '*.*' -print0 | xargs -0 cat ) | wc -l ``` ## Exclude path from search by `find` ```bash find ./ -name '*.*' -not -path "./pathname/*" ```