Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

$PATH. One way to use this change right away is to read in the new settings
in .bash_profile by using the bash shell’s source command, as
follows:


Click here to view code image
matthew@seymour:~$ source .bash_profile


You can now run commands located in the /sbin directory without the need
to explicitly type the full pathname.


Some Linux commands also use environment variables to acquire
configuration information (such as a communications program looking for a
variable such as BAUD_RATE, which might denote a default modem speed).


To experiment with the environment variables, you can modify the PS1
variable to manipulate the appearance of your shell prompt. If you are
working with bash, you can use its built-in export command to change the
shell prompt. For example, say that your default shell prompt looks like this:


Click here to view code image
matthew@seymour:~$


You can change its appearance by using the PS1 variable, like this:


Click here to view code image
matthew@seymour:~$ export PS1='$OSTYPE r00lz ->'


After you press Enter, you see the following:


Click here to view code image
linux-gnu r00lz ->


NOTE
See the bash man page for other variables you can use for prompt settings.

Using Common Text Editors


Linux distributions include a number of applications known as text editors
that you can use to create text files or edit system configuration files. Text
editors are similar to word processing programs but generally have fewer
features, work only with text files, and might or might not support spell
checking or formatting. Text editors range in features and ease of use and are
found on nearly every Linux distribution. The number of editors installed on a
system depends on what software packages you’ve installed on the system.


The most popular console-based text editors include the following:

Free download pdf