Skip to content

Instantly share code, notes, and snippets.

@bretonics bretonics/bashTricks.md
Last active Aug 2, 2018

Embed
What would you like to do?
Tricks to remember on the CL
Rename file by replacing old text pattern with new (overwrite existing)
for f in *.txt ; do echo "${f/old/new}"; done

for f in *.txt; do mv "$f" `echo $f | sed s/old/new/\`; done
Find symlink to same inode
find -L / -samefile path/to/file.txt
Loop through results of find
find | while read directory; do $directory; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.