Skip to content

Tag: linux

Kill all processes from C in Linux

I am writing a Linux C program that will be executed as init. It will eventually need to shut down the system. I have code for unmounting all the filesystems and actually turning off the system; now I just need a way for it to send SIGTERM to all processes, sleep(5), then send SIGKILL to any remaining process…

dynamic string search in shell script

I have a string in shell script which is I need to find DS_BLS_max(sequence number).dat here DS_BLS_max(sequence number).dat=DS_BLS_739.dat Answer Output: DS_BLS_739.dat See: The Stack Overflow Regular Expressions FAQ

Enable a linux service to show popup window

I developed an IP messenger using C language and I wish to share some of it’s implementation details to make completely understand my problem. Used GTK+-2.0 library for showing GUI windows. It has a listening socket and whenever a new connection arrives then it will create a new process to serve the con…

Rename part of filename using regex

I have a bunch of files where there is additional information in square brackets. I would like to rename them by removing that section. For example: Want to rename to: I tried playing with regex (and using the rename command) but without success. Does anybody know a way to have the rename command strip of onl…