Type find / -name “fun” –type f print and press ↵ Enter. This shows the full path to the file called fun no matter which directory you’re in. If fun in a directory called /games/awesome, you’d see /games/awesome/fun in the results of the command.
Type find / -name “fun” –type f print and press ↵ Enter. This shows the full path to the file called fun no matter which directory you’re in. If fun in a directory called /games/awesome, you’d see /games/awesome/fun in the results of the command.
Type echo $PATH at the command prompt and press ↵ Enter. The results should look something like this: usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin This output is a list of directories where executable files are stored. If you try to run a file or command that isn’t in one of the directories in your path, you’ll receive an error that says the command is not found.
Type export PATH=$PATH:/games/awesome and press ↵ Enter. Now you can run fun just by typing its name at the command line (instead of /games/awesome/fun) and pressing ↵ Enter. This change only affects the current shell. If you open a new terminal window or sign in elsewhere, you’ll have to re-add the path. To make the change permanent, add the command to your shell’s config file (e. g. , . bashrc, . cshrc).
Type export PATH=$PATH:/games/awesome and press ↵ Enter. Now you can run fun just by typing its name at the command line (instead of /games/awesome/fun) and pressing ↵ Enter. This change only affects the current shell. If you open a new terminal window or sign in elsewhere, you’ll have to re-add the path. To make the change permanent, add the command to your shell’s config file (e. g. , . bashrc, . cshrc).