Lines 1-5
Link Here
|
1 |
This fortune brought to you by: |
1 |
This fortune brought to you by: |
2 |
$FreeBSD: head/games/fortune/datfiles/freebsd-tips 269089 2014-07-25 14:47:44Z allanjude $ |
2 |
$FreeBSD: release/10.0.0/games/fortune/datfiles/freebsd-tips 256019 2013-10-03 11:51:15Z glebius $ |
3 |
% |
3 |
% |
4 |
Any user that is a member of the wheel group can use "su -" to simulate |
4 |
Any user that is a member of the wheel group can use "su -" to simulate |
5 |
a root login. You can add a user to the wheel group by editing /etc/group. |
5 |
a root login. You can add a user to the wheel group by editing /etc/group. |
Lines 7-12
Link Here
|
7 |
% |
7 |
% |
8 |
By pressing "Scroll Lock" you can use the arrow keys to scroll backward |
8 |
By pressing "Scroll Lock" you can use the arrow keys to scroll backward |
9 |
through the console output. Press "Scroll Lock" again to turn it off. |
9 |
through the console output. Press "Scroll Lock" again to turn it off. |
|
|
10 |
Don't have a "Scroll Lock" key? The "Pause / Break" key acts alike. |
10 |
% |
11 |
% |
11 |
Can't remember if you've installed a certain port or not? Try "pkg info |
12 |
Can't remember if you've installed a certain port or not? Try "pkg info |
12 |
-x port_name". |
13 |
-x port_name". |
Lines 40-47
Link Here
|
40 |
variable FTP_PASSIVE_MODE to yes, and see fetch(3) for more details. |
41 |
variable FTP_PASSIVE_MODE to yes, and see fetch(3) for more details. |
41 |
% |
42 |
% |
42 |
If other operating systems have damaged your Master Boot Record, you can |
43 |
If other operating systems have damaged your Master Boot Record, you can |
43 |
reinstall it with boot0cfg(8). See |
44 |
reinstall it with gpart(8). See |
44 |
"man boot0cfg" for details. |
45 |
"man gpart" for details. |
45 |
% |
46 |
% |
46 |
If you accidentally end up inside vi, you can quit it by pressing Escape, colon |
47 |
If you accidentally end up inside vi, you can quit it by pressing Escape, colon |
47 |
(:), q (q), bang (!) and pressing return. |
48 |
(:), q (q), bang (!) and pressing return. |
Lines 116-122
Link Here
|
116 |
less without creating other nationalisation aspects, set the environment |
117 |
less without creating other nationalisation aspects, set the environment |
117 |
variable LC_ALL to 'en_US.ISO8859-1'. |
118 |
variable LC_ALL to 'en_US.ISO8859-1'. |
118 |
% |
119 |
% |
119 |
"man firewall" will give advice for building a FreeBSD firewall |
120 |
"man firewall" will give advice for building a FreeBSD firewall using ipfw(8). |
120 |
-- David Scheidt <dscheidt@tumbolia.com> |
121 |
-- David Scheidt <dscheidt@tumbolia.com> |
121 |
% |
122 |
% |
122 |
"man hier" will explain the way FreeBSD filesystems are normally laid out. |
123 |
"man hier" will explain the way FreeBSD filesystems are normally laid out. |
Lines 141-147
Link Here
|
141 |
-- David Scheidt <dscheidt@tumbolia.com> |
142 |
-- David Scheidt <dscheidt@tumbolia.com> |
142 |
% |
143 |
% |
143 |
Need to do a search in a manpage or in a file you've sent to a pager? Use |
144 |
Need to do a search in a manpage or in a file you've sent to a pager? Use |
144 |
"/search_word". To repeat the same search, type "n" for next. |
145 |
"/search_word". To repeat the same search, type "n" for next or "p" for |
|
|
146 |
previous. |
145 |
-- Dru <genesis@istar.ca> |
147 |
-- Dru <genesis@istar.ca> |
146 |
% |
148 |
% |
147 |
Need to find the location of a program? Use "locate program_name". |
149 |
Need to find the location of a program? Use "locate program_name". |
Lines 183-189
Link Here
|
183 |
Nice bash prompt: PS1='(\[$(tput md)\]\t <\w>\[$(tput me)\]) $(echo $?) \$ ' |
185 |
Nice bash prompt: PS1='(\[$(tput md)\]\t <\w>\[$(tput me)\]) $(echo $?) \$ ' |
184 |
-- Mathieu <mathieu@hal.interactionvirtuelle.com> |
186 |
-- Mathieu <mathieu@hal.interactionvirtuelle.com> |
185 |
% |
187 |
% |
186 |
Over quota? "du -s * | sort -n " will give you a sorted list of your |
188 |
Over quota? "du -sh * | sort -h " will give you a sorted list of your |
187 |
directory sizes. |
189 |
directory sizes. |
188 |
-- David Scheidt <dscheidt@tumbolia.com> |
190 |
-- David Scheidt <dscheidt@tumbolia.com> |
189 |
% |
191 |
% |
Lines 191-197
Link Here
|
191 |
TCP or UDP connections, but also for proxying them with inetd(8). |
193 |
TCP or UDP connections, but also for proxying them with inetd(8). |
192 |
% |
194 |
% |
193 |
sh (the default Bourne shell in FreeBSD) supports command-line editing. Just |
195 |
sh (the default Bourne shell in FreeBSD) supports command-line editing. Just |
194 |
``set -o emacs'' or ``set -o vi'' to enable it. |
196 |
``set -o emacs'' or ``set -o vi'' to enable it. Use "<TAB>" key to complete |
|
|
197 |
paths. |
195 |
% |
198 |
% |
196 |
Simple tcsh prompt: set prompt = '%# ' |
199 |
Simple tcsh prompt: set prompt = '%# ' |
197 |
% |
200 |
% |
Lines 215-220
Link Here
|
215 |
press the scroll lock key again to get your prompt back. |
218 |
press the scroll lock key again to get your prompt back. |
216 |
-- Dru <genesis@istar.ca> |
219 |
-- Dru <genesis@istar.ca> |
217 |
% |
220 |
% |
|
|
221 |
You can press Ctrl-L while in the shell to clear the screen. |
222 |
% |
218 |
To determine whether a file is a text file, executable, or some other type |
223 |
To determine whether a file is a text file, executable, or some other type |
219 |
of file, use |
224 |
of file, use |
220 |
|
225 |
|
Lines 231-240
Link Here
|
231 |
To erase a line you've written at the command prompt, use "Ctrl-U". |
236 |
To erase a line you've written at the command prompt, use "Ctrl-U". |
232 |
-- Dru <genesis@istar.ca> |
237 |
-- Dru <genesis@istar.ca> |
233 |
% |
238 |
% |
234 |
To find the hostname associated with an IP address, use |
239 |
To find out the hostname associated with an IP address, use |
235 |
|
240 |
|
236 |
drill -x IP_address |
241 |
drill -x IP_address |
237 |
-- Allan Jude <allanjude@freebsd.org> |
242 |
-- Dru <genesis@istar.ca> |
238 |
% |
243 |
% |
239 |
To obtain a neat PostScript rendering of a manual page, use ``-t'' switch |
244 |
To obtain a neat PostScript rendering of a manual page, use ``-t'' switch |
240 |
of the man(1) utility: ``man -t <topic>''. For example: |
245 |
of the man(1) utility: ``man -t <topic>''. For example: |
Lines 247-253
Link Here
|
247 |
-- Dru <genesis@istar.ca> |
252 |
-- Dru <genesis@istar.ca> |
248 |
% |
253 |
% |
249 |
To read a compressed file without having to first uncompress it, use |
254 |
To read a compressed file without having to first uncompress it, use |
250 |
"zcat" or "zless" to view it. |
255 |
"zcat" or "zless" to view it. There is also "bzcat", "bzless", "xzcat" |
|
|
256 |
and "xzless". |
251 |
-- Dru <genesis@istar.ca> |
257 |
-- Dru <genesis@istar.ca> |
252 |
% |
258 |
% |
253 |
To repeat the last command in the C shell, type "!!". |
259 |
To repeat the last command in the C shell, type "!!". |
Lines 283-289
Link Here
|
283 |
% |
289 |
% |
284 |
To see the 10 largest files on a directory or partition, use |
290 |
To see the 10 largest files on a directory or partition, use |
285 |
|
291 |
|
286 |
du /partition_or_directory_name | sort -rn | head |
292 |
du -h /partition_or_directory_name | sort -rh | head |
287 |
-- Dru <genesis@istar.ca> |
293 |
-- Dru <genesis@istar.ca> |
288 |
% |
294 |
% |
289 |
To see the IP addresses currently set on your active interfaces, type |
295 |
To see the IP addresses currently set on your active interfaces, type |
Lines 291-297
Link Here
|
291 |
-- Dru <genesis@istar.ca> |
297 |
-- Dru <genesis@istar.ca> |
292 |
% |
298 |
% |
293 |
To see the last 10 lines of a long file, use "tail filename". To see the |
299 |
To see the last 10 lines of a long file, use "tail filename". To see the |
294 |
first 10 lines, use "head filename". |
300 |
first 10 lines, use "head filename". To see new lines as they're appended |
|
|
301 |
to a file, use "tail -f filename". |
295 |
-- Dru <genesis@istar.ca> |
302 |
-- Dru <genesis@istar.ca> |
296 |
% |
303 |
% |
297 |
To see the last time that you logged in, use lastlogin(8). |
304 |
To see the last time that you logged in, use lastlogin(8). |
Lines 343-348
Link Here
|
343 |
|
350 |
|
344 |
This won't work if you don't have write permissions to the directory |
351 |
This won't work if you don't have write permissions to the directory |
345 |
and probably won't be suitable if you're editing through a symbolic link. |
352 |
and probably won't be suitable if you're editing through a symbolic link. |
|
|
353 |
|
354 |
If you have sudo(8) installed and permissions to use it, type |
355 |
``<ESC>w ! sudo tee %'' to force a write. |
346 |
% |
356 |
% |
347 |
You can adjust the volume of various parts of the sound system in your |
357 |
You can adjust the volume of various parts of the sound system in your |
348 |
computer by typing 'mixer <type> <volume>'. To get a list of what you can |
358 |
computer by typing 'mixer <type> <volume>'. To get a list of what you can |
Lines 393-399
Link Here
|
393 |
You can often get answers to your questions about FreeBSD by searching in the |
403 |
You can often get answers to your questions about FreeBSD by searching in the |
394 |
FreeBSD mailing list archives at |
404 |
FreeBSD mailing list archives at |
395 |
|
405 |
|
396 |
http://www.FreeBSD.org/search/search.html |
406 |
http://freebsd.markmail.org |
397 |
% |
407 |
% |
398 |
You can open up a new split-screen window in (n)vi with :N or :E and then |
408 |
You can open up a new split-screen window in (n)vi with :N or :E and then |
399 |
use ^w to switch between the two. |
409 |
use ^w to switch between the two. |
Lines 408-415
Link Here
|
408 |
login shell. |
418 |
login shell. |
409 |
-- Konstantinos Konstantinidis <kkonstan@duth.gr> |
419 |
-- Konstantinos Konstantinidis <kkonstan@duth.gr> |
410 |
% |
420 |
% |
411 |
You can press Ctrl-L while in the shell to clear the screen. |
|
|
412 |
% |
413 |
You can press up-arrow or down-arrow to walk through a list of |
421 |
You can press up-arrow or down-arrow to walk through a list of |
414 |
previous commands in tcsh. |
422 |
previous commands in tcsh. |
415 |
% |
423 |
% |
Lines 439-445
Link Here
|
439 |
% |
447 |
% |
440 |
You can use /etc/make.conf to control the options used to compile software |
448 |
You can use /etc/make.conf to control the options used to compile software |
441 |
on this system. Example entries are in |
449 |
on this system. Example entries are in |
442 |
/usr/share/examples/etc/make.conf. |
450 |
/usr/share/examples/etc/make.conf and in make.conf(5). |
|
|
451 |
For options that are set for building FreeBSD's kernel and its world, see |
452 |
src.conf(5). |
443 |
% |
453 |
% |
444 |
You can use "pkg info" to see a list of packages you have installed. |
454 |
You can use "pkg info" to see a list of packages you have installed. |
445 |
% |
455 |
% |
Lines 457-464
Link Here
|
457 |
-- Konstantinos Konstantinidis <kkonstan@duth.gr> |
467 |
-- Konstantinos Konstantinidis <kkonstan@duth.gr> |
458 |
% |
468 |
% |
459 |
Want to run the same command again? |
469 |
Want to run the same command again? |
460 |
In tcsh you can type "!!" |
470 |
In tcsh you can type "!!". |
461 |
% |
471 |
% |
462 |
Want to go the directory you were just in? |
472 |
Want to go the directory you were just in? |
463 |
Type "cd -" |
473 |
Type "cd -" |
464 |
% |
474 |
% |
|
|
475 |
Can't delete /usr/obj? Enter "chflags -R noschg /usr/obj" to remove the |
476 |
system immutable flag for all files in /usr/obj. |
477 |
|
478 |
-- Lars Engels <lme@FreeBSD.org> |
479 |
% |
480 |
Want to list all files of an installed package? Enter |
481 |
"pkg info -l packagename". |
482 |
|
483 |
-- Lars Engels <lme@FreeBSD.org> |
484 |
% |
485 |
Are you looking for a package? Search for it with |
486 |
"pkg search part_of_package_name" |
487 |
|
488 |
-- Lars Engels <lme@FreeBSD.org> |
489 |
% |
490 |
If you want to recursively copy a directory preserving file and directory |
491 |
attributes use |
492 |
"cp -a source target" |
493 |
|
494 |
-- Lars Engels <lme@FreeBSD.org> |
495 |
% |
496 |
Do you wonder what a terminal program is doing at the moment? dd(1) does not |
497 |
show any troughput? Hit "^T" (Control + t) to send SIGINFO to the process |
498 |
and see what it is doing. |
499 |
|
500 |
-- Lars Engels <lme@FreeBSD.org> |
501 |
% |
502 |
Do you want to know which version of FreeBSD you are running? Enter |
503 |
"freebsd-version -ku" to display kernel and userland version. |
504 |
|
505 |
-- Lars Engels <lme@FreeBSD.org> |
506 |
% |
507 |
If you want to end one or more processes at a time using a regular expression |
508 |
enter "pkill regex". |
509 |
|
510 |
-- Lars Engels <lme@FreeBSD.org> |
511 |
% |
512 |
Do you want to run a program directly after some other process has ended? Use |
513 |
"pwait pid && new_program" |
514 |
|
515 |
-- Lars Engels <lme@FreeBSD.org> |
516 |
% |
517 |
When you want your users to be able to reboot or shutdown FreeBSD, add them |
518 |
to the group "operator" and they are allowed to use shutdown(8) and poweroff(8). |
519 |
|
520 |
-- Lars Engels <lme@FreeBSD.org> |
521 |
% |
522 |
If you need to create a FAT32 formatted USB thumb drive, find out its devicename |
523 |
running dmesg(8) after inserting it. Then create an MBR schema, a single slice and |
524 |
format it: |
525 |
|
526 |
# gpart create -s MBR ${devicename} |
527 |
# gpart add -t fat32 ${devicename} |
528 |
# newfs_msdos -F 32 -L thumbdrive ${devicename}s1 |
529 |
|
530 |
-- Lars Engels <lme@FreeBSD.org> |
531 |
% |
532 |
If you want to get a sorted list of all services that are started when FreeBSD boots, |
533 |
enter "service -e". |
534 |
|
535 |
-- Lars Engels <lme@FreeBSD.org> |
536 |
% |
537 |
To easily configure your installed FreeBSD use bsdconfig(8). |
538 |
|
539 |
-- Lars Engels <lme@FreeBSD.org> |
540 |
% |
541 |
After you compiled and installed a new version of FreeBSD, use etcupdate(8) to merge |
542 |
configuration updates. |
543 |
Run "etcupdate extract" once when your sources match your running system, then run |
544 |
"etcupdate" after every upgrade and "etcupdate resolve" to resolve any conflicts. |
545 |
|
546 |
-- Lars Engels <lme@FreeBSD.org> |
547 |
% |
548 |
Do you want to do a binary upgrade of your running FreeBSD installation? Use freebsd-update(8). |
549 |
|
550 |
To install updates and patches for the running branch use |
551 |
# freebsd-update fetch install |
552 |
|
553 |
To upgrade to a newer release use |
554 |
# freebsd-update upgrade -r ${name_of_release} |
555 |
|
556 |
-- Lars Engels <lme@FreeBSD.org> |
557 |
% |
558 |
To run rc scripts in /etc/rc.d and /usr/local/etc/rc.d use service(8). |
559 |
Run "service ${name_of_rc_script} start" to start a daemon and |
560 |
"service ${name_of_rc_script} stop" to stop it. |
561 |
|
562 |
-- Lars Engels <lme@FreeBSD.org> |
563 |
% |
564 |
If you don't want to edit /etc/rc.conf directly, use sysrc(8) to add and remove entries. |
565 |
Use "sysctl name=value" to add an entry and "sysctl -x name" to delete an entry. |
566 |
|
567 |
-- Lars Engels <lme@FreeBSD.org> |
568 |
% |