dont use capital letter vars. those are better used by the environment. never try to parse ls output. use globbing instead. if you’re writting bash, then prefer [[ over [. do not cat file to read it. instead read it in a while loop. always quote your variables. they’re also easier found if grouped. treat a list of files, as an array. if you Full Article…
Viewing 1 to 2 of 2 items
Script to kill matching processes owned by a specific user after a certain time
This Linux Bash shell script will kill matching processes using grep owned by a specific user after a certain amount of time has passed. It requires the ‘/proc’ file system on Linux and uses the time stamp on the ‘cmdline’ virtual file which is time-stamped with the process start time. Specifically, this one kills old Full Article…