Skip to content

Instantly share code, notes, and snippets.

@ivalentinee
Last active September 2, 2015 08:52
Show Gist options
  • Save ivalentinee/08391a796d1b9e7f0e9c to your computer and use it in GitHub Desktop.
Save ivalentinee/08391a796d1b9e7f0e9c to your computer and use it in GitHub Desktop.
playing with grep/sed/tail/etc...
# most hungry processes (no, htop is too mainstream)
ps aux --sort -rss | head -n 10 | sed 's/[^ ]* *[0-9]* *\([0-9\.]*\) *\([0-9\.]*\) *[0-9]* *[0-9]* *? *[SsLl]* *[^ ]* *[^ ]* *\([^ ]*\).*/processor: \1%, memory: \2%, process: \3/'
# fix unzipped files with russian names in current directory
find . -type f -exec sh -c 'np=`echo {}|iconv -f cp1252 -t cp850| iconv -f cp866`; mv "{}" "$np"' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment