Easy methods to seek for textual content inside a file utilizing the nano textual content editor
Jack Wallen exhibits you methods to use the search characteristic to extra effectively find the configuration choice you should edit within the nano textual content editor.
Nano is my textual content editor of alternative on each the Linux and macOS platforms. What number of occasions have you ever learn my phrases saying, “open so-and-so configuration file in the nano editor, locate entry X and change it?” If that configuration file is a couple of brief strains, you’d don’t have any downside finding the entry in query. What if it is 100+ or 1,000+ strains of choices to comb by means of?
At that time, you’d spend approach an excessive amount of of your treasured time looking for the entry in query. Luckily, the nano editor features a useful characteristic to make this process exponentially simpler. Stated characteristic is, you guessed it, a search device. With this search device you possibly can rapidly find these entries, irrespective of how huge the configuration file is.
How do you utilize the search characteristic? Let me present you.
SEE: Kubernetes safety information (free PDF) (TechRepublic)
Let’s reveal with the Samba configuration file. Open that file with the command:
sudo nano /and many others/samba/smb.conf
As an instance you’ve got configured a share named Public and also you need to edit it, however do not need to should scan by means of the file to seek out it. As an alternative, use the important thing mixture Ctrl+w, which is able to open the Search area. Kind Public and hit Enter. The nano cursor will land on the primary entry that matches Public.
If that is not the one you are on the lookout for, hit the Ctrl+w mixture once more and you may see the search area remains to be populated with Public. Hit Enter once more and the cursor will transfer to the following occasion.
Nevertheless, if you are on the lookout for Public encased in brackets, kind that as a substitute and the Search area will take you on to the particular entry, the place you can begin modifying.
And that is all there’s to utilizing the built-in search characteristic of the nano editor. Belief me after I say this can prevent a lot time–especially when attempting to comply with tutorials and you should alter a configuration file, a container manifest, or piece of code that is 1000’s of strains lengthy. Take pleasure in your newfound effectivity.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the newest tech recommendation for enterprise execs from Jack Wallen.