source: postlfs/config/profile.xml@ d5cc78a

11.0 11.1 11.2 11.3 12.0 12.1 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 d5cc78a was f0dc9578, checked in by Pierre Labastie <pieere@…>, 4 years ago

Fix references to the lfs book (chapter numbering changes)
Not sure I have all ot them...*

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

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