Skip to content

Instantly share code, notes, and snippets.

@tairov
Last active December 19, 2015 04:49
Show Gist options
  • Save tairov/5900317 to your computer and use it in GitHub Desktop.
Save tairov/5900317 to your computer and use it in GitHub Desktop.
useful shell commands, sed replace, mongodb log
perl -ne '/([0-9a-z]{24,24})/ and print $1, "\n"' 01_07.txt
# run command with only 1 argument (-L 1, --max-lines 1) and ask before each command
ls -la | xargs --interactive -L 1 echo
# substitution in xargs
xargs -L 1 -I{} echo "ID IS: {}"
sed -i -e s/\,\.\$comment:.\".*\"// mongodb_short_sed.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment