--- /usr/src//games/fortune/datfiles/freebsd-tips 2014-08-04 11:51:03.819602259 +0200 +++ freebsd-tips 2014-08-04 11:52:46.813594000 +0200 @@ -1,5 +1,5 @@ This fortune brought to you by: -$FreeBSD: head/games/fortune/datfiles/freebsd-tips 269089 2014-07-25 14:47:44Z allanjude $ +$FreeBSD: release/10.0.0/games/fortune/datfiles/freebsd-tips 256019 2013-10-03 11:51:15Z glebius $ % Any user that is a member of the wheel group can use "su -" to simulate a root login. You can add a user to the wheel group by editing /etc/group. @@ -7,6 +7,7 @@ % By pressing "Scroll Lock" you can use the arrow keys to scroll backward through the console output. Press "Scroll Lock" again to turn it off. +Don't have a "Scroll Lock" key? The "Pause / Break" key acts alike. % Can't remember if you've installed a certain port or not? Try "pkg info -x port_name". @@ -40,8 +41,8 @@ variable FTP_PASSIVE_MODE to yes, and see fetch(3) for more details. % If other operating systems have damaged your Master Boot Record, you can -reinstall it with boot0cfg(8). See -"man boot0cfg" for details. +reinstall it with gpart(8). See +"man gpart" for details. % If you accidentally end up inside vi, you can quit it by pressing Escape, colon (:), q (q), bang (!) and pressing return. @@ -116,7 +117,7 @@ less without creating other nationalisation aspects, set the environment variable LC_ALL to 'en_US.ISO8859-1'. % -"man firewall" will give advice for building a FreeBSD firewall +"man firewall" will give advice for building a FreeBSD firewall using ipfw(8). -- David Scheidt % "man hier" will explain the way FreeBSD filesystems are normally laid out. @@ -141,7 +142,8 @@ -- David Scheidt % Need to do a search in a manpage or in a file you've sent to a pager? Use -"/search_word". To repeat the same search, type "n" for next. +"/search_word". To repeat the same search, type "n" for next or "p" for +previous. -- Dru % Need to find the location of a program? Use "locate program_name". @@ -183,7 +185,7 @@ Nice bash prompt: PS1='(\[$(tput md)\]\t <\w>\[$(tput me)\]) $(echo $?) \$ ' -- Mathieu % -Over quota? "du -s * | sort -n " will give you a sorted list of your +Over quota? "du -sh * | sort -h " will give you a sorted list of your directory sizes. -- David Scheidt % @@ -191,7 +193,8 @@ TCP or UDP connections, but also for proxying them with inetd(8). % sh (the default Bourne shell in FreeBSD) supports command-line editing. Just -``set -o emacs'' or ``set -o vi'' to enable it. +``set -o emacs'' or ``set -o vi'' to enable it. Use "" key to complete +paths. % Simple tcsh prompt: set prompt = '%# ' % @@ -215,6 +218,8 @@ press the scroll lock key again to get your prompt back. -- Dru % +You can press Ctrl-L while in the shell to clear the screen. +% To determine whether a file is a text file, executable, or some other type of file, use @@ -231,10 +236,10 @@ To erase a line you've written at the command prompt, use "Ctrl-U". -- Dru % -To find the hostname associated with an IP address, use +To find out the hostname associated with an IP address, use drill -x IP_address - -- Allan Jude + -- Dru % To obtain a neat PostScript rendering of a manual page, use ``-t'' switch of the man(1) utility: ``man -t ''. For example: @@ -247,7 +252,8 @@ -- Dru % To read a compressed file without having to first uncompress it, use -"zcat" or "zless" to view it. +"zcat" or "zless" to view it. There is also "bzcat", "bzless", "xzcat" +and "xzless". -- Dru % To repeat the last command in the C shell, type "!!". @@ -283,7 +289,7 @@ % To see the 10 largest files on a directory or partition, use - du /partition_or_directory_name | sort -rn | head + du -h /partition_or_directory_name | sort -rh | head -- Dru % To see the IP addresses currently set on your active interfaces, type @@ -291,7 +297,8 @@ -- Dru % To see the last 10 lines of a long file, use "tail filename". To see the -first 10 lines, use "head filename". +first 10 lines, use "head filename". To see new lines as they're appended +to a file, use "tail -f filename". -- Dru % To see the last time that you logged in, use lastlogin(8). @@ -343,6 +350,9 @@ This won't work if you don't have write permissions to the directory and probably won't be suitable if you're editing through a symbolic link. + +If you have sudo(8) installed and permissions to use it, type +``w ! sudo tee %'' to force a write. % You can adjust the volume of various parts of the sound system in your computer by typing 'mixer '. To get a list of what you can @@ -393,7 +403,7 @@ You can often get answers to your questions about FreeBSD by searching in the FreeBSD mailing list archives at - http://www.FreeBSD.org/search/search.html + http://freebsd.markmail.org % You can open up a new split-screen window in (n)vi with :N or :E and then use ^w to switch between the two. @@ -408,8 +418,6 @@ login shell. -- Konstantinos Konstantinidis % -You can press Ctrl-L while in the shell to clear the screen. -% You can press up-arrow or down-arrow to walk through a list of previous commands in tcsh. % @@ -439,7 +447,9 @@ % You can use /etc/make.conf to control the options used to compile software on this system. Example entries are in -/usr/share/examples/etc/make.conf. +/usr/share/examples/etc/make.conf and in make.conf(5). +For options that are set for building FreeBSD's kernel and its world, see +src.conf(5). % You can use "pkg info" to see a list of packages you have installed. % @@ -457,8 +467,102 @@ -- Konstantinos Konstantinidis % Want to run the same command again? -In tcsh you can type "!!" +In tcsh you can type "!!". % Want to go the directory you were just in? Type "cd -" % +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 +% +Want to list all files of an installed package? Enter +"pkg info -l packagename". + + -- Lars Engels +% +Are you looking for a package? Search for it with +"pkg search part_of_package_name" + + -- Lars Engels +% +If you want to recursively copy a directory preserving file and directory +attributes use +"cp -a source target" + + -- Lars Engels +% +Do you wonder what a terminal program is doing at the moment? dd(1) does not +show any troughput? Hit "^T" (Control + t) to send SIGINFO to the process +and see what it is doing. + + -- Lars Engels +% +Do you want to know which version of FreeBSD you are running? Enter +"freebsd-version -ku" to display kernel and userland version. + + -- Lars Engels +% +If you want to end one or more processes at a time using a regular expression +enter "pkill regex". + + -- Lars Engels +% +Do you want to run a program directly after some other process has ended? Use +"pwait pid && new_program" + + -- Lars Engels +% +When you want your users to be able to reboot or shutdown FreeBSD, add them +to the group "operator" and they are allowed to use shutdown(8) and poweroff(8). + + -- Lars Engels +% +If you need to create a FAT32 formatted USB thumb drive, find out its devicename +running dmesg(8) after inserting it. Then create an MBR schema, a single slice and +format it: + +# gpart create -s MBR ${devicename} +# gpart add -t fat32 ${devicename} +# newfs_msdos -F 32 -L thumbdrive ${devicename}s1 + + -- Lars Engels +% +If you want to get a sorted list of all services that are started when FreeBSD boots, +enter "service -e". + + -- Lars Engels +% +To easily configure your installed FreeBSD use bsdconfig(8). + + -- Lars Engels +% +After you compiled and installed a new version of FreeBSD, use etcupdate(8) to merge +configuration updates. +Run "etcupdate extract" once when your sources match your running system, then run +"etcupdate" after every upgrade and "etcupdate resolve" to resolve any conflicts. + + -- Lars Engels +% +Do you want to do a binary upgrade of your running FreeBSD installation? Use freebsd-update(8). + +To install updates and patches for the running branch use +# freebsd-update fetch install + +To upgrade to a newer release use +# freebsd-update upgrade -r ${name_of_release} + + -- Lars Engels +% +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 +% +If you don't want to edit /etc/rc.conf directly, use sysrc(8) to add and remove entries. +Use "sysctl name=value" to add an entry and "sysctl -x name" to delete an entry. + + -- Lars Engels +%