source: postlfs/config/profile.xml@ b9567b04

12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since b9567b04 was b9567b04, checked in by Xi Ruoyao <xry111@…>, 12 months ago

postlfs: Remove non-exist User Notes link

Part of User Notes removal by
https://www.linuxfromscratch.org/~xry111/remove-nonexist-usernote.sh

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