source: postlfs/config/profile.xml@ 03b278dc

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.4 9.0 9.1 bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 03b278dc was 03b278dc, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Update to sysstat-12.0.2.
Update to autofs-5.1.5.
Update to node.js-10.14.1.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@20771 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 22.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="postlfs-config-profile" xreflabel="The Bash Shell Startup Files">
9 <?dbhtml filename="profile.html"?>
10
11 <sect1info>
12 <othername>$LastChangedBy$</othername>
13 <date>$Date$</date>
14 </sect1info>
15
16 <title>The Bash Shell Startup Files</title>
17
18 <para>The shell program <filename>/bin/bash</filename> (hereafter
19 referred to as just "the shell") uses a collection of startup files to
20 help create an environment. Each file has a specific use and
21 may affect login and interactive environments differently. The files in
22 the <filename class="directory">/etc</filename> directory generally provide
23 global settings. If an equivalent file exists in your home directory it may
24 override the global settings.</para>
25
26 <para>An interactive login shell is started after a successful login, using
27 <filename>/bin/login</filename>, by reading the
28 <filename>/etc/passwd</filename> file. This shell invocation normally reads
29 <filename>/etc/profile</filename> and its private equivalent
30 <filename>~/.bash_profile</filename> (or <filename>~/.profile</filename> if
31 called as <command>/bin/sh</command>) upon startup.</para>
32
33 <para>An interactive non-login shell is normally started at the command-line
34 using a shell program (e.g.,
35 <prompt>[prompt]$</prompt><command>/bin/bash</command>) or by the
36 <command>/bin/su</command> command. An interactive non-login shell is also
37 started with a terminal program such as <command>xterm</command> or
38 <command>konsole</command> from within a graphical environment. This type of
39 shell invocation normally copies the parent environment and then reads the
40 user's <filename>~/.bashrc</filename> file for additional startup
41 configuration instructions.</para>
42
43 <para>A non-interactive shell is usually present when a shell script is
44 running. It is non-interactive because it is processing a script and not
45 waiting for user input between commands. For these shell invocations, only
46 the environment inherited from the parent shell is used.</para>
47
48 <para> The file <filename>~/.bash_logout</filename> is not used for an
49 invocation of the shell. It is read and executed when a user exits from an
50 interactive login shell.</para>
51
52 <para>Many distributions use <filename>/etc/bashrc</filename> for system wide
53 initialization of non-login shells. This file is usually called from the
54 user's <filename>~/.bashrc</filename> file and is not built directly into
55 <command>bash</command> itself. This convention is followed in this
56 section.</para>
57
58 <para>For more information see <command>info bash</command> --
59 <emphasis role="strong">Nodes: Bash Startup Files and Interactive
60 Shells</emphasis>.</para>
61
62 <note>
63 <para>Most of the instructions below are used to create files located in
64 the <filename class='directory'>/etc</filename> directory structure which
65 requires you to execute the commands as the
66 <systemitem class='username'>root</systemitem> user. If you elect to create
67 the files in user's home directories instead, you should run the commands
68 as an unprivileged user.</para>
69 </note>
70
71 <para condition="html" role="usernotes">User Notes:
72 <ulink url="&blfs-wiki;/bash-shell-startup-files"/></para>
73
74 <sect2 id="etc-profile-profile">
75 <title>/etc/profile</title>
76
77 <indexterm zone="postlfs-config-profile etc-profile-profile">
78 <primary sortas="e-etc-profile">/etc/profile</primary>
79 </indexterm>
80
81 <para>Here is a base <filename>/etc/profile</filename>. This file starts by
82 setting up some helper functions and some basic parameters. It specifies some
83 <command>bash</command> history parameters and, for security purposes,
84 disables keeping a permanent history file for the <systemitem
85 class="username">root</systemitem> user. It also sets a
86 default user prompt. It then calls small, single purpose scripts in the
87 <filename class='directory'>/etc/profile.d</filename> directory to provide most
88 of the initialization.</para>
89
90 <para>For more information on the escape sequences you can use for your prompt
91 (i.e., the <envar>PS1</envar> environment variable) see <command>info
92 bash</command> -- <emphasis role="strong">Node: Printing a
93 Prompt</emphasis>.</para>
94
95<screen role="root"><?dbfo keep-together="auto"?><userinput>cat &gt; /etc/profile &lt;&lt; "EOF"
96<literal># Begin /etc/profile
97# Written for Beyond Linux From Scratch
98# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
99# modifications by Dagmar d'Surreal &lt;rivyqntzne@pbzpnfg.arg&gt;
100
101# System wide environment variables and startup programs.
102
103# System wide aliases and functions should go in /etc/bashrc. Personal
104# environment variables and startup programs should go into
105# ~/.bash_profile. Personal aliases and functions should go into
106# ~/.bashrc.
107
108# Functions to help us manage paths. Second argument is the name of the
109# path variable to be modified (default: PATH)
110pathremove () {
111 local IFS=':'
112 local NEWPATH
113 local DIR
114 local PATHVARIABLE=${2:-PATH}
115 for DIR in ${!PATHVARIABLE} ; do
116 if [ "$DIR" != "$1" ] ; then
117 NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
118 fi
119 done
120 export $PATHVARIABLE="$NEWPATH"
121}
122
123pathprepend () {
124 pathremove $1 $2
125 local PATHVARIABLE=${2:-PATH}
126 export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
127}
128
129pathappend () {
130 pathremove $1 $2
131 local PATHVARIABLE=${2:-PATH}
132 export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
133}
134
135export -f pathremove pathprepend pathappend
136
137# Set the initial path
138export PATH=/bin:/usr/bin
139
140if [ $EUID -eq 0 ] ; then
141 pathappend /sbin:/usr/sbin
142 unset HISTFILE
143fi
144
145# Setup some environment variables.
146export HISTSIZE=1000
147export HISTIGNORE="&amp;:[bf]g:exit"
148
149# Set some defaults for graphical systems
150export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/share/}
151export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/etc/xdg/}
152export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/tmp/xdg-$USER}
153
154# Setup a red prompt for root and a green one for users.
155NORMAL="\[\e[0m\]"
156RED="\[\e[1;31m\]"
157GREEN="\[\e[1;32m\]"
158if [[ $EUID == 0 ]] ; then
159 PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
160else
161 PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
162fi
163
164for script in /etc/profile.d/*.sh ; do
165 if [ -r $script ] ; then
166 . $script
167 fi
168done
169
170unset script RED GREEN NORMAL
171
172# End /etc/profile</literal>
173EOF</userinput></screen>
174
175 <sect3 id="etc-profile.d">
176 <title>The /etc/profile.d Directory</title>
177
178 <indexterm zone="postlfs-config-profile etc-profile.d">
179 <primary sortas="e-etc-profile.d">/etc/profile.d</primary>
180 </indexterm>
181
182 <para>Now create the <filename class='directory'>/etc/profile.d</filename>
183 directory, where the individual initialization scripts are placed:</para>
184
185<screen role="root"><userinput>install --directory --mode=0755 --owner=root --group=root /etc/profile.d</userinput></screen>
186
187 </sect3>
188
189 <sect3 id="etc-profile.d-bash-completion.sh">
190 <title>/etc/profile.d/bash_completion.sh</title>
191
192 <indexterm zone="postlfs-config-profile etc-profile.d-bash-completion.sh">
193 <primary sortas="e-etc-profile.d-bash-completion.sh">/etc/profile.d/bash_completion.sh</primary>
194 </indexterm>
195
196 <note><para>Using the bash completion script below is controversial.
197 Not all users like it. It adds many (usually over 1000) lines to the
198 bash environment and makes it difficult to use the 'set' command to
199 examine simple environment variables. Omitting this script does not
200 interfere with the ability of bash to use the tab key for file name
201 completion.</para></note>
202
203 <para>This script imports bash completion scripts, installed by many
204 other BLFS packages, to allow TAB command line completion.</para>
205
206<screen role="root"><userinput>cat &gt; /etc/profile.d/bash_completion.sh &lt;&lt; "EOF"
207<literal># Begin /etc/profile.d/bash_completion.sh
208# Import bash completion scripts
209
210# If the bash-completion package is installed, use its configuration instead
211if [ -f /usr/share/bash-completion/bash_completion ]; then
212
213 # Check for interactive bash and that we haven't already been sourced.
214 if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then
215
216 # Check for recent enough version of bash.
217 if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
218 [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
219 [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] &amp;&amp; \
220 . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
221 if shopt -q progcomp &amp;&amp; [ -r /usr/share/bash-completion/bash_completion ]; then
222 # Source completion code.
223 . /usr/share/bash-completion/bash_completion
224 fi
225 fi
226 fi
227
228else
229
230 # bash-completions are not installed, use only bash completion directory
231 if shopt -q progcomp; then
232 for script in /etc/bash_completion.d/* ; do
233 if [ -r $script ] ; then
234 . $script
235 fi
236 done
237 fi
238fi
239
240# End /etc/profile.d/bash_completion.sh</literal>
241EOF</userinput></screen>
242 <para>Make sure that the directory exists:</para>
243
244<screen role="root"><userinput>install --directory --mode=0755 --owner=root --group=root /etc/bash_completion.d</userinput></screen>
245
246 <para>For a more complete installation, see
247 <ulink url="&blfs-wiki;/bash-shell-startup-files#bash-completions"/>.</para>
248
249 </sect3>
250
251 <sect3 id="etc-profile.d-dircolors.sh">
252 <title>/etc/profile.d/dircolors.sh</title>
253
254 <indexterm zone="postlfs-config-profile etc-profile.d-dircolors.sh">
255 <primary sortas="e-etc-profile.d-dircolors.sh">/etc/profile.d/dircolors.sh</primary>
256 </indexterm>
257
258 <para>This script uses the <filename>~/.dircolors</filename> and
259 <filename>/etc/dircolors</filename> files to control the colors of file names in a
260 directory listing. They control colorized output of things like <command>ls
261 --color</command>. The explanation of how to initialize these files is at the
262 end of this section.</para>
263
264<screen role="root"><userinput>cat &gt; /etc/profile.d/dircolors.sh &lt;&lt; "EOF"
265<literal># Setup for /bin/ls and /bin/grep to support color, the alias is in /etc/bashrc.
266if [ -f "/etc/dircolors" ] ; then
267 eval $(dircolors -b /etc/dircolors)
268fi
269
270if [ -f "$HOME/.dircolors" ] ; then
271 eval $(dircolors -b $HOME/.dircolors)
272fi
273
274alias ls='ls --color=auto'
275alias grep='grep --color=auto'</literal>
276EOF</userinput></screen>
277
278 </sect3>
279
280 <sect3 id="extrapaths.sh">
281 <title>/etc/profile.d/extrapaths.sh</title>
282
283 <indexterm zone="postlfs-config-profile extrapaths.sh">
284 <primary sortas="e-etc-profile.d-extrapaths.sh">/etc/profile.d/extrapaths.sh</primary>
285 </indexterm>
286
287 <para>This script adds some useful paths to the <envar>PATH</envar> and
288 can be used to customize other PATH related environment variables
289 (e.g. LD_LIBRARY_PATH, etc) that may be needed for all users.</para>
290
291<screen role="root"><userinput>cat &gt; /etc/profile.d/extrapaths.sh &lt;&lt; "EOF"
292<literal>if [ -d /usr/local/lib/pkgconfig ] ; then
293 pathappend /usr/local/lib/pkgconfig PKG_CONFIG_PATH
294fi
295if [ -d /usr/local/bin ]; then
296 pathprepend /usr/local/bin
297fi
298if [ -d /usr/local/sbin -a $EUID -eq 0 ]; then
299 pathprepend /usr/local/sbin
300fi
301
302# Set some defaults before other applications add to these paths.
303pathappend /usr/share/man MANPATH
304pathappend /usr/share/info INFOPATH</literal>
305EOF</userinput></screen>
306
307 </sect3>
308
309 <sect3 id="readline.sh">
310 <title>/etc/profile.d/readline.sh</title>
311
312 <indexterm zone="postlfs-config-profile readline.sh">
313 <primary sortas="e-etc-profile.d-readline.sh">/etc/profile.d/readline.sh</primary>
314 </indexterm>
315
316 <para>This script sets up the default <filename>inputrc</filename>
317 configuration file. If the user does not have individual settings, it uses the
318 global file.</para>
319
320<screen role="root"><userinput>cat &gt; /etc/profile.d/readline.sh &lt;&lt; "EOF"
321<literal># Setup the INPUTRC environment variable.
322if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
323 INPUTRC=/etc/inputrc
324fi
325export INPUTRC</literal>
326EOF</userinput></screen>
327
328 </sect3>
329
330 <sect3 id="umask.sh">
331 <title>/etc/profile.d/umask.sh</title>
332
333 <indexterm zone="postlfs-config-profile umask.sh">
334 <primary sortas="e-etc-profile.d-umask.sh">/etc/profile.d/umask.sh</primary>
335 </indexterm>
336
337 <para>Setting the <command>umask</command> value is important for security.
338 Here the default group write permissions are turned off for system users and when
339 the user name and group name are not the same.</para>
340
341<screen role="root"><userinput>cat &gt; /etc/profile.d/umask.sh &lt;&lt; "EOF"
342<literal># By default, the umask should be set.
343if [ "$(id -gn)" = "$(id -un)" -a $EUID -gt 99 ] ; then
344 umask 002
345else
346 umask 022
347fi</literal>
348EOF</userinput></screen>
349
350 </sect3>
351
352<!-- This is handled in the Xorg section of the book
353 <sect3 id="X.sh">
354 <title>/etc/profile.d/X.sh</title>
355
356 <indexterm zone="postlfs-config-profile X.sh">
357 <primary sortas="e-etc-profile.d-X.sh">/etc/profile.d/X.sh</primary>
358 </indexterm>
359
360 <para>If <application>X</application> is installed, the <envar>PATH</envar>
361 and <envar>PKG_CONFIG_PATH</envar> variables are also updated.</para>
362
363<screen role="root"><userinput>cat &gt; /etc/profile.d/X.sh &lt;&lt; "EOF"
364<literal>if [ -x /usr/X11R6/bin/X ]; then
365 pathappend /usr/X11R6/bin
366fi
367if [ -d /usr/X11R6/lib/pkgconfig ] ; then
368 pathappend /usr/X11R6/lib/pkgconfig PKG_CONFIG_PATH
369fi</literal>
370EOF</userinput></screen>
371
372 </sect3>
373-->
374 <sect3 id="i18n.sh">
375 <!-- This is handled system wide on systemd but LANG is not exported to
376 the environment, hence it's return...need to add additional text for
377 systemd only -->
378 <title>/etc/profile.d/i18n.sh</title>
379
380 <indexterm zone="postlfs-config-profile i18n.sh">
381 <primary sortas="e-etc-profile.d-i18n.sh">/etc/profile.d/i18n.sh</primary>
382 </indexterm>
383
384 <para>This script sets an environment variable necessary for
385 native language support. A full discussion on determining this
386 variable can be found on the <ulink
387 url="&lfs-root;/chapter07/profile.html">LFS Bash Shell
388 Startup Files</ulink> page.</para>
389
390<screen role="root" revision="sysv"><userinput>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
391<literal># Set up i18n variables
392export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable></literal>
393EOF</userinput></screen>
394
395<screen role="root" revision="systemd"><userinput>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
396<literal># Set up i18n variables
397. /etc/locale.conf
398export LANG</literal>
399EOF</userinput></screen>
400
401 </sect3>
402
403 <sect3>
404 <title>Other Initialization Values</title>
405
406 <para>Other initialization can easily be added to the
407 <filename>profile</filename> by adding additional scripts to the
408 <filename class='directory'>/etc/profile.d</filename> directory.</para>
409
410 </sect3>
411
412 </sect2>
413
414 <sect2 id="etc-bashrc-profile">
415 <title>/etc/bashrc</title>
416
417 <indexterm zone="postlfs-config-profile etc-bashrc-profile">
418 <primary sortas="e-etc-bashrc">/etc/bashrc</primary>
419 </indexterm>
420
421 <para>Here is a base <filename>/etc/bashrc</filename>. Comments in the
422 file should explain everything you need.</para>
423
424<screen role="root"><userinput>cat &gt; /etc/bashrc &lt;&lt; "EOF"
425<literal># Begin /etc/bashrc
426# Written for Beyond Linux From Scratch
427# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
428# updated by Bruce Dubbs &lt;bdubbs@&lfs-domainname;&gt;
429
430# System wide aliases and functions.
431
432# System wide environment variables and startup programs should go into
433# /etc/profile. Personal environment variables and startup programs
434# should go into ~/.bash_profile. Personal aliases and functions should
435# go into ~/.bashrc
436
437# Provides colored /bin/ls and /bin/grep commands. Used in conjunction
438# with code in /etc/profile.
439
440alias ls='ls --color=auto'
441alias grep='grep --color=auto'
442
443# Provides prompt for non-login shells, specifically shells started
444# in the X environment. [Review the LFS archive thread titled
445# PS1 Environment Variable for a great case study behind this script
446# addendum.]
447
448NORMAL="\[\e[0m\]"
449RED="\[\e[1;31m\]"
450GREEN="\[\e[1;32m\]"
451if [[ $EUID == 0 ]] ; then
452 PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
453else
454 PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
455fi
456
457unset RED GREEN NORMAL
458
459# End /etc/bashrc</literal>
460EOF</userinput></screen>
461
462 </sect2>
463
464 <sect2 id="bash_profile-profile">
465 <title>~/.bash_profile</title>
466
467 <indexterm zone="postlfs-config-profile bash_profile-profile">
468 <primary sortas="e-AA.bash_profile">~/.bash_profile</primary>
469 </indexterm>
470
471 <para>Here is a base <filename>~/.bash_profile</filename>. If you want each
472 new user to have this file automatically, just change the output of
473 the command to <filename>/etc/skel/.bash_profile</filename> and check the
474 permissions after the command is run. You can then copy
475 <filename>/etc/skel/.bash_profile</filename> to the home directories of already
476 existing users, including <systemitem class="username">root</systemitem>,
477 and set the owner and group appropriately.</para>
478
479<screen><userinput>cat &gt; ~/.bash_profile &lt;&lt; "EOF"
480<literal># Begin ~/.bash_profile
481# Written for Beyond Linux From Scratch
482# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
483# updated by Bruce Dubbs &lt;bdubbs@&lfs-domainname;&gt;
484
485# Personal environment variables and startup programs.
486
487# Personal aliases and functions should go in ~/.bashrc. System wide
488# environment variables and startup programs are in /etc/profile.
489# System wide aliases and functions are in /etc/bashrc.
490
491if [ -f "$HOME/.bashrc" ] ; then
492 source $HOME/.bashrc
493fi
494
495if [ -d "$HOME/bin" ] ; then
496 pathprepend $HOME/bin
497fi
498
499# Having . in the PATH is dangerous
500#if [ $EUID -gt 99 ]; then
501# pathappend .
502#fi
503
504# End ~/.bash_profile</literal>
505EOF</userinput></screen>
506
507 </sect2>
508
509 <sect2 id="dot_profile-profile">
510 <title>~/.profile</title>
511
512 <indexterm zone="postlfs-config-profile dot_profile-profile">
513 <primary sortas="e-AA.dot_profile">~/.profile</primary>
514 </indexterm>
515
516 <para>Here is a base <filename>~/.profile</filename>. The comments and
517 instructions for using <filename class="directory">/etc/skel</filename> for
518 <filename>.bash_profile</filename> above also apply here. Only the target
519 file names are different.</para>
520
521<screen><userinput>cat &gt; ~/.profile &lt;&lt; "EOF"
522<literal># Begin ~/.profile
523# Personal environment variables and startup programs.
524
525if [ -d "$HOME/bin" ] ; then
526 pathprepend $HOME/bin
527fi
528
529# Set up user specific i18n variables
530#export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable>
531
532# End ~/.profile</literal>
533EOF</userinput></screen>
534
535 </sect2>
536
537 <sect2 id="bashrc-profile">
538 <title>~/.bashrc</title>
539
540 <indexterm zone="postlfs-config-profile bashrc-profile">
541 <primary sortas="e-AA.bashrc">~/.bashrc</primary>
542 </indexterm>
543
544 <para>Here is a base <filename>~/.bashrc</filename>.</para>
545
546<screen><userinput>cat &gt; ~/.bashrc &lt;&lt; "EOF"
547<literal># Begin ~/.bashrc
548# Written for Beyond Linux From Scratch
549# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
550
551# Personal aliases and functions.
552
553# Personal environment variables and startup programs should go in
554# ~/.bash_profile. System wide environment variables and startup
555# programs are in /etc/profile. System wide aliases and functions are
556# in /etc/bashrc.
557
558if [ -f "/etc/bashrc" ] ; then
559 source /etc/bashrc
560fi
561
562# Set up user specific i18n variables
563#export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable>
564
565# End ~/.bashrc</literal>
566EOF</userinput></screen>
567
568 </sect2>
569
570
571 <sect2 id="bash_logout-profile">
572 <title>~/.bash_logout</title>
573
574 <indexterm zone="postlfs-config-profile bash_logout-profile">
575 <primary sortas="e-AA.bash_logout">~/.bash_logout</primary>
576 </indexterm>
577
578 <para>This is an empty <filename>~/.bash_logout</filename> that can be used as
579 a template. You will notice that the base <filename>~/.bash_logout</filename>
580 does not include a <userinput>clear</userinput> command. This is because the
581 clear is handled in the <filename>/etc/issue</filename> file.</para>
582
583<screen><userinput>cat &gt; ~/.bash_logout &lt;&lt; "EOF"
584<literal># Begin ~/.bash_logout
585# Written for Beyond Linux From Scratch
586# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
587
588# Personal items to perform on logout.
589
590# End ~/.bash_logout</literal>
591EOF</userinput></screen>
592
593 </sect2>
594
595
596 <sect2 id="etc-dircolors-profile">
597 <title>/etc/dircolors</title>
598
599 <indexterm zone="postlfs-config-profile etc-dircolors-profile">
600 <primary sortas="e-etc-dircolors">/etc/dircolors</primary>
601 </indexterm>
602
603 <indexterm zone="postlfs-config-profile etc-dircolors-profile">
604 <primary sortas="e-AA.dircolors">~/.dircolors</primary>
605 </indexterm>
606
607 <para> If you want to use the <filename>dircolors</filename> capability,
608 then run the following command. The
609 <filename class="directory">/etc/skel</filename> setup steps shown above
610 also can be used here to provide a <filename>~/.dircolors</filename> file
611 when a new user is set up. As before, just change the output file name on
612 the following command and assure the permissions, owner, and group are
613 correct on the files created and/or copied.</para>
614
615<screen role="root"><userinput>dircolors -p > /etc/dircolors</userinput></screen>
616
617 <para>If you wish to customize the colors used for different file types,
618 you can edit the <filename>/etc/dircolors</filename> file. The instructions
619 for setting the colors are embedded in the file.</para>
620
621
622 <para>Finally, Ian Macdonald has written an excellent collection of tips and
623 tricks to enhance your shell environment. You can read it online at
624 <ulink url="http://www.caliban.org/bash/index.shtml"/>.</para>
625
626 </sect2>
627
628</sect1>
Note: See TracBrowser for help on using the repository browser.