Linux shell script: Pause (Suspend) a process with kill signals
In this post we will see how to pause (suspend) and start a linux process using signals (SIGTSTP and SIGCONT) via kill command.
In this post we will see how to pause (suspend) and start a linux process using signals (SIGTSTP and SIGCONT) via kill command.
10+ useful code snippets of Linux shell scripts for how-to color, sendmail, log, change dir, parse parameters, loop, configuration file, switch..case and more.
If you are a Stock Market Addict and a Techie; normally working on Linux(es); this post will interest you as you still can get quote of your stock on your Linux prompt. Consider, we have Google Finance url for Tata Consultancy Services Stock: http://www.google.com/finance?q=NSE:TCS So, how do you get above stock price while you’re on Linux / Unix server? It’s a sinlge line command and you get your stock’s current price. 🙂 curl –silent -X Get “http://www.google.com/finance?q=NSE:TCS” > /tmp/ChangeIsInevitable && cat /tmp/ChangeIsInevitable | grep -m1 -E ‘span id=”ref_’ | awk -F “>” ‘{print $2}’ | awk -F “<” ‘{print $1}’...
I’m using Redhat Linux (RHEL 5). Yesterday I saw a bit suspicious activities and data movements under my “home” (/home/username directory). I thought of investigate / audit through my Redhat linux machine and catch the “Right Person” / “Who did it”. Following are the steps I followed: [which if you follow, you may follow.] 1. Retrieve all successful logins on the system cat /var/log/secure* | grep Accepted > logins.txt Now logins.txt will contain all successfull logins to you Redhat linux system. You may go through the file and have a manual first look up. 2. Check users at perticular time Other command...
I have done it for so many times, setting a cronjob. Today I was tring to set a simple cronjob which will output the log file with timestamp attached filename. Hourly running cron entry was: 0 * * * * perl demo.pl > demo-out_`date “+%Y-%m-%d_%H-%M”`.log Running the same command on shell prompt was working fine. Execute permissions and path were proper. But it kept on failing to create the proper log!! I changed the crontab as follows, added \ before % to escape and voila!! Things worked !! 0 * * * * perl test.pl > test-out_`date “+\%Y-\%m-\%d_\%H-\%M”`.log A quick lesson....