We often use grep operations like Linux in database operations. The following solutions are available:
1. Run the MySQL operation in Linux and perform grep on it. However, this method cannot be used in MySQL.
$ Mysql-u me-P "use sometable; Describe tables;" | grep "user"
2. Use pager for filtering. pager is powerful and truly implements the grep function;
Mysql> pager grep userpager set to 'grep user' mysql> Use sometable; mysql> describe tables;
3. Simple Method, pager modification is a little more troublesome, but the following method is relatively simple to use, but it seems only applicable to commands starting with show, DESC and other commands cannot be used
Mysql> show tables like '% users % ';
In general, there are several such cases. Of course, some people directly use shell scripts. Hey hey, let's study it by yourself. We recommend you study pager, which is very useful.
OriginalArticlePlease specify the source for loading:Http://blog.csdn.net/handsomerocco/