Q. How do I print current path settings under BASH shell? Iâ€™m using Debian Linux.
A. In UNIX / Linux file systems, the human-readable address of a resource is defined by PATH. On Unix / Linux like operating systems, (as well as on DOS / Windows and its descendants), PATH is an environment variable listing a set of paths to directories where executables may be found.
Display current PATH
Use echo command:
$ echo $PATH
Modify current PATH
Use export command to add /opt/games to PATH, enter:
To format your PATH variable for easy viewing, add following code to your bash startup file (such as ~/.bashrc or ~/.bash_profile) :
printf "%s\n" $PATH
(Function credit: usenet archive)
Now just run path:
Q. I find vi hard to use. How do I change my default text editor from vim / vi to Pico under Debian Linux?
A. To use and change an editor to edit your text message, set the variable EDITOR to the pathname of the vi / vim binary file. You need to use export or set command for the same purpose.
Many Linux / UNIX command read shell EDITOR environment variable to determine which editor to use for editing a text file.
Set default text editor to pico
Type the command as follows:
$ which pico
Now setup a new text editor:
Add above line to ~/.bashrc file:
$ vi ~/.bashrc
Append text as follows:
Close and save the file. There is no no need to reboot system.
Also you can add alias if you want:
ow do I install BASH shell package under OpenBSD operating system? How do I set bash as a default login shell under OpenBSD?
We are developing Linux based application and we would like to set the time zone on a per user basis for individual user. How do I configure Fedora Linux or any Unix like oses to set the time zone on a per user basis using bash shell?
ow do I change the color of my shell prompt under Linux or Unix operating systems?