I am trying to find my old IP address in config files in order to replace it by my new IP address. I found one answer that proposes the command
sudo grep -HrnF '1.2.3.4' /
to find those IP addresses.
However, using this command directly, grep seems to hang. Before it hangs, it outputs some warnings that it cannot access some files inside /proc. Therefore I changed the command to
sudo grep -HrnFI --devices=skip '1.2.3.4' / > oldips.txt
But this time it wrote a 29 GB text file until I pressed Ctrl+C. After that I excluded the /proc directory like this:
sudo grep -HrnFI --devices=skip --exclude-dir=/proc '1.2.3.4' / > oldips.txt
Is this a good way to find an IP address (or text in general) on the whole disk? If not, how would I need to change the command?
/etc
first (instead of/
).top
) by grep, which I think it didn't using the first command, but it does using the last command.sudo grep -HrnFI --devices=skip '1.2.3.4' /etc > oldips.txt