Featured Posts

Installing MathabxInstalling Mathabx Mathabx is an important symbol library for latex. The full list of available symbols in latex can be found here. Following steps will help one to install mathabx in ...

Readmore

cronScheduled Tasks using cron Learn how to schedule tasks using cron in Linux!

Readmore

Joomla!Getting started with Joomla! Joomla! is a great open source tool for making great websites with very little effort and absolutely no cost ...

Readmore

Rss

Using grep to find all files containing a text string in Linux

0

Posted by Arsh | Labels: Linux, Ubuntu, Utilities | Posted on Friday, September 19, 2014

Often, we want to find if a directory structure contains a file with a given string pattern. This is specially useful for developers looking at a big code trying to connect various pieces of codes.

grep -rnw "STRING"  \path\ 

Here,

  • r is for recursive, n is for line number and w is for matching whole word.
  • STRING is the pattern one is looking for.  
  • replace \path\ by the directory you are searching in. Use '.' without quotes if it is the current directory.

Suppose, now one wants to find out if a certain string is present in certain file types only. Suppose we want to search for word php in .php and .xml files only. Then, we use a command like
grep -rnw --include=*.{php,xml} "php" .
--exclude is used to exclude certain file types or directories from the search in the similar fashion.

Warning! Failed to move file - Error Joomla Extension Manager

2

Posted by Arsh | Labels: Joomla | Posted on Tuesday, May 27, 2014

If you are getting the following error - "Warning! Failed to move file" while trying to install an extension in the Extension Manager in Joomla! 3.x. Then it might be due to tmp directory write/ownership issue.


  • First make sure that tmp is writable. You can do that by Clicking System-->System Information-->File Permissions. If tmp is not writable, change permissions by chmod-ing permissions of tmp folder recursively to 777.
  • If tmp is writable, this issue could have been caused by ownership issue. The tmp folder might have been owned by FTP user and apache cannot write to it as you are trying to do in the extension manager. A simple fix is to delete the tmp folder and try to install the extension in the Extension Manager. If Apache can write to your home folder, it will create a tmp folder that Apache will own and installation of an extension will go through without a problem.
Hope this helps!