source: postlfs/config/profile.xml@ 5c3f3856

10.0 10.1 11.0 11.1 11.2 8.4 9.0 9.1 bdubbs/svn elogind lazarus plabs/python-mods qt5new trunk upgradedb xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since 5c3f3856 was 5c3f3856, checked in by DJ Lucas <dj@…>, 4 years ago

Update to make-ca-1.0. Fixes #11401.
Use configuration from bash-completions package if it is installed. Added bash-completion-2.8 to ghe BLFS wiki and linked from profile page. Fixes #11399.

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

  • Property mode set to 100644
File size: 21.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>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 <para>This script imports bash completion scripts, installed by many
197 other BLFS packages, to allow TAB command line completion.</para>
198
199<screen role="root"><userinput>cat &gt; /etc/profile.d/bash_completion.sh &lt;&lt; "EOF"
200<literal># Begin /etc/profile.d/bash_completion.sh
201# Import bash completion scripts
202
203# If the bash-completion package is installed, use its configuration instead
204if [ -f /usr/share/bash-completion/bash_completion ]; then
205
206 # Check for interactive bash and that we haven't already been sourced.
207 if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then
208
209 # Check for recent enough version of bash.
210 if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
211 [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
212 [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] &amp;&amp; \
213 . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
214 if shopt -q progcomp &amp;&amp; [ -r /usr/share/bash-completion/bash_completion ]; then
215 # Source completion code.
216 . /usr/share/bash-completion/bash_completion
217 fi
218 fi
219 fi
220
221else
222
223 # bash-completions are not installed, use only bash completion directory
224 if shopt -q progcomp; then
225 for script in /etc/bash_completion.d/* ; do
226 if [ -r $script ] ; then
227 . $script
228 fi
229 done
230 fi
231fi
232
233# End /etc/profile.d/bash_completion.sh</literal>
234EOF</userinput></screen>
235 <para>Make sure that the directory exists:</para>
236
237<screen role="root"><userinput>install --directory --mode=0755 --owner=root --group=root /etc/bash_completion.d</userinput></screen>
238
239 <para>For a more complete installation, see
240 <ulink url="&blfs-wiki;/bash-shell-startup-files#bash-completions"/>.</para>
241
242 </sect3>
243
244 <sect3 id="etc-profile.d-dircolors.sh">
245 <title>/etc/profile.d/dircolors.sh</title>
246
247 <indexterm zone="postlfs-config-profile etc-profile.d-dircolors.sh">
248 <primary sortas="e-etc-profile.d-dircolors.sh">/etc/profile.d/dircolors.sh</primary>
249 </indexterm>
250
251 <para>This script uses the <filename>~/.dircolors</filename> and
252 <filename>/etc/dircolors</filename> files to control the colors of file names in a
253 directory listing. They control colorized output of things like <command>ls
254 --color</command>. The explanation of how to initialize these files is at the
255 end of this section.</para>
256
257<screen role="root"><userinput>cat &gt; /etc/profile.d/dircolors.sh &lt;&lt; "EOF"
258<literal># Setup for /bin/ls and /bin/grep to support color, the alias is in /etc/bashrc.
259if [ -f "/etc/dircolors" ] ; then
260 eval $(dircolors -b /etc/dircolors)
261fi
262
263if [ -f "$HOME/.dircolors" ] ; then
264 eval $(dircolors -b $HOME/.dircolors)
265fi
266
267alias ls='ls --color=auto'
268alias grep='grep --color=auto'</literal>
269EOF</userinput></screen>
270
271 </sect3>
272
273 <sect3 id="extrapaths.sh">
274 <title>/etc/profile.d/extrapaths.sh</title>
275
276 <indexterm zone="postlfs-config-profile extrapaths.sh">
277 <primary sortas="e-etc-profile.d-extrapaths.sh">/etc/profile.d/extrapaths.sh</primary>
278 </indexterm>
279
280 <para>This script adds some useful paths to the <envar>PATH</envar> and
281 can be used to customize other PATH related environment variables
282 (e.g. LD_LIBRARY_PATH, etc) that may be needed for all users.</para>
283
284<screen role="root"><userinput>cat &gt; /etc/profile.d/extrapaths.sh &lt;&lt; "EOF"
285<literal>if [ -d /usr/local/lib/pkgconfig ] ; then
286 pathappend /usr/local/lib/pkgconfig PKG_CONFIG_PATH
287fi
288if [ -d /usr/local/bin ]; then
289 pathprepend /usr/local/bin
290fi
291if [ -d /usr/local/sbin -a $EUID -eq 0 ]; then
292 pathprepend /usr/local/sbin
293fi
294
295# Set some defaults before other applications add to these paths.
296pathappend /usr/share/man MANPATH
297pathappend /usr/share/info INFOPATH</literal>
298EOF</userinput></screen>
299
300 </sect3>
301
302 <sect3 id="readline.sh">
303 <title>/etc/profile.d/readline.sh</title>
304
305 <indexterm zone="postlfs-config-profile readline.sh">
306 <primary sortas="e-etc-profile.d-readline.sh">/etc/profile.d/readline.sh</primary>
307 </indexterm>
308
309 <para>This script sets up the default <filename>inputrc</filename>
310 configuration file. If the user does not have individual settings, it uses the
311 global file.</para>
312
313<screen role="root"><userinput>cat &gt; /etc/profile.d/readline.sh &lt;&lt; "EOF"
314<literal># Setup the INPUTRC environment variable.
315if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
316 INPUTRC=/etc/inputrc
317fi
318export INPUTRC</literal>
319EOF</userinput></screen>
320
321 </sect3>
322
323 <sect3 id="umask.sh">
324 <title>/etc/profile.d/umask.sh</title>
325
326 <indexterm zone="postlfs-config-profile umask.sh">
327 <primary sortas="e-etc-profile.d-umask.sh">/etc/profile.d/umask.sh</primary>
328 </indexterm>
329
330 <para>Setting the <command>umask</command> value is important for security.
331 Here the default group write permissions are turned off for system users and when
332 the user name and group name are not the same.</para>
333
334<screen role="root"><userinput>cat &gt; /etc/profile.d/umask.sh &lt;&lt; "EOF"
335<literal># By default, the umask should be set.
336if [ "$(id -gn)" = "$(id -un)" -a $EUID -gt 99 ] ; then
337 umask 002
338else
339 umask 022
340fi</literal>
341EOF</userinput></screen>
342
343 </sect3>
344
345<!-- This is handled in the Xorg section of the book
346 <sect3 id="X.sh">
347 <title>/etc/profile.d/X.sh</title>
348
349 <indexterm zone="postlfs-config-profile X.sh">
350 <primary sortas="e-etc-profile.d-X.sh">/etc/profile.d/X.sh</primary>
351 </indexterm>
352
353 <para>If <application>X</application> is installed, the <envar>PATH</envar>
354 and <envar>PKG_CONFIG_PATH</envar> variables are also updated.</para>
355
356<screen role="root"><userinput>cat &gt; /etc/profile.d/X.sh &lt;&lt; "EOF"
357<literal>if [ -x /usr/X11R6/bin/X ]; then
358 pathappend /usr/X11R6/bin
359fi
360if [ -d /usr/X11R6/lib/pkgconfig ] ; then
361 pathappend /usr/X11R6/lib/pkgconfig PKG_CONFIG_PATH
362fi</literal>
363EOF</userinput></screen>
364
365 </sect3>
366-->
367 <sect3 id="i18n.sh">
368 <!-- This is handled system wide on systemd but LANG is not exported to
369 the environment, hence it's return...need to add additional text for
370 systemd only -->
371 <title>/etc/profile.d/i18n.sh</title>
372
373 <indexterm zone="postlfs-config-profile i18n.sh">
374 <primary sortas="e-etc-profile.d-i18n.sh">/etc/profile.d/i18n.sh</primary>
375 </indexterm>
376
377 <para>This script sets an environment variable necessary for
378 native language support. A full discussion on determining this
379 variable can be found on the <ulink
380 url="&lfs-root;/chapter07/profile.html">LFS Bash Shell
381 Startup Files</ulink> page.</para>
382
383<screen role="root" revision="sysv"><userinput>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
384<literal># Set up i18n variables
385export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable></literal>
386EOF</userinput></screen>
387
388<screen role="root" revision="systemd"><userinput>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
389<literal># Set up i18n variables
390. /etc/locale.conf
391export LANG</literal>
392EOF</userinput></screen>
393
394 </sect3>
395
396 <sect3>
397 <title>Other Initialization Values</title>
398
399 <para>Other initialization can easily be added to the
400 <filename>profile</filename> by adding additional scripts to the
401 <filename class='directory'>/etc/profile.d</filename> directory.</para>
402
403 </sect3>
404
405 </sect2>
406
407 <sect2 id="etc-bashrc-profile">
408 <title>/etc/bashrc</title>
409
410 <indexterm zone="postlfs-config-profile etc-bashrc-profile">
411 <primary sortas="e-etc-bashrc">/etc/bashrc</primary>
412 </indexterm>
413
414 <para>Here is a base <filename>/etc/bashrc</filename>. Comments in the
415 file should explain everything you need.</para>
416
417<screen role="root"><userinput>cat &gt; /etc/bashrc &lt;&lt; "EOF"
418<literal># Begin /etc/bashrc
419# Written for Beyond Linux From Scratch
420# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
421# updated by Bruce Dubbs &lt;bdubbs@&lfs-domainname;&gt;
422
423# System wide aliases and functions.
424
425# System wide environment variables and startup programs should go into
426# /etc/profile. Personal environment variables and startup programs
427# should go into ~/.bash_profile. Personal aliases and functions should
428# go into ~/.bashrc
429
430# Provides colored /bin/ls and /bin/grep commands. Used in conjunction
431# with code in /etc/profile.
432
433alias ls='ls --color=auto'
434alias grep='grep --color=auto'
435
436# Provides prompt for non-login shells, specifically shells started
437# in the X environment. [Review the LFS archive thread titled
438# PS1 Environment Variable for a great case study behind this script
439# addendum.]
440
441NORMAL="\[\e[0m\]"
442RED="\[\e[1;31m\]"
443GREEN="\[\e[1;32m\]"
444if [[ $EUID == 0 ]] ; then
445 PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
446else
447 PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
448fi
449
450unset RED GREEN NORMAL
451
452# End /etc/bashrc</literal>
453EOF</userinput></screen>
454
455 </sect2>
456
457 <sect2 id="bash_profile-profile">
458 <title>~/.bash_profile</title>
459
460 <indexterm zone="postlfs-config-profile bash_profile-profile">
461 <primary sortas="e-AA.bash_profile">~/.bash_profile</primary>
462 </indexterm>
463
464 <para>Here is a base <filename>~/.bash_profile</filename>. If you want each
465 new user to have this file automatically, just change the output of
466 the command to <filename>/etc/skel/.bash_profile</filename> and check the
467 permissions after the command is run. You can then copy
468 <filename>/etc/skel/.bash_profile</filename> to the home directories of already
469 existing users, including <systemitem class="username">root</systemitem>,
470 and set the owner and group appropriately.</para>
471
472<screen><userinput>cat &gt; ~/.bash_profile &lt;&lt; "EOF"
473<literal># Begin ~/.bash_profile
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# Personal environment variables and startup programs.
479
480# Personal aliases and functions should go in ~/.bashrc. System wide
481# environment variables and startup programs are in /etc/profile.
482# System wide aliases and functions are in /etc/bashrc.
483
484if [ -f "$HOME/.bashrc" ] ; then
485 source $HOME/.bashrc
486fi
487
488if [ -d "$HOME/bin" ] ; then
489 pathprepend $HOME/bin
490fi
491
492# Having . in the PATH is dangerous
493#if [ $EUID -gt 99 ]; then
494# pathappend .
495#fi
496
497# End ~/.bash_profile</literal>
498EOF</userinput></screen>
499
500 </sect2>
501
502 <sect2 id="dot_profile-profile">
503 <title>~/.profile</title>
504
505 <indexterm zone="postlfs-config-profile dot_profile-profile">
506 <primary sortas="e-AA.dot_profile">~/.profile</primary>
507 </indexterm>
508
509 <para>Here is a base <filename>~/.profile</filename>. The comments and
510 instructions for using <filename class="directory">/etc/skel</filename> for
511 <filename>.bash_profile</filename> above also apply here. Only the target
512 file names are different.</para>
513
514<screen><userinput>cat &gt; ~/.profile &lt;&lt; "EOF"
515<literal># Begin ~/.profile
516# Personal environment variables and startup programs.
517
518if [ -d "$HOME/bin" ] ; then
519 pathprepend $HOME/bin
520fi
521
522# Set up user specific i18n variables
523#export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable>
524
525# End ~/.profile</literal>
526EOF</userinput></screen>
527
528 </sect2>
529
530 <sect2 id="bashrc-profile">
531 <title>~/.bashrc</title>
532
533 <indexterm zone="postlfs-config-profile bashrc-profile">
534 <primary sortas="e-AA.bashrc">~/.bashrc</primary>
535 </indexterm>
536
537 <para>Here is a base <filename>~/.bashrc</filename>.</para>
538
539<screen><userinput>cat &gt; ~/.bashrc &lt;&lt; "EOF"
540<literal># Begin ~/.bashrc
541# Written for Beyond Linux From Scratch
542# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
543
544# Personal aliases and functions.
545
546# Personal environment variables and startup programs should go in
547# ~/.bash_profile. System wide environment variables and startup
548# programs are in /etc/profile. System wide aliases and functions are
549# in /etc/bashrc.
550
551if [ -f "/etc/bashrc" ] ; then
552 source /etc/bashrc
553fi
554
555# Set up user specific i18n variables
556#export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable>
557
558# End ~/.bashrc</literal>
559EOF</userinput></screen>
560
561 </sect2>
562
563
564 <sect2 id="bash_logout-profile">
565 <title>~/.bash_logout</title>
566
567 <indexterm zone="postlfs-config-profile bash_logout-profile">
568 <primary sortas="e-AA.bash_logout">~/.bash_logout</primary>
569 </indexterm>
570
571 <para>This is an empty <filename>~/.bash_logout</filename> that can be used as
572 a template. You will notice that the base <filename>~/.bash_logout</filename>
573 does not include a <userinput>clear</userinput> command. This is because the
574 clear is handled in the <filename>/etc/issue</filename> file.</para>
575
576<screen><userinput>cat &gt; ~/.bash_logout &lt;&lt; "EOF"
577<literal># Begin ~/.bash_logout
578# Written for Beyond Linux From Scratch
579# by James Robertson &lt;jameswrobertson@earthlink.net&gt;
580
581# Personal items to perform on logout.
582
583# End ~/.bash_logout</literal>
584EOF</userinput></screen>
585
586 </sect2>
587
588
589 <sect2 id="etc-dircolors-profile">
590 <title>/etc/dircolors</title>
591
592 <indexterm zone="postlfs-config-profile etc-dircolors-profile">
593 <primary sortas="e-etc-dircolors">/etc/dircolors</primary>
594 </indexterm>
595
596 <indexterm zone="postlfs-config-profile etc-dircolors-profile">
597 <primary sortas="e-AA.dircolors">~/.dircolors</primary>
598 </indexterm>
599
600 <para> If you want to use the <filename>dircolors</filename> capability,
601 then run the following command. The
602 <filename class="directory">/etc/skel</filename> setup steps shown above
603 also can be used here to provide a <filename>~/.dircolors</filename> file
604 when a new user is set up. As before, just change the output file name on
605 the following command and assure the permissions, owner, and group are
606 correct on the files created and/or copied.</para>
607
608<screen role="root"><userinput>dircolors -p > /etc/dircolors</userinput></screen>
609
610 <para>If you wish to customize the colors used for different file types,
611 you can edit the <filename>/etc/dircolors</filename> file. The instructions
612 for setting the colors are embedded in the file.</para>
613
614
615 <para>Finally, Ian Macdonald has written an excellent collection of tips and
616 tricks to enhance your shell environment. You can read it online at
617 <ulink url="http://www.caliban.org/bash/index.shtml"/>.</para>
618
619 </sect2>
620
621</sect1>
Note: See TracBrowser for help on using the repository browser.