Breaking News
Home / Sys Admin / Unix (page 2)

Unix

SELinux does not allow Apache to use Sendmail

SELinux is activated and configured by default. As such  SELinux does not allow Apache (httpd,phpmailer) to use the sendmail function and make any sort of network connection. Using the getsebool command we can check if httpd demon is allowed to make a connection over the network and send an email. …

Read More »

How perform global search and replace in vi?

Solution Use the following command for global search & replace in the file: :%s/search_string/replacement_string/g This command tells vi to scan all lines in the file for search_string and change it to replacement_string throughout the file in one short. [pb_builder]

Read More »

How to find a list of files greater than a given size in Unix?

Solution Use the find command with ls command to find a list of file in the current directory that are over 1000k or 1MB  find . -size +1000k -print0 | xargs -0 ls -lSh Output rw-r–r–  1 mvohra  staff   1.7M Sep 14 20:53 ./work/lohri/Lohri_10.psd-rw-r–r–  1 mvohra  staff   1.7M Sep 13 …

Read More »

How to sort the directories based on their sizes?

Solution Use the du command with the sort command as $ du -s * | sort -rn 747624    work23856    cards7040    postie680    convert120    thumbs This will list the the size in bytes for the directories in the current directory based on the descending order of their sizes. [pb_builder]

Read More »