1 List 20 largest files (larger than 5 MB) sorted by megabytes:
3 find / -type f -size +10000 -print0 | xargs -0 du -m | sort -nr | head -20
5 You can keep specific rc.conf configurations in individual files
6 under /etc/rc.conf.d/ where each file is named after the $name of
7 the rc.d script. Some configurations may have different names than
8 the script; see the $name variable to check.
10 You can see the total used buffers in megabytes with:
13 / bytes per page$/ { bpp = $1 }
14 / cached file pages$/ { cfp = $1 }
15 / cached executable pages$/ { cep = $1 }
16 END { print((cfp + cep) * bpp / 1024 / 1024); }'
18 You can view a value of a variable in pkgsrc by using the show-var
21 make show-var VARNAME=MAINTAINER
23 You can view the basic order of your rc.d scripts with:
27 You can ask questions about NetBSD at the netbsd-users@NetBSD.org
28 mailing list. Be sure to clearly explain your problem, what you
29 tried, what results you had, and what you expected.
31 You can view your non-default Postfix settings with:
35 To report about installed packages with known vulnerabilities,
36 fetch the latest pkg-vulnerabilities file as the superuser with:
38 download-vulnerability-list
44 The following shows an example of temporarily adding 10MB more swap
45 space for virtual memory:
47 dd if=/dev/zero of=/root/swapfile bs=1024 count=10000
48 swapctl -a /root/swapfile
50 If your console ever gets broken, you can try resetting it to its
55 If you installed a package, but don't know what the software is
56 called or what executables, to run use the pkg_add with the -L
57 switch to list the package's files and search for /bin:
59 pkg_add -L PACKAGE-NAME | grep /bin
61 A new user can be added by using the useradd tool with the -m switch
62 to create the home directory. Then set the password. For example:
67 To modify user account information use the chpass or usermod tools.
68 If you need to edit the user database directly, use the vipw command.
70 You can temporarily start the SSH server by running the following
73 /etc/rc.d/sshd onestart
75 Several IP Filter and ipnat examples are available in the
76 /usr/share/examples/ipf/ directory.
78 Want to dual boot using a bluetooth mouse or keyboard? Use btkey(1)
79 to store the link key in the hardware.
81 If you are having trouble connecting to a remote bluetooth device,
82 try the btconfig(8) inquiry command. The kernel will retain some
83 clock offset information that may help.
85 You can download files via HTTP using the ftp(1) command; for example:
87 ftp http://www.NetBSD.org/images/NetBSD.png
89 The mtree(8) tool can be used to check permissions, ownerships,
90 file changes, and more when compared against a specification. For
91 example to check directory ownership and permissions for standard
92 NetBSD directories, run:
94 /usr/sbin/mtree -e -p / -f /etc/mtree/NetBSD.dist
96 If you need reminders on your console to leave, use the leave(1)
97 tool. For example to receive reminders to leave in one hour:
101 To stop non-superuser logins until next boot, as root:
105 When extracting distribution tar sets, be sure to use the pax -pe
106 option or the tar -p switch to preserve the user and group and file
107 modes (including setuid and setgid). This is needed, for example,
108 so su(1) will work after extracting the base.tgz set.
110 Math can be done within the sh(1) and ksh(1) shells or with expr(1),
111 dc(1), bc(1), or awk(1). Here are some simple examples:
114 expr 60 \* 60 \* 24 \* 7
116 You can view network connections with the fstat, netstat -a, sockstat,
117 and "systat netstat" commands.
119 Visit the NetBSD Security website to keep track of advisories:
120 http://www.NetBSD.org/support/security/
121 Or join the security-announce mailing list for alerts:
122 http://www.netbsd.org/mailinglists/#security-announce
124 Here's an example of finding what package a file belongs to:
126 pkg_info -Fe /usr/pkg/bin/inw
128 Many log files are checked for rotation every hour by newsyslog(8).
129 It is configured in /etc/newsyslog.conf.
131 NetBSD's default cron jobs are defined in the /var/cron/tabs/root
132 file. As the superuser, use "crontab -l" to view it. To edit it,
133 use "crontab -e" (which defaults to using the vi(1) editor).