PATH=$PATH:/new/path/diror by adding thant inside .bash_profile or .bashrc .
whichcommand to search your path and find out which command will be executed (if any) when you type a command.
whichcommand shows you the first occurrence of a command in your path. If you want to know if there are multiple occurrences, then add the
whichcommand will not find, such as shell builtins.
typecommand is a builtin that understand bash keywords and can tell us how a given command string will be evaluated for execution.
whereiscommand can also search for man pages and source codes of programs alongside their binary location .
findcommand is the Swiss Army knife of file-searching tools on Linux systems. Two other capabilities that you may find useful are its ability to find files based on user or group name and its ability to find files based on permissions.
find / -perm 644
find / -perm -644.
find -mindepth num -maxdepth num -name file:
find . ! -user user1
findcommand searches all the directories you specify, every time you run it. To speed things up, you can use another command,
locate, which uses a database of stored path information rather than searching the filesystem every time.
locatecommand searches for matching files in a database that is usually updated daily (by cron job).
locatecommand matches against any part of a path name, not just the file name.
/varfilesystem, in a location such as
/var/lib/locatedb. This may be different on systems that use slocate or mlocate packages to provide additional security or speed. You can find statistics on your locate database using locate-S :
(This is usually run daily as a cron job).
/etc/updatedb.conf, or sometimes
/etc/sysconfig/locate, is the configuration file for
/var/spool. You can let locate to search for them too if you like by manipulating this file.