Category Archives: Uncategorized

What process is using how much swap memory

I found this interesting script that prints out a list of processes that are using swap space. I changed the output to suppress the PIDs that aren’t using swap. #!/bin/bash # Get current swap usage for all running processes # … Continue reading

Posted in Bash, Hardware, Linux, Uncategorized | Leave a comment

A word from the author.

Today I read some comments here in the blog. I want to thank all of you for the nice words about this blog. Unnecessary to mention that comments are appreciated. I will try to keep this blog on a more … Continue reading

Posted in Uncategorized | Leave a comment

Bash: How to trim a string or a variable

Sometimes you are looking for a simple way to get rid of leading or tailing spaces in a string or variable. Here’s a function I usually use in my bash scripts: function trim() { trvar=$1 trvar=”${trvar#”${trvar%%[![:space:]]*}”}” trvar=”${trvar%”${trvar##*[![:space:]]}”}” echo -n “$trvar” … Continue reading

Posted in Bash, Linux, Uncategorized | 1 Comment