FreeBSD Cheat Sheet

From Abdotcom

Table of contents

Commands I've Found useful that I frequently forget

du -ckh -d 1 ./*

my duck command. : ) in this case gives the sizes of all files or folders in the current directory. Very handy for finding out what is using up all that space on your server.

the -d 1 part is the depth at which the recursiveness will dig. So.. 0 will just show you whats in this folder.. 1 will show you all children in any folders in the current folder, and so on.

i'm just duplicating the man page at this point. i'll shut up.

df

Display free disk space.

ln -s

simple.. but i always hafta do it and i always forget how.

ln -s source target what confuses me i guess is that 'target' is the new link file i'm creating, and source is the location i want it to point to. for some reason i get those confused.

example of useage i use often:

ln -s /www/vhosts/ /home/aaron/vhosts

so:

ln -s sourceLocation linkLocation

Stuff i frequently hafta do

remove a pop lock file from a mailbox

go to: /var/mail/ as root.

if the file is larger than zero, append it back to the mailbox:

cat .username.pop >> username

delete the lock file

rm -f .username.pop

Where Stuff Is

(on my box, your mileage may vary)

/usr/local/etc/

program specific config files. including config for php, ftp services, samba, analog, etc.

/www/conf/

( /www/ is a symbolic link to /usr/local/www/ ) apache config file