Basic Linux and UNIX like system monitoring tool

7 days ago

Quote of the Day

here, in this articles i introduces to you, whom are new to Linux or UNIX like operating system to discover your system process.. simplified :)

vmstat – System Activity, Hardware and System Information
The command vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.
# vmstat 3
# vmstat -m -> display memory utilization
# vmstat -a -> display memory active or inactive
$ vmstat -S M 2 -> collect data every 2 seconds
$ vmstat -S M 2 5 -> collect data every 2 second 5 times only

w – Find Out Who Is Logged on And What They Are Doing
# w username
# w guest

ps – Displays The Processes
# ps -Al -> show long formatted
# ps -AlFH -> see the threads
# ps -AlLm -> see threads after process
# ps -ejH -> print process tree
# ps axjf -> print process tree
# pstree -> print process tree
# ps -U guest -u guest u -> see every process running as user guest
# ps -C lighttpd -o pid= -> disply process id of lighttpd
# pgrep lighttpd
# pgrep -u vivek php-cgi
# ps -p 55977 -o comm= -> display the name of PID 55977
# ps -auxf | sort -nr -k 4 | head -3 ->top 3 memory consuming proces
# ps -auxf | sort -nr -k 3 | head -3 -> top 3 cpu consuming process
# ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10 -> who is monopolizing or eating the CPUs
# ps -eo pcpu,pid,user,args | sort -r -k1 | less
$ ps -ef | grep swiftfox -> shwo swiftfox process
$ pkill swiftfox -> kill swiftfox process
$ pgrep -l swiftfox -> show swiftfox process in modern way

iostat – Average CPU Load, Disk Activity
# iostat
$ iostat -xtc 5 3 -> gives you three outputs every 5 seconds

/Proc file system – Various Kernel Statistics
/proc file system provides detailed information about various hardware devices and other Linux kernel information.
# cat /proc/cpuinfo
# cat /proc/meminfo
# cat /proc/zoneinfo
# cat /proc/mounts

Free – find out RAM information
$ free -mt

Find Out Virtual Memory PAGESIZE
$ getconf PAGESIZE or $ getconf PAGE_SIZE

CPU Limit
# cpulimit -e firefox -l 30 -> limit CPU usage of the process called firefox to 30%
# cpulimit -p 1313 -l 30 -> limit CPU usage of the process to 30% by using its PID
# renice +1 1024 -u daemon root -p 66 -> change the priority of process ID’s 1024 and 66, and all processes owned by users daemon and root.
$ /bin/nice -n 3 command-name

si.riesal

,

Location post: -6.304720010745837,106.68771743774414
lokasi penulisan via satelit gagal di panggil, harap kontak saya via email :)

Drop off your comment

---

Remove .php extensions using .htaccess

18 days ago

Quote of the Day

A .htaccess file is a simple ASCII file that you would create with a text editor like Notepad. It provides a way to make configuration changes on a per-directory basis.

To remove the .php extension from a php file for example yoursite.com/wallpaper.php to yoursite.com/wallpaper you have only to add the following code inside the .htaccess file:

Options +FollowSymLinks
Options +Indexes
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]

or, to be familiar with .htaccess, you can now create your own .htaccess file by using this tool: .htaccess maker

Hope these help :)

si.riesal

,

Location post: -6.328468076521969,106.67173147201538
lokasi penulisan via satelit gagal di panggil, harap kontak saya via email :)

Drop off your comments..

---

« Older