Posted On April 1, 2019

File Searching in Linux

kimconnect 0 comments
blog.KimConnect.com >> Linux >> File Searching in Linux
Step 1
Index your file system with updatedb. This makes a list of files so that later searches won’t have to look in the entire span of directories each time. The process can later be added to a cronjob and happen automatically. Run the Command:
updatedb
 
Step 2
Once the directory has been updated, the way to find the location of a desired file is with locate. An alternative is the find command, which can take a longer time to finish searching the entire system.
locate “name of file”
Filter Results
Narrowing down results with grep can prevent the screen from being filled up with results, as in this case many files contained the term “nx”
Example:
To find where nxclient’s dsa key is hiding.
locate nx | grep key | grep dsa
Output:
/etc/nxserver/client.id_dsa.key
/etc/nxserver/server.id_dsa.pub.key

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

How to Disable SELINUX on CentOS 8

SELinux is a sort of system-call firewall, where processes are in their run spaces. When…

How to Fix a Broken Ubuntu Upgrade

Sometimes, a power failure or manual interruption during a Linux OS upgrade can render the…

How to expand volume of a linux virtual machine residing in a ESXi host

1. Power off VM2. Expand volume size3. Power on VM4. Confirm new volume size# fdisk…