Lets start with the 3 ones that I use daily, the ones I use at times every hour or such, especially when RAM and CPU gets used up with my palemoon and 3 windows & 30 tabs minimum each, x versions of an image viewer, x open files in at least 2 mousepads, at times an gmplayer or mtpaint, or even gimp.
Oh, and for email alpine, and for coding either mcedit or geany. So you see, even a system with 3 1/2 GB RAM and Dual Core CPU gets into stress.
So, here my top 3: aliases/functions:
top4;fx;sx
Code: Select all
rava@porteus:/mnt/DL$ top4;fx;sx
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6728 rava 20 0 19748 2476 2032 R 4 0.1 0:00.02 top
13074 root 20 0 596m 171m 20m S 2 5.1 1284:17 X
29350 rava 20 0 4209m 2.1g 10m S 2 64.3 1056:19 palemoon
1 root 20 0 240 16 0 S 0 0.0 0:18.38 init
16.04.2016 17:15:42 ____________________________________________________________
total used free shared buffers cached
Mem: 3393 3237 155 0 19 338
-/+ buffers/cache: 2879 513
Swap: 6326 2063 4263
16.04.2016 17:15:43 ____________________________________________________________
Filename Type Size Used Priority
/dev/zram0 partition 678 0 1000
/dev/sda1 partition 2047 0 100
/mnt/sda3/pagefile.sys file 3599 2063 -1
top4 gives me the topmost 4 CPU using processed (utilizing, of course, top)
fx is my "free eXtended, aka in MB. With dividing ruler. And date/time stamp. For later / former comparisons.
sx is the same for swap, my "swap eXtended". (also with dividing ruler. And date/time stamp. For later / former comparisons.)
And since /dev/swaps or swapon -s not have an "MB option", I had to code it myself. I asked for some help on that coding over at http://www.linuxforums.org/ (I would have preferred stackoverflow, but it fails in registering when using palemoon, and since it has a large part of its site especially for coding.... still sadly they are not willing to fix that issue, they just tell me (use firefox or chrome for setting up the account"
Yeah thanks, real coder brilliance! (Or lazyness)
Code: Select all
rava@porteus:/mnt/DL$ type top4 fx sx
top4 is aliased to `top -bn 1|head -n 11|tail -n 5'
fx is aliased to `echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________;free -m'
sx is a function
sx ()
{
echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________;
{
read firstLine;
echo "$firstLine";
while read f t s u p; do
let "s2 = $s / 1024";
let "u2 = $u / 1024";
printf '%-40s%-16s%-8s%-8s%-8s\n' $f $t $s2 $u2 $p;
done
} < /proc/swaps
}
Maybe someone guesses what dx could be, seen what sx and fx do?
Code: Select all
# dx
16.04.2016 17:34:42 ____________________________________________________________
Filesystem Type 1M-blocks Used Available Use% Mounted on
aufs aufs 1528 906 622 60% /
/dev/sda2 ext3 3904 3858 45 99% /mnt/sda2
/dev/sda3 ntfs 32022 31483 539 99% /mnt/sda3
/dev/loop18 ext2 25 22 3 89% /Lsfind
dx is my dfree eXtended, (and again, also with dividing ruler. And date/time stamp. For later / former comparisons.)
I know, once again a lame coded defaulting to 80 $COLUMNS so far, I was too lazy to code for a wider display than 80, are a less wide or "more narrow" display would screw up the info for sf, fx or dx almost always, and it not bothers me when the divider ruler is only 80 chars wide since none of the printed info usually is any wider.
Okay, dfree's output could be longer, depending on the mounted path length, but usually that's in the form of /mnt/sdXn and not any longer.
But maybe you realize that I not just run dfree -mT, but my dx also omits two lines I usually am never interested in.
Lets ask dfree -mT for comparison, shall we?
Code: Select all
$ df -mT
Filesystem Type 1M-blocks Used Available Use% Mounted on
aufs aufs 1528 908 620 60% /
devtmpfs devtmpfs 1696 1 1696 1% /dev
/dev/sda2 ext3 3904 3858 45 99% /mnt/sda2
/dev/sda3 ntfs 32022 31483 539 99% /mnt/sda3
/mnt/live/run none 1697 3 1695 1% /run
/dev/loop18 ext2 25 22 3 89% /Lsfind
I am not interested in devtmpfs or /mnt/live/run, usually these FS never get any more full than 1% regardless for full my local disk, or my RAM and swap is. And that's, as far as I understand it, the normal way since that disk space is used differently and not for use for standard files and such, like storing some more ISOs or MPEGs [1]. (Look it up what they do please if you want, its part of either how /dev works, or how a live Linux works (/mnt/live/run)
So, you maybe want to know how I coded that, aka dx omitting the unneeded 2 lines? [If your system should misbehave, please also do look at standard dfree -mT and see if, maybe, these two show strange full stats or such... just in case.
![Smile :)](./images/smilies/smile.gif)
Do you, or don't you? Please do tell me if anyone is interested in my mini coding stuff at all.
Thanks for your time!
![Image](http://a.deviantart.net/avatars/c/o/cocoglompplz.gif)