this tutorial content may not be accurate [youtube https://www.youtube.com/watch?v=q-ZOtubQtbQ?rel=0&w=560&h=315]
Tag Archives: process
pwdx – report current working directory of a process
A UNIX Command $pwdx 3805 1413 1412 1799 1009 2002 3805: /home/jeffrin 1413: Permission denied 1412: Permission denied 1799: Permission denied 1009: Permission denied 2002: Permission denied $ $sudo pwdx 3805 1413 1412 1799 1009 2002 [sudo] password for jeffrin: 3805: /home/jeffrin 1413: / 1412: /var/lib/mysql 1799: / 1009: / 2002: / $ UNIX Explanation …
Continue reading “pwdx – report current working directory of a process”
pmap – report memory map of a process
A UNIX Command $pmap 2307 | more 2307: bash 0000000000400000 868K r-x– /bin/bash 00000000006d9000 36K rw— /bin/bash 00000000006e2000 24K rw— [ anon ] 00000000010b9000 304K rw— [ anon ] 00007f1e4c89b000 44K r-x– /lib/libnss_files-2.13.so 00007f1e4c8a6000 2044K —– /lib/libnss_files-2.13.so 00007f1e4caa5000 4K r—- /lib/libnss_files-2.13.so 00007f1e4caa6000 4K rw— /lib/libnss_files-2.13.so 00007f1e4caa7000 40K r-x– /lib/libnss_nis-2.13.so 00007f1e4cab1000 2044K —– /lib/libnss_nis-2.13.so 00007f1e4ccb0000 4K …
number of processing units.
$nproc 1 $nproc –all 1 $ nproc Print the number of processing units available to the current process, which may be less than the number of online processors
context switch
context switch Multiprogramming leads to the concept of a process. Metaphorically,a process is a program’s breathing air and living space-that is,a running program plus any state needed to continue running it.Time- sharing is a variation of multi-programming that shares the CPU and memory with several interactive users at the same time, giving the illusion that …
Print With Delay 0.5 (process independency)
/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include #include int main() { int seconds; int i=0,getptr; pid_t pid; char array[20]=”Happy Friendship Day”; /* printf(“n Happy Friendship Day n”); */ pid=fork(); if (pid == 0) { setsid(); setenv(“PS1″,”$”,1); /* getptr=getenv(“PS1”); printf(“%s”,getptr); */ printf(“\n”); for(i=0;i<20;i++) { printf("%c",array[i]); /* for(seconds=0;seconds<100000000;seconds++);*/ /* …
Continue reading “Print With Delay 0.5 (process independency)”
Print With Delay 0.4 (fork step 1)
/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include #include int main() { int seconds; int i=0,getptr; pid_t pid; char array[20]=”Happy Friendship Day”; /* printf(“n Happy Friendship Day n”); */ pid=fork(); if (pid == 0) { setenv(“PS1″,”$”,1); /* getptr=getenv(“PS1”); printf(“%s”,getptr); */ printf(“\n”); for(i=0;i<20;i++) { printf("%c",array[i]); /* for(seconds=0;seconds<100000000;seconds++);*/ /* system("sleep …
fork example.
/* Jeffrin Jose <jeffrin@rocketmail.com> Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include main() { /* fork(); */ printf(“nhellon”); fork(); printf(“n World n”); }
pstree – display a tree of processes
ABOUT pstree pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown. [bash] $pstree -A init-+-NetworkManager—3*[{NetworkManager}] |-accounts-daemon—2*[{accounts-daemon}] |-acpid |-at-spi-bus-laun-+-dbus-daemon | `-3*[{at-spi-bus-laun}] |-at-spi2-registr—{at-spi2-registr} |-atd |-avahi-daemon—avahi-daemon |-bluetoothd |-colord—2*[{colord}] |-console-kit-dae—64*[{console-kit-dae}] …