Skip to content
Advertisement

Tag: unix

Irregular result in zombie example

I have problems with understanding the behavior of this code: When running in a Unix shell I get this result: But sometimes its only giving me this result without any shell prompt: I know it can be solved with wait() function in parent process. But I like to know: Why is result irregular? Could someone please explain what happening? Child

a program to alert when /var files system usage reaches threshold

I am working on a program which will send an snmp alert when /var reaches maximum threshold. I am having trouble with calculating % of /var disk usage for this. I have this command “du -hs /var” which give me usage of /var in MB and /var is in the /root directory. So to calculate total disk on which /var

Check the parameter already in server

How to check the already set parameters in Linux/Oracle. For example, as soon as I login to Linux if I type cd $AU_TOP, it directly goes to the path set in AU_TOP. Now I want to see like AU_TOP what are the other parameters is there. Answer If typing cd $AU_TOP take you to some directory – Means you have

Print grep Keyword if grep find a match

I have an input file Input.txt with the following sample keywords: I also have a file Text.txt to search such as: I want to print grep Keyword followed by a match if the grep finds a match. The desired output: Answer With awk you could do something like this: In a more readable format it would be:

Get last 30 minutes from log file

I have a log file that contain logs as follows 1486307866.155 is the time in unix format with corresponds to 2017-02-05 07:17:46 (Format : Y-m-d H:i:s) I need a unix command that give me the logs within last 30 minutes in the following format and discarding any details that i don’t need. 2017-02-05 07:17:46|68.146.231.80|clients1.google.com:443 Answer Using GNU date and GNU

unexpected result(-wS-wx–T) on file permission with open() function in C

I wrote this program to open a file. Everything was OK until I saw this permission(-wS-wx–T) with ls -lh open.c I compiled the program featly, didn’t take any error or warning. I haven’t ever seen kind of permission. What are ‘S’ and ‘T’ meaning in the file permissions section? (NOTE: I took the answer to this question in the comments.)

Advertisement