Tips & Tricks

You can use "whereis" to search standard binary, manual page and source
directories for the specified programs. This can be particularly handy
when you are trying to find where in the ports tree an application is.

Try "whereis firefox" and "whereis whereis".
		-- Konstantinos Konstantinidis <kkonstan at>
Want to run the same command again?
In tcsh you can type "!!"
Want to go the directory you were just in?
Type "cd -"
To list outdated ports (after portsnap fetch update):
	portversion -vL=
		-- Ross <ross at>
To dump mounted file system /fs to /backup/fs.dump.gz on other host:
	dump -0Luaf - /fs | gzip | \
	? ssh user@host dd of=/backup/fs.dump.gz
To restore that file system, after newfsing and mounting it:
	cd /fs
	ssh user@host cat /backup/fs.dump.gz | gunzip | \
	? restore -vrf -
	rm restoresymtable
		-- Ross <ross at>
To reset MBR on /dev/ad0 to default (boots active slice):
	fdisk -B /dev/ad0
To set MBR to FreeBSD Boot Manager (shows menu):
	boot0cfg -Bv /dev/ad0
		-- Ross <ross at>
To do a full copy of /source to /destination
preserving links, permissions and ownership:
	mkdir /destination
	cd /source
	tar cf - . | (cd /destination; tar xpf -)
		-- Ross <ross at>
To mount an ISO image:
	mdconfig -a -t vnode -f /path/to/cdimage.iso -u 1
	mount_cd9660 /dev/md1 /mnt
		-- Ross <ross at>
To list ports on which <port-name> depends:
	pkg_info -rx "port-name"
To list ports which require <port-name>:
	pkg_info -Rx "port-name"
		-- Ross <ross at>
To create ISO image of a DVD disk, insert the disk into the drive and:
	dd if=/dev/acd0 of=cdimage.iso bs=2048
		-- Ross <ross at>
Page:    1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12