Exclude directory from FIND command

Commands to exclude single directory:

find / -path “/Folder1” -prune -o -type f -name “file.txt”

Commands to exclude multiple directory:
find / -path “/Folder1” -prune -o -path “/Folder2” -prune -o -type f -name “file.txt”

LOCATE command in linux

The locate command is often the simplest and quickest way to find the locations of files and directories on Linux and other Unix-like operating systems.

The basic syntax for locate is:
locate [options] name(s)

When used without any options, locate displays every absolute pathname for which the user has access permission that contains any of the names of files and/or directories that are provided to it as arguments (i.e., input data).

To install the locate command run one of these command:

Debain                       >> apt-get install locate
RedHat/CentOS     >> yum install mlocate

When we say that locate searches very quickly, then the first question that comes into mind is that what makes locate so fast?. Well, locate does not search the files on disk rather it searches for file paths in a database. The database is a file that contains information about the files and their path on your system. The locate database file is located at:
/var/lib/mlocate/mlocate.db

The next logical question is, what keeps this mlocate database updated?

Well, there is another utility known as updatedb. When you execute updatedb, it scans the whole system and updates the mlocate.db database file.

 

 

 

Increase the screen timeout in Windows OS

Add this setting to the registry to increase the screen timeout in Windows operating system. Open your registry and find or create the key below:

HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop\

Create a new ‘REG_SZ’ value, or modify the existing value, called “ScreenSaveTimeOut” and set it according to the value data below. Exit your registry; you may need to restart or log out of Windows for the change to take effect.

Note: This functionality requires Windows NT Service Pack 4 or higher or Windows 2000.

Registry Settings
User Key: [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop]
Value Name: ScreenSaveTimeOut
Data Type: REG_SZ
Value Data: 984567843219987654321 (This is in seconds. 60 seconds = 1 minute). Don’t set it to below 60 seconds. 

If you want to disable ‘ScreenSaveTimeOut’ option, you need to delete this keyword.

Disclaimer: Modifying the registry can cause serious problems that may require you to reinstall your operating system. We cannot guarantee that problems resulting from modifications to the registry can be solved. Use the information provided at your own risk.