With a combination of the two commands find and grep you can search for file content in a folder hierarchy:
find . | xargs grep 'string' -sl
With a combination of the two commands find and grep you can search for file content in a folder hierarchy:
find . | xargs grep 'string' -sl
If you are in command mode in vim editor, write / and enter your search phrase. After that, you can press ENTER and your cursor jumps to the first search result (if there is one
. To jump to the next result, press n.
If you’ve ever wondered, why your marker in your template doesn’t get filled up, this could be the reason:
<tr> <td id="TEASER-HEADER" width="360px"></td> <td></td> </tr>
There is no content defined in your marker! You’ve got to correct your code like this:
<tr> <td id="TEASER-HEADER" width="360px"> </td> <td></td> </tr>
I inserted a non-breaking space but it doesn’t matter what type of content you insert in your marker. It’s just important that there IS some content inside.
With vim you can edit files on console level. By default, there is no syntax highlighting and this can be a real pain if you are editing large and complex files. How do we change that?
In command line mode, write
syntax on
and press ENTER. This way syntax highlighting gets temporarly activated. If you close your file and open it again or open another file, syntax highlighting is disabled again.
Let’s change that permanently:
Open the file /etc/vim/vimrc and add the line
syntax on
From now on, syntax highlighting is enabled every time you open vim.
With the following simple code line you can import a *.sql file into an existing mysql database:
mysql -u DBUSER -p -h HOST DATABASE < FILETOIMPORT.sql
Parameters
-u user on the database (does this user have access and enough permissions to import the file?)
-p if set, mysql asks for the user password
-h the host where the database is stored, this will mostly be localhost