Skip to content

Instantly share code, notes, and snippets.

@nichoth
Last active July 19, 2025 20:29
Show Gist options
  • Save nichoth/5a7329f5cb76220337c6e013f638427b to your computer and use it in GitHub Desktop.
Save nichoth/5a7329f5cb76220337c6e013f638427b to your computer and use it in GitHub Desktop.
Bash commands cli

bash

rename

Change the file extension for all .js files in dir

for file in ./dir/*.js; do mv ${file} ${file/.js/.ts}; done

set the working directory for a command

bash -c 'cd ./test && esbuild index.ts'

tar + gzip

tar -czvf my-new-file-name.tar.gz my-existing-folder
@nichoth
Copy link
Author

nichoth commented Jul 19, 2025

find things

search for directories only

Use -type d

find . -type d -name "foo"

search for filenames, case insensitive

find . -iname "filename.txt"

"fuzzy" search

See brew fzf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment