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.
use -nouser or -nogroup to search for a file with no user or with no group id.
find / -perm 644
find / -perm -644.
find -mindepth num -maxdepth num -name file:
Like other tests, you can add a ! just before any phrase to negate it. So this will find files not belonging to user1 :
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).
use -v for verbose mode to see what is going on after updatedb command!
/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.