Tips & Tricks


To see the last time that you logged in, use lastlogin(8).
		-- Dru <genesis at istar.ca>
To see the MAC addresses of the NICs on your system, type

	ifconfig -a
		-- Dru <genesis at istar.ca>
To see the output from when your computer started, run dmesg(8).  If it has
been replaced with other messages, look at /var/run/dmesg.boot.
		-- Francisco Reyes <lists at natserv.com>
Want colour in your directory listings?  Use "ls -G".  "ls -F" is also useful,
and they can be combined as "ls -FG".
Want to find a specific port, just type the following under /usr/ports
or one its subdirectories:

	make search name=<port-name>
    or
	make search key=<keyword>
Want to know how many words, lines, or bytes are contained in a file? Type
"wc filename".
		-- Dru <genesis at istar.ca>
Want to see how much virtual memory you're using? Just type "swapinfo" to
be shown information about the usage of your swap partitions.
Want to strip UTF-8 BOM(Byte Order Mark) from given files?

	sed -e '1s/^\xef\xbb\xbf//' < bomfile > newfile
Want to use sed(1) to edit a file in place?  Well, to replace every 'e' with
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
When you've made modifications to a file in vi(1) and then find that
you can't write it, type ``<ESC>!rm -f
Page:    1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12