From 68be106995a68a6e76ce3951bb8742dde6f57485 Mon Sep 17 00:00:00 2001 From: nik Date: Sat, 16 Jun 2001 16:45:52 +0000 Subject: More tips. I'd never heard of look(1) before. Submitted by: Dru --- games/fortune/datfiles/freebsd-tips | 159 ++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) (limited to 'games/fortune') diff --git a/games/fortune/datfiles/freebsd-tips b/games/fortune/datfiles/freebsd-tips index e8ce782..74f9440 100644 --- a/games/fortune/datfiles/freebsd-tips +++ b/games/fortune/datfiles/freebsd-tips @@ -330,3 +330,162 @@ details. If other operating systems have damaged your Master Boot Record, you can reinstall it either with /stand/sysinstall or with boot0cfg(8). See "man boot0cfg" for details. +% +Need to see the calendar for this month? Simply type "cal". To see the +whole year, type "cal 2001". + -- Dru +% +Need to quickly return to your home directory? Type "cd". + -- Dru +% +To see the last time that you logged in, use lastlogin(8). + -- Dru +% +To clear the screen, use "clear". To re-display your screen buffer, press +the scroll lock key and use your page up button. When you're finished, +press the scroll lock key again to get your prompt back. + -- Dru +% +To save disk space in your home directory, can compress files you +rarely use with "gzip filename". + -- Dru +% +To read a compressed file without having to first uncompress it, use +"zcat" or "zmore" to view it. + -- Dru +% +To see how much disk space is left on your partitions, use + + df -h + -- Dru +% +To see the 10 largest files on a directory or partition, use + + du /partition_or_directory_name | sort -rn | head + -- Dru +% +To determine whether a file is a text file, executable, or some other type +of file, use + + file filename + -- Dru +% +Need to find the information that was displayed on your screen at boot +time? Try + + more /var/run/dmesg.boot + -- Dru +% +Time to change your password? Type "passwd" and follow the prompts. + -- Dru +% +Want to know how many words, lines, or bytes are contained in a file? Type +"wc filename". + -- Dru +% +Need to print a manpage? Use + + man name_of_manpage | col -bx > lpr + -- Dru +% +Need to remove all those ^M characters from a DOS file? Try + + col -bx < dosfile > newfile + -- Dru +% +Forget what directory you are in? Type "pwd". + -- Dru +% +If you are in the C shell and have just installed a new program, you won't +be able to run it unless you first type "rehash". + -- Dru +% +Need to leave your terminal for a few minutes and don't want to logout? +Use "lock -p". When you return, use your password as the key to unlock the +terminal. + -- Dru +% +Want to save your login session to a file? Type "script filename" to +record your session. When you are finished, hold down the control key and +press d. + -- Dru +% +Need to find the location of a program? Use "locate -b program_name". + -- Dru +% +Forget how to spell a word or a variation of a word? Use + + look portion_of_word_you_know + -- Dru +% +To see the last 10 lines of a long file, use "tail filename". To see the +first 10 lines, use "head filename". + -- Dru +% +To see how long it takes a command to run, type the word "time" before the +command name. + -- Dru +% +To quickly create an empty file, use "touch filename". + -- Dru +% +To find out the hostname associated with an IP address, use + + dig -x IP_address + -- Dru +% +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 +% +If you need a reminder to leave your terminal, type "leave hhmm" where +"hhmm" represents in how many hours and minutes you need to leave. + -- Dru +% +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. + -- Dru +% +Forget when Easter is? Try "ncal -e". If you need the date for Orthodox +Easter, use "ncal -o" instead. + -- Dru +% +Need to see your routing table? Type "netstat -rn". The entry with the G +flag is your gateway. + -- Dru +% +Need to see which daemons are listening for connection requests? Use +"sockstat -4". + -- Dru +% +Can't remember is you've installed a certain port or not? Try "pkg_info | +grep port_name". + -- Dru +% +Got some time to kill? Try typing "hangman". + -- Dru +% +To erase a line you've written at the command prompt, use "Ctrl u". + -- Dru +% +To repeat the last command in the C shell, type "!!". + -- Dru +% +Need to quickly empty a file? Use "echo > filename". + -- Dru +% +To see all of the directories on your FreeBSD system, type + + ls -RC / |more + -- Dru +% +To see the IP addresses currently set on your active interfaces, type +"ifconfig -u". + -- Dru +% +To see the MAC addresses of the NICs on your system, type + + grep address /var/run/dmesg.boot + -- Dru -- cgit v1.1