symlinks -delete all invalid soft links in Linux/Fedora

2012-06-12 1 min read bash Fedora Linux
First of all, install symlinks if it is not installed : sudo yum install symlinks and here is the description: Description : The symlinks utility performs maintenance on symbolic links. Symlinks checks for symlink problems, including dangling symlinks which point to nonexistent files. Symlinks can also automatically convert absolute symlinks to relative symlinks. Install the symlinks package if you need a program for maintaining symlinks on your system. and the help for the same: Continue reading

Find all the missing paths in the PATH variable in bash script

2011-01-20 1 min read bash Fedora Learning
Here is a simple script that will list out all the paths in the PATH variable that do not exist. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 <td> <div class="text codecolorer"> #!/bin/bash -<br /> #===============================================================================<br /> #<br /> # FILE: wrong_path.sh<br /> #<br /> # USAGE: ./wrong_path.sh<br /> #<br /> # DESCRIPTION: Show Directories in the PATH Which does NOT Exist<br /> #<br /> # OPTIONS: ---<br /> # REQUIREMENTS: ---<br /> # BUGS: ---<br /> # NOTES: ---<br /> # AUTHOR: Amit Agarwal (AKA), amit. Continue reading

Find out why a program can't seem to access to a file

2010-05-05 2 min read Fedora Linux
$ strace php tias.php -e open,access 2>&1 | <a class="zem_slink freebase/en/grep" href="http://en.wikipedia.org/wiki/Grep" title="Grep" rel="wikipedia">grep foo.txt Sometimes a program refuses to read a file and you&#8217;re not sure why. You may have display_errors turned off for <a class="zem_slink freebase/en/php" href="http://www.php.net/" title="PHP" rel="homepage">PHP or something. In this example, fopen(&#8217;/var/www/test/foo.txt&#8217;) was called but doesn&#8217;t have read access to foo.txt. Strace can tell you what went wrong. E.g., if php doesn&#8217;t have read access to the file, strace will say &#8221;EACCESS (Permission denied)&#8221;. Continue reading