为了让自己能学习到更多的技巧,也为了我这曾经被自己忽视的发现。从今天开始,我将把这些技巧在这里以连载的形式做一个记录。希望能对我,也对来看我的博客的技术朋友有些帮助。
FreeBSD skills everyday
字体: 小 中 大 | 打印 发表于: 2008-7-11 10:46 作者: 剑心通明 来源: BSD爱好者乐园
为了让自己能学习到更多的技巧,也为了我这曾经被自己忽视的发现。从今天开始,我将把这些技巧在这里以连载的形式做一个记录。希望能对我,也对来看我的博客的技术朋友有些帮助。
字体: 小 中 大 | 打印 发表于: 2008-7-11 10:46 作者: 剑心通明 来源: BSD爱好者乐园
最新回复
剑心通明 (2008-7-11 10:46:58)
instant-workstation port/package. If you have ports installed, you can
install it by doing
# cd /usr/ports/misc/instant-workstation
# make install && make clean
as root. This will install a collection of packages that is convenient to
have on a workstation.
剑心通明 (2008-7-11 10:48:35)
home directory to prevent core files from being written to disk:
limit coredumpsize 0
-- Dru <genesis@istar.ca>
剑心通明 (2008-7-11 10:48:56)
"sockstat -4l" for IPv4, and "sockstat -l" for IPv4 and IPv6.
-- Dru <genesis@istar.ca>
剑心通明 (2008-7-11 10:49:14)
"wc filename".
-- Dru <genesis@istar.ca>
剑心通明 (2008-7-11 10:49:34)
kilobytes instead of 512-byte blocks, set BLOCKSIZE in your
environment to 'K'. You can also use 'M' for Megabytes or 'G' for
Gigabytes. If you want df(1) to automatically select the best size
then use 'df -h'.
剑心通明 (2008-7-11 10:49:52)
find / -name "*GENERIC*" -ls
will search '/', and all subdirectories, for files with 'GENERIC' in the name.
-- Stephen Hilton <nospam@hiltonbsd.com>
剑心通明 (2008-7-11 10:50:17)
$ VARIABLE="value"
$ export VARIABLE
剑心通明 (2008-7-11 10:50:36)
whole year, type "cal -y".
-- Dru <genesis@istar.ca>
剑心通明 (2008-7-11 10:50:53)
dig -x IP_address
-- Dru <genesis@istar.ca>
剑心通明 (2008-7-11 10:51:22)
set this environment variable to 'xterm-color' instead, a lot of programs will
use colors. You can do this by
TERM=xterm-color; export TERM
in Bourne-derived shells, and
setenv TERM xterm-color
in csh-derived shells.
剑心通明 (2008-7-11 10:51:39)
commands you commonly use. Examples of fairly popular aliases include (in
Bourne shell style, as in /bin/sh, bash, ksh, and zsh):
alias lf="ls -FA"
alias ll="ls -lA"
alias su="su -m"
In csh or tcsh, these would be
alias lf ls -FA
alias ll ls -lA
alias su su -m
To remove an alias, you can usually use 'unalias aliasname'. To list all
aliases, you can usually type just 'alias'.
剑心通明 (2008-7-11 10:51:55)
an 'o', in a file named 'foo', you can do:
sed -i.bak s/e/o/g foo
And you'll get a backup of the original in a file named 'foo.bak', but if you
want no backup:
sed -i '' s/e/o/g foo
剑心通明 (2008-7-11 10:52:11)
flag is your gateway.
-- Dru <genesis@istar.ca>
剑心通明 (2008-7-11 10:52:28)
starting multiuser mode (ie, starting the computer up for normal use) is to
run the shell script /etc/rc. By reading /etc/rc, you can learn a lot about
how the system is put together, which again will make you more confident about
what happens when you do something with it.
剑心通明 (2008-7-11 10:52:53)
tr -d \\r < dosfile > newfile
-- Originally by Dru <genesis@istar.ca>
剑心通明 (2008-7-11 10:53:10)
"sockstat -4l" for IPv4, and "sockstat -l" for IPv4 and IPv6.
-- Dru <genesis@istar.ca>