Skip to content

Instantly share code, notes, and snippets.

@domanchi
Last active September 14, 2017 15:15
Show Gist options
  • Save domanchi/f9b8f9b11c06d9c21ca978f7df42327b to your computer and use it in GitHub Desktop.
Save domanchi/f9b8f9b11c06d9c21ca978f7df42327b to your computer and use it in GitHub Desktop.
[handy linux commands] Cheatsheet for cool things you can do with bash. #bash

Rename selected files using a regular expression

rename 's/\.bak$/.txt/' *.bak

Process Management

Check how long something takes to run

time ls

Limit memory usage for following commands

ulimit -Sv 1000			# 1000 KBs = 1MB
ulimit -Sv unlimited	# remove limit

Limit time for command

timeout 10s ./script.sh

References

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