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

faster bash operations on files with File Descriptors.

2011-06-11 2 min read bash Learning Linux
I was writing a bash script that would do some operations and read and write to file. Seems that that was pretty simple with 1 2 3 4 5 <td> <div class="text codecolorer"> while read line<br /> <br /> do<br /> <br /> done<file </div> </td> </tr> and then use redirection operations like “>” and “»” to write to file. Done with the script pretty fast. So far so good, when I went for real life tests, no one was interested in using it, why? Continue reading

tee to a file descriptor

2010-08-13 1 min read bash Linux
tee to a file descriptor 1 $ tee >(cat &#8211; >&2) the tee command does fine with file names, but not so much with file descriptors, such as &2. This uses process redirection to tee to the specified descriptor. In the sample output, it’s being used to tee to stderr, which is connected with the terminal, and to wc -l, which is also outputting to the terminal. The result is the output of bash –version followed by the linecount Continue reading

prepend to a file with sponge from moreutils

2010-03-16 1 min read Linux
<a href="http://bashcurescancer.com/prepend-to-a-file-with-sponge-from-moreutils.html">A few weeks I wrote about a tool, which helps you easily prepend to a file. I submitted prepend to moreutils and Joey was kind enough to point out this could be done with `sponge&#8217;.? sponge reads standard input and when done, writes it to a file: Probably the most general …<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://helpdeskgeek.com/linux-tips/crontab-howto-tutorial-syntax/">Automating Tasks in Linux Using Crontab (helpdeskgeek.com) <li class="zemanta-article-ul-li"><a href="http://www. Continue reading