Posts

Showing posts from 2012

Search for a string in multiple files

grep is a common command used on unix for searching. This is a very useful tool and provides powerful options. One such option is to search for a string in multiple files in the current directory and sub directories. The command is : grep -rl "search string" /usr -r stands for search recursively in current directory and sub directory. -l suppress the display of additional information and just outputs the file names. /usr refers to root folder under which the search happens.

How to Increase the timeout in phpMyAdmin

At times when you are busy running some query or importing/exporting some data it is very annoying to see the script timeout with default 300sec processing time. Well there is a simple solution to fix that. Modify or add the following variable in the config.inc.php file located under C:\xampp\phpMyAdmin folder for a xamp installation on Windows. $cfg['ExecTimeLimit'] = 0; /* 0 stands for unlimited time of execution*/ You can also just extend the time to what ever you want if unlimited is not your way of doing things. Here is another example: $cfg['ExecTimeLimit'] = 600; /* 600 seconds */ The file config.inc.php may be found under different paths based on your OS and installations. On my GNU/Linux server the path is /etc/phpMyAdmin/config.inc.php

How to find the Size of a folder in Unix

Its very easy to find the size of a folder in windows, where as it might be difficult to a novice user doing the same on Unix based systems. Its because the Unix file system does not show a folder size in a file listing using a short listing ls or long listing ls -l The size of 4.0k or so shown before the folder name in a long listing is not an actual size of the folder. However we are blessed with many simple commands that makes our jobs simple. One such command is du . This command stands for disk usage, represented in short as du. It recursively access all the files and sub folder under a given folder and display the size of each of this items. To display the total size of the folder in MB, GB etc., use the command du -sh Option s says du to summarize the results and do not display the details of sub folder and files Option h says display the size in human readable format i.e., K for kilobytes, M for megabytes & G for gigabytes

Delete multiple lines in Linux style Vi Editor

We often have situations were we need to modify a file using vi on Unix style file system and delete multiple lines. Here are some details and examples on how to do it. Syntax: xdd dd is the command to delete a complete row. x in the number of lines to be deleted. Examples: delete 2 lines 2dd delete 10 lines 10dd