os: fedora38 -- config

发布时间 2023-11-21 01:48:40作者: lnlidawei

os:  fedora38  -- config

 

 

 

一、~/.basrc

 1 [wit@fedora ~]$ cat  ~/.bashrc
 2 # .bashrc
 3 
 4 # Source global definitions
 5 if [ -f /etc/bashrc ]; then
 6         . /etc/bashrc
 7 fi
 8 
 9 # User specific environment
10 if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
11 then
12     PATH="$HOME/.local/bin:$HOME/bin:$PATH"
13 fi
14 export PATH
15 
16 # Uncomment the following line if you don't like systemctl's auto-paging feature:
17 # export SYSTEMD_PAGER=
18 
19 # User specific aliases and functions
20 if [ -d ~/.bashrc.d ]; then
21         for rc in ~/.bashrc.d/*; do
22                 if [ -f "$rc" ]; then
23                         . "$rc"
24                 fi
25         done
26 fi
27 
28 unset rc
29 
30 
31 
32 
33 
34 
35 #
36 # 2023-08-01 by david
37 #
38 
39 
40 # rustc environment
41 # . "$HOME/.cargo/env"
42 . "$HOME/.cargo/env"
43 
44 
45 # alias
46 # alias sudo="echo MIMA | sudo -S"
47 alias reboot="echo  MIMA | sudo -S reboot"
48 alias off="echo MIMA | sudo -S shutdown -h now"
49 alias gpp="g++ -g -Wall -o"
50 alias cls="clear"
51 
52 
53 # TOOLS
54 export TOOLS="/home/wit/fedora38/tools"
55 export PATH=$PATH:${TOOLS}
56 
57 
58 # change work_directory
59 WORK_DIR="/home/wit/fedora38/lidawei/tmp/null"
60 cd ${WORK_DIR}
61 
62 
63 [wit@fedora ~]$ 
64 [wit@fedora ~]$ 

 

 

 

二、/etc/profile

  1 [wit@fedora ~]$ cat  /etc/profile
  2 # /etc/profile
  3 
  4 # System wide environment and startup programs, for login setup
  5 # Functions and aliases go in /etc/bashrc
  6 
  7 # It's NOT a good idea to change this file unless you know what you
  8 # are doing. It's much better to create a custom.sh shell script in
  9 # /etc/profile.d/ to make custom changes to your environment, as this
 10 # will prevent the need for merging in future updates.
 11 
 12 pathmunge () {
 13     case ":${PATH}:" in
 14         *:"$1":*)
 15             ;;
 16         *)
 17             if [ "$2" = "after" ] ; then
 18                 PATH=$PATH:$1
 19             else
 20                 PATH=$1:$PATH
 21             fi
 22     esac
 23 }
 24 
 25 
 26 if [ -x /usr/bin/id ]; then
 27     if [ -z "$EUID" ]; then
 28         # ksh workaround
 29         EUID=`/usr/bin/id -u`
 30         UID=`/usr/bin/id -ru`
 31     fi
 32     USER="`/usr/bin/id -un`"
 33     LOGNAME=$USER
 34     MAIL="/var/spool/mail/$USER"
 35 fi
 36 
 37 # Path manipulation
 38 if [ "$EUID" = "0" ]; then
 39     pathmunge /usr/sbin
 40     pathmunge /usr/local/sbin
 41 else
 42     pathmunge /usr/local/sbin after
 43     pathmunge /usr/sbin after
 44 fi
 45 
 46 HOSTNAME=$(/usr/bin/hostnamectl --transient 2>/dev/null) || \
 47 HOSTNAME=$(/usr/bin/hostname 2>/dev/null) || \
 48 HOSTNAME=$(/usr/bin/uname -n)
 49 
 50 HISTSIZE=1000
 51 if [ "$HISTCONTROL" = "ignorespace" ] ; then
 52     export HISTCONTROL=ignoreboth
 53 else
 54     export HISTCONTROL=ignoredups
 55 fi
 56 
 57 export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
 58 
 59 for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do
 60     if [ -r "$i" ]; then
 61         if [ "${-#*i}" != "$-" ]; then 
 62             . "$i"
 63         else
 64             . "$i" >/dev/null
 65         fi
 66     fi
 67 done
 68 
 69 unset i
 70 unset -f pathmunge
 71 
 72 # Source global bash config, when interactive but not posix or sh mode
 73 if test "$BASH" &&\
 74    test -z "$POSIXLY_CORRECT" &&\
 75    test "${0#-}" != sh &&\
 76    test -r /etc/bashrc
 77 then
 78    # Bash login shells run only /etc/profile
 79    # Bash non-login shells run only /etc/bashrc
 80    # Check for double sourcing is done in /etc/bashrc.
 81    . /etc/bashrc
 82 fi
 83 
 84 
 85 
 86 
 87 
 88 
 89 # david 2023-09-30
 90 
 91 # java
 92 JDK21_HOME=/usr/local/java/jdk/jdk21
 93 export JAVA_HOME=${JDK21_HOME}
 94 export CLASSPATH=.:${JAVA_HOME}/lib
 95 export PATH=$PATH:${JAVA_HOME}/bin
 96 
 97 # rust
 98 RUST_INSTALL=/home/wit/.cargo/bin
 99 export PATH=$PATH:${RUST_INSTALL}
100 [wit@fedora ~]$ 
101 [wit@fedora ~]$ 

 

 

 

三、参考文档

 

  1、无