To see all of the directories on your FreeBSD system, type
find / -type d | less
All the files?
find / -type f | less
To see all of the directories on your FreeBSD system, type
find / -type d | less
All the files?
find / -type f | less
sh (the default Bourne shell in FreeBSD) supports command-line editing. Just
``set -o emacs'' or ``set -o vi'' to enable it. Use "<TAB>" key to complete
paths.
If you want to play CDs with FreeBSD, a utility for this is already included.
Type 'cdcontrol' then 'help' to learn more. (You may need to set the CDROM
environment variable in order to make cdcontrol want to start.)
In order to search for a string in some files, use 'grep' like this:
grep "string" filename1 [filename2 filename3 ...]
This will print out the lines in the files that contain the string. grep can
also do a lot more advanced searches - type 'man grep' for details.
Need to remove all those ^M characters from a DOS file? Try
tr -d \\r < dosfile > newfile
-- Originally by Dru <genesis@istar.ca>
Over quota? "du -sh * | sort -h " will give you a sorted list of your
directory sizes.
-- David Scheidt <dscheidt@tumbolia.com>
If you use the C shell, add the following line to the .cshrc file in your
home directory to prevent core files from being written to disk:
limit coredumpsize 0
-- Dru <genesis@istar.ca>
If you want df(1) and other commands to display disk sizes in
kilobytes instead of 512-byte blocks, set BLOCKSIZE in your
environment to 'K'. You can also use 'M' for Megabytes or 'G' for
Gigabytes. If you want df(1) to automatically select the best size
then use 'df -h'.
To delete a range of ZFS snapshots, use the % (percent) character after the
full path to the first snapshot that should be included. For example, to
simulate deleting snapshots a through (including) d, use this command:
# zfs destroy -rvn mypool/tmp@a%d
Once you are sure that this is what you want, remove the -n option:
# zfs destroy -rv mypool/tmp@a%d
-- Benedict Reuschling <bcr@FreeBSD.org>
To see the last 10 lines of a long file, use "tail filename". To see the
first 10 lines, use "head filename". To see new lines as they're appended
to a file, use "tail -f filename".
-- Dru <genesis@istar.ca>
To see how long it takes a command to run, type the word "time" before the
command name.
-- Dru <genesis@istar.ca>
ZFS can display I/O statistics for a given pool using the iostat subcommand.
By default, it will display one line of current activity. To display stats
every 5 seconds run the following command (cancel with CTRL+C):
zpool iostat 5
To view individual disk activities, specify the -v parameter:
zpool iostat -v
Of course, both can be combined. For more options, see zpool(8).
-- Benedict Reuschling <bcr@FreeBSD.org>
You can press up-arrow or down-arrow to walk through a list of
previous commands in tcsh.
Need to quickly empty a file? Use ": > filename".
-- Dru <genesis@istar.ca>
To determine whether a file is a text file, executable, or some other type
of file, use
file filename
-- Dru <genesis@istar.ca>
To run rc scripts in /etc/rc.d and /usr/local/etc/rc.d use service(8).
Run "service ${name_of_rc_script} start" to start a daemon and
"service ${name_of_rc_script} stop" to stop it.
-- Lars Engels <lme@FreeBSD.org>
Can't delete /usr/obj? Enter "chflags -R noschg /usr/obj" to remove the
system immutable flag for all files in /usr/obj.
-- Lars Engels <lme@FreeBSD.org>
Need to see which daemons are listening for connection requests? Use
"sockstat -4l" for IPv4, and "sockstat -l" for IPv4 and IPv6.
-- Dru <genesis@istar.ca>
"man firewall" will give advice for building a FreeBSD firewall using ipfw(8).
-- David Scheidt <dscheidt@tumbolia.com>
"man security" gives very good advice on how to tune the security of your
FreeBSD system.