If we can tell from mail headers in outgoing e-mails that the server is using the wrong name, and we can not find where this setting is located, we could simply perform a file system search for the text string that is given in the mail headers. Some services may supplement their own settings with system settings this is the case for Postfix, where we both need to define the server name in /etc/mailname and /etc/main.cf For example, when configuring various services on a Linux system, it is quite easy to loose track of where specific settings can be changed - especially since different distributions may store it in different places however, if we know the value or the name of the setting, we may simply search the file system to find which files contain the text piece we are looking for. Syntax of is shown as below- grep -r 'word' For example, for searching Linux word in Downloads directory. ![]() Sometimes it may be useful to know where exactly a given string of text is located. Using the grep command, we can recursively search all files for a string on a Linux. ![]() n will include the line number in the output. ![]() r makes the search recursive, meaning that sub-directories will also be searched. This will search for the string, in the /etc/ directory.
0 Comments
Leave a Reply. |