This command searches for specific file types in the current directory and its subdirectories, extracts the code content (excluding comment lines), and copies the result to the clipboard.
find . -type f \( -name "*.<file_extension_1>" -o -name "*.<file_extension_2>" \) -print0 | xargs -0 -I {} sh -c 'echo {}; grep -v "^//" {}' | pbcopy$ find . -type f \( -name "*.js" -o -name "*.jsx" \) -print0 | xargs -0 -I {} sh -c 'echo {}; grep -v "^//" {}' | pbcopyThis example searches for all .js and .jsx files in the current directory and its subdirectories, prints the file paths, extracts the code content (excluding comment lines starting with //), and copies the result to the clipboard, ready to be pasted into another application.
This command compares the current branch with the 'develop' branch, showing the differences between them, and copies the output to the clipboard.
git diff <branch_name> | pbcopy$ git diff develop | pbcopyThis example compares the current branch with the 'develop' branch, and copies the differences (added, modified, or deleted lines) to the clipboard, ready to be pasted into another application.
This command prints the directory structure of the current directory and its subdirectories in a tree-like format and copies the output to the clipboard.
tree | pbcopyThis example prints the directory structure of the current directory and its subdirectories in a tree-like format and copies the output to the clipboard, ready to be pasted into another application.