Saturday, December 26, 2009

FreeBSD: ---> MOTD

commands
เป็น tips ที่ได้ตอน login เข้าใช้งาน
อันที่เข้าท่า ก็เก็บรวบรวมมาไว้

1 If you want to quickly check for duplicate package/port installations,
try the following pkg_info command.

pkg_info | sort | sed -e 's/-[0-9].*$//' | \
uniq -c | grep -v '^[[:space:]]*1'

2 To see the 10 largest files on a directory or partition, use

du /partition_or_directory_name | sort -rn | head
-- Dru

3 sh (the default Bourne shell in FreeBSD) supports command-line editing. Just
``set -o emacs'' or ``set -o vi'' to enable it.

4 Nice tcsh prompts:
set prompt = '[%B%m%b] %B%~%b%# '
set prompt = '%m %# '
set prompt = '%n@%m%# '
set prompt = '%n@%m:%/%# '
set prompt = '%n@%m:%~%# '

5 Need to remove all those ^M characters from a DOS file? Try

tr -d \\r < dosfile > newfile
-- Originally by Dru

6 To see how long it takes a command to run, type the word "time" before the
command name.
-- Dru

7 You can use /etc/make.conf to control the options used to compile software
on this system. Example entries are in
/usr/share/examples/etc/make.conf.

8 Can't remember if you've installed a certain port or not? Try "pkg_info
-Ix port_name".

9 To change an environment variable in /bin/sh use:

$ VARIABLE="value"
$ export VARIABLE

10 You can change the video mode on all consoles by adding something like
the following to /etc/rc.conf:

allscreens="80x30"

11 You can use "vidcontrol -i mode | grep T" for a list of supported text
modes.
-- Konstantinos Konstantinidis

12 Want colour in your directory listings? Use "ls -G". "ls -F" is also useful,
and they can be combined as "ls -FG".

13 If other operating systems have damaged your Master Boot Record, you can
reinstall it either with /usr/sbin/sysinstall or with boot0cfg(8). See
"man boot0cfg" for details.

14 You can make a log of your terminal session with script(1).

15 To clear the screen, use "clear". To re-display your screen buffer, press
the scroll lock key and use your page up button. When you're finished,
press the scroll lock key again to get your prompt back.
-- Dru

16 You can get a good generic server install by using the
instant-server port/package. If you have ports installed, you can
install it by doing

# cd /usr/ports/misc/instant-server
# make install && make clean

as root. This will install a collection of packages that is appropriate for
running a "generic" server.

17 To see the 10 largest files on a directory or partition, use

du /partition_or_directory_name | sort -rn | head
-- Dru

18 This fortune brought to you by:
$FreeBSD: src/games/fortune/datfiles/freebsd-tips,v 1.47.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $


อย่างลำดับที่ ๔ นั่น ก็ทำให้เราได้ prompt มาใช้งานสำหรับ csh
ก็ให้ไปกำหนดในแฟ้ม ~/.cshrc ของทุกท่านน่ะ
set prompt = '[%B%m%b] %B%~%b%# '

น่ะ ลองดูน่าจะได้ประโยชน์มั่ง
ยามว่างก็พิจารณาดูน่ะครับ

ทุก motd มะไฟ จับเอาไว้ด้วย vidcontrol -P ที่ได้จากข้อ 11 นั่นแหละ ไปอ่าน vidcontrol(1) เอาไง อิอิ

No comments:


View My Stats