OSUnix

df says disk is full, but it is not

df says disk is full (Disk space is 100%) but actually it is not having files contributing it to be 100%. There are various possibilities for the case as below: 1. Processes holding deleted files You have deleted the files in order to create some space on drive, but there are still the processes which has opened the large files which has been deleted. You’ll have to kill that process to…
Read more
OSUnix

Removing Older files in Unix

Support analysts know it well 😉 We mostly have the requirement to remove the older files from the directory. Lets look at the quickest solution to achieve the task of Removing Older files Solution : find . -ctime +20 -exec ls -ltr {} \;  Explanation : find . : Find…
Unix

Number of seconds since midnight till now in unix

Had a requirement to find out the number of seconds since midnight till now in unix. Basically the requirment was more to this, it was to find the latest file created after midnight having specific pattern and to search certain pattern in it 😉 nice one right…… Anyway splitting the blog to provide you the code to find out the number of seconds past midnight and solution is as below…
Read more
Unix

Remove duplicate lines from file using awk

We mostly have the requirement to remove duplicate lines from file, support guys know the pain well 🙂 Lets look at the quickest solution to achieve this. Requirement: Solution : awk ‘!x[$0]++’ file1.txt Explanation : x[$0]: look at the value of key…