FreeBSD 11.1 RELEASE - OS 起動後の基本的な設定 - /usr/share/skel の変更
- 1. 概要
- 2. /usr/share/skel の変更
1. 概要
「UNIX」系、「Linux」系では、ユーザ追加時にデフォルトで設定される項目のテンプレートを「・・・/skel」というディレクトリに用意しています。
「FreeBSD」ではそれが
/usr/share/skel
になります。
2. /usr/share/skel の変更
デフォルトで、以下のテンプレートが用意されています。
dot.cshrc
dot.login
dot.login_conf
dot.mail_aliases
dot.mailrc
dot.profile
dot.rhosts
dot.shrc
これらの dot.* は、ユーザディレクトリ上に展開される際は .* に変更されます。
たとえば、dot.cshrc は hogehoge ユーザ用は /home/hogehoge/.cshrc になります。
dot.cshrc に記述しておくと便利な項目を紹介します。
これは、わたしの設定ですので、環境が違えば、内容も変わりますのでご注意ください。
まず、デフォルトの状態は以下の通りです。
# $FreeBSD: releng/11.1/share/skel/dot.cshrc 278616 2015-02-12 05:35:00Z cperciva $
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
# more examples available at /usr/share/examples/csh/
#
alias h history 25
alias j jobs -l
alias la ls -aF
alias lf ls -FA
alias ll ls -lAF
# These are normally set through /etc/login.conf. You may override them here
# if wanted.
# set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)
# setenv BLOCKSIZE K
# A righteous umask
# umask 22
setenv EDITOR vi
setenv PAGER more
if ($?prompt) then
# An interactive shell -- set some stuff up
set prompt = "%N@%m:%~ %# "
set promptchars = "%#"
set filec
set history = 1000
set savehist = (1000 merge)
set autolist = ambiguous
# Use history to aid expansion
set autoexpand
set autorehash
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey "^W" backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward
endif
endif
わたしは上記を下のように変更しています。
# $FreeBSD: releng/11.1/share/skel/dot.cshrc 278616 2015-02-12 05:35:00Z cperciva $
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
# more examples available at /usr/share/examples/csh/
#
alias ci ci -l ← RCS の設定で、コミットと同時に使用可能にしています
alias df df -H ← df で出力する単位を人がわかりやすい単位にしています
alias h history 1000 ← history で表示する項目を 1000 項目に設定
alias j jobs -l
alias ls gls --color ← ls は GNU のものを使用してカラー表示
alias la ls -aF
alias lf ls -FA
alias ll ls -lAF
alias make gmake ← make も GNU のものを使用
alias tree tree --charset=x ← tree で文字化けしない設定
alias ping ping -c 4 ← ping を4回で打ち止め
alias vim vim -u /usr/local/etc/vim/vimrc ← ※1
alias vi vim
alias view vim -R
# These are normally set through /etc/login.conf. You may override them here
# if wanted.
# set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
# setenv BLOCKSIZE K
# A righteous umask
# umask 22
set path = ($path $HOME/node_modules/.bin)
setenv EDITOR vi
alias less lv ← ※2
alias jman env LANG=ja_JP.eucJP jman
setenv LANG ja_JP.UTF-8
setenv PAGER lv
setenv LV '-Ou8'
if ($?prompt) then
# An interactive shell -- set some stuff up
set prompt = "%N@%m:%~ %# "
set promptchars = "%#"
set filec
set history = 1000
set savehist = (1000 merge)
set autolist = ambiguous
# Use history to aid expansion
set autoexpand
set autorehash
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey "^W" backward-delete-word
bindkey -k up history-search-backward
bindkey -k down history-search-forward
bindkey "^F" forward-word ← ※3
bindkey "^B" backward-word
endif
set prompt = '%/ > ' ← ※4
setenv TERM xterm ← 端末種別の設定
eval `gdircolors ~/.dircolors` ← GNU ls の色設定
endif
いくつかさらに説明しておきます。
※1 3行まとめて vim に関する設定です。「vim」参照。
※2 5行まとめて jman に関する設定です。「jman」参照。
※3、※4 Ctrl+B、Ctrl+F 時の動作設定、プロンプト設定。「シェル」参照。
|
|