#LyX 1.2 created this file. For more info see http://www.lyx.org/ \lyxformat 220 \textclass docbook-book \begin_preamble \end_preamble \language english \inputencoding latin1 \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Custom \paperpackage a4 \use_geometry 1 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \paperwidth 210mm \paperheight 297mm \leftmargin 1cm \topmargin 1cm \rightmargin 1cm \bottommargin 1cm \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Title GNU/Linux Command-Line Tools Summary \layout SGML \layout SGML \layout SGML Gareth Anderson \layout SGML \layout SGML
\layout SGML somecsstudent(at)gmail.com \layout SGML
\layout SGML
\layout SGML
\layout SGML \layout SGML Conversion from LyX to DocBook SGML, Index generation \layout SGML Chris Karakas \layout SGML \layout SGML
\layout SGML \layout SGML Linux \layout SGML Unix \layout SGML commands \layout SGML Linux commands \layout SGML Unix commands \layout SGML Linux tools \layout SGML Unix tools \layout SGML tutorial \layout SGML command line \layout SGML prompt \layout SGML command reference \layout SGML command tutorial \layout SGML command line reference \layout SGML command line tutorial \layout SGML \noindent tools tutorial \layout SGML \noindent tools reference \layout SGML \noindent tool \layout SGML linux command reference \layout SGML linux command tutorial \layout SGML linux command line reference \layout SGML linux command line tutorial \layout SGML \noindent linux tools tutorial \layout SGML \noindent linux tools reference \layout SGML \noindent linux tool \layout SGML Unix command reference \layout SGML Unix command tutorial \layout SGML Unix command line reference \layout SGML Unix command line tutorial \layout SGML \noindent Unix tools tutorial \layout SGML \noindent Unix tools reference \layout SGML \noindent Unix tool \layout SGML \layout SGML \begin_inset Note collapsed true \layout Section Stuff to be added before 1.0 \layout Standard watch execute commands repeatably. - more of a programmers tool, not added for 1.0!!!! \layout Section Standards within the document \layout Enumerate All single key presses are surrounded with square brackets, eg. [TAB] \layout Enumerate Using multiple keys is used with a dash eg. CTRL-ALT-DEL \layout Enumerate The first word after the description is always capitalized. \layout Enumerate First word of a footnote is always capitalized. \layout Enumerate All commands/tools are in italic (emphaized) excluding the bolded part (ie. first part of description) \layout Enumerate Anything that is the name of something, maybe an example use single quotes 'directory' \layout Enumerate Command syntax should be replaced by useful examples when possible. \layout Enumerate Most symbols are written literally as well as having the symbol there eg. $ (dollars sign) \layout Enumerate Avoid uppercase excluding GNU and UNIX (legally it must be UNIX system) \layout Enumerate When using a command prompt: eg. \series bold [root@hp166 tmp]# \series default make the command prompt part bold and don't make the command part not bold (I don't think I have any of these left anyway). \layout Enumerate Footnotes cannot be on sections/subsections/etc. because they appear in the index like that (ie. including the footnote). \layout Enumerate When listing options to a command use option --- description (standard within this guide) \layout Enumerate The first word after a description should be capitalized (unless its a command name). \layout Enumerate Only use descriptions when describing something. Because script picks up everything that is a description environment. \layout Enumerate Always have the command syntax, example or simply type on a new line. \layout Enumerate The first sentence after a description type should only contain information on the command. \layout Enumerate Use admonitions wherever possible. \layout Enumerate Sections are in uppercase (labels) and any other labels in lower case. \layout Enumerate Use more than just \begin_inset Quotes eld \end_inset note \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset tip \begin_inset Quotes erd \end_inset for notes/tips/warnings. Put something useful there! \layout Section Problems: \layout Standard od makes no sense \layout Standard neither does tsort. or dc/bc \layout Standard this is becoming huge ~>18K Hopefully its high quality content and not bloat. \layout Standard Should 1 and any other small number < 10 be replaced with words? ie. \begin_inset Quotes eld \end_inset one \begin_inset Quotes erd \end_inset . Because it can be considered unprofessional\SpecialChar \ldots{} only replaced some numbers with words --done mostly \layout Standard quotes ' ' and ( ) brackets are used to show particular symbols, should probably be one or the other and not both, oh and theres still some mix between double and single quotes double quotes are now used most of the time. \layout Standard Decided later to decrease the amount of content significantly. \layout Section LyX to DocBook conversion issues \layout Standard Don't put index entries before the end of a word, because they'll add spaces inbetween\SpecialChar \ldots{} \layout Standard Mr Anderson: will cause problems... \layout Standard Anything that has embedded code-style and then standard text underneath also embedded will be considered a footnote....but if it has standard text on-top embedded and code underneath and more text underneath the code (all on same level) it will not be a footnote....(I think...)\SpecialChar \ldots{} either that or a weird problem with lyx occured. \layout Standard If you use SGML than anything within that must also be SGML, so don't use
. because every subsection under that quoted would need to be in pure sgml\SpecialChar \ldots{} \layout Standard Use notes and not comment-style because when converted comment style sometimes is left in the document and sometimes its not, notes are never exported from the document (ie never use comments within this doc!). \layout Standard Be careful when changing labels, the labels of sections are what the html files are named, if they are changed then the name of the html file changes causing a 3month wait for the document to be reindexed with major search engines (well about 3 months for google anyway!)\SpecialChar \ldots{} \layout Standard You were missing quite a few and 's. You must understand that in SGML, just pressing will NOT create a new paragraph (as in HTML too, which is an SGML language). pairs are your friend. I inserted them whenever I saw them missing, but I am sure there are more cases that I missed. \layout Standard Index-command then label is WRONG (at least for now). Label and then Index-command is O.K. I removed some Idx from the titles for this reason. Either put Idx after the label (not before), or (better) avoid it in the titles alltogether. \layout Standard NEVER use spaces or other bad characters (eg. '(' and ')' in labels. just use - to seperate things. \layout Section Lists of things to be added: \layout Standard add patch before next release. \layout Standard add the h* utilities....for working with macintosh disks \layout Subsection add how to create filesystems? add mkfs -c to check for bad blocks \layout Standard A command, called superformat, from the fdutils package [You may have to find this pac kage on the Internet. See Chapter 24 for how to compile and install source packages.] formats a floppy in any way that you like. A more common (but less thorough) command is fdformat from the util-linux package. It verifies that each track is working properl y and compensates for variations between the mechanics of different floppy drives. To format a 3.5-inch 1440-KB, 1680-KB, or 1920-KB floppy, respectively, run: \layout Standard 5 cd /dev ./MAKEDEV -v fd0 superformat /dev/fd0H1440 superformat /dev/fd0H1690 superformat /dev/fd0H1920 \layout Standard and fdformat \layout Standard --where is this from probably rute users guide and tutorial . \layout Subsection diffing and patching --theres probably better tutorials already online \layout Standard The diff utility dumps the lines that differ between two files. It can be used as follows: diff -u \layout Standard You can also use diff to see difference between two directory trees. diff recursively compares all corresponding files: diff -u --recursive --new-file > .diff \layout Standard The output is known as a patch file against a directory tree, that can be used both to see changes, and to bring up to date with . \layout Standard Patch files may also end in .patch and are often gzipped. The patch file can be applied to with \layout Standard cd patch -p1 -s < .diff \layout Standard which makes identical to . The -p1 option strips the leading direct ory name from the patch file. The presence of a leading directory name in the patch file often confuses the patch command. \layout Section Other issues \layout Standard snice/skill are very similar to renice and kill (with the correct option), they perform the same task except one was based on bsd and the other relates to /proc/. Don't they perform exactly the same thing (nearly)\SpecialChar \ldots{} ?. Most procps utilities are the same (which is good\SpecialChar \ldots{} but they are very similar to existing utilities). \layout Standard lpr and lp are historically from BSD based and SysV based Unix systems, they appear to do the same thing in different ways if you are using CUPS they do exactly the same thing. \layout Standard Changed all references exlcuding UNIX tools philosophy to UNIX system from Unix (its doesn't look as good but it should be legal now). Also changed UNIX-like to UNIX system-based (to make it legal) \layout Section List of removed tools (or not added): \layout Standard There are various stuff now under each subsection now \layout Subsection Possibly useful \layout Standard gpasswd This command allows the administration of the /etc/group file. \layout Standard You can use this command to add administrators to a particular group, these admins can then add or remove users. \layout Standard gpasswd group_name -A list_of_users \layout Standard Using "env" page 13 of 13 \layout Standard Unfortunately, if you forget to set PAGER back to less, man (as well as some other commands) will continue to display all their text without stopping. If you wanted to have PAGER set to cat just once, you could use the env command: \layout Standard $ PAGER=less $ env PAGER=cat man man $ echo $PAGER less \layout Standard This time, PAGER was exported to man with a value of cat, but the PAGER variable itself remained unchanged in the bash session. likely to be useful \layout Standard retry bc and dc --maybe not I won't get the time. \layout Description zgv \begin_inset Note collapsed false \layout Standard probably overkill for the command-line interface. But i'll leave it anyway (for now) --removed \end_inset \emph on zgv \emph default is a graphical vga/svga based program used to view images from the console. \emph on zgv \emph default is very easy to use, simply run the program and then use [Enter] and[ESC to view and then stop viewing pictures. The file selector is a GUI so there are no commands involved there. \layout Standard To run \emph on zgv \emph default simply type: \layout Code zgv \begin_deeper \layout Standard Note that you can obtain \emph on zgv \emph default from \begin_inset LatexCommand \url[the zgv homepage]{http://www.svgalib.org/rus/zgv/ } \end_inset , note that you will also need the svgalib libraries to run \emph on zgv \emph default . \end_deeper \layout Subsection Unlikely to be useful \layout Standard and possibly add sed and awk as major programming languages --decided against, too complicated plus the fact that it broadens the scope of the document way too much \layout Standard add pushd / popd? -- overkill. Useful for some but not many (?) \layout Standard possibly a cd recording section. --maybe not\SpecialChar \ldots{} that just gets too complex and a lot of them exist already. \layout Standard ctrlaltdel -- do many people want a hard reset? not added\SpecialChar \ldots{} \layout Standard strings -- more of a programmers tool. I don't see it as useful\SpecialChar \ldots{} \layout Standard lsof has not being added, very advanced usage and not very useful to average user. \layout Standard --ddate --just plain weird -- not useful, not added \layout Standard fgconsole -- sort of useless.... \layout Standard export --bash internal stuff and various other bash internal stuff. \layout Standard install -- no reason really, this is a users guide more than a programmers guide. \layout Standard diction not accurate enough\SpecialChar \ldots{} \layout Description diction \begin_deeper \layout Standard Notes: this tool is now quite vulnerable and is considered to be of little use. Diction looks for commonly misused phrases in sentences. it's a sort of grammar checker, although it usually compares something to a dictionary of misused phrases and other \begin_inset Quotes eld \end_inset bad \begin_inset Quotes erd \end_inset diction. it's quite a basic grammar checker though and is now considered \begin_inset Quotes eld \end_inset vulnerable \begin_inset Quotes erd \end_inset compared to more modern grammar checkers (such as those in Microsoft word). Command syntax: \layout Code diction file.txt \end_deeper \layout Standard nslookup (now redundant) \layout Standard all old r* commands \layout Standard anagram a command that looks for 'anagrams'. An anagram is a word or phrase whose characters consist entirely of all the characters of a given word or phrase -- for example, `stop' and `tops' are both anagrams of `pots'. -- was direct from cookbook anyway \layout Standard sview streaming text viewer, can be used to stream text, ie. read 1 word at a time at a very fast pace (so it's easier and quicker to read). Note this is a graphical program, requires X. --great program from cookbook but requires X! \layout Standard ldd list library dependencies (list shared library dependencies). A more advanced command. -- not really useful to average user. more of a programmers thing. \layout Standard spell \shape italic \shape default (spell checker), use spell then the word, or spell than document. --this was simply calling ispell -i anyway, not very useful \layout Standard aview -- ascii image viewer not very useful why not use X? \layout Standard sed -e 's/ \backslash .pcx$/.png/'`" and possibly add sed and awk as major programming languages --decided against, too complicated plus the fact that it broadens the scope of the document way too much \layout Standard pr \emph on pr \emph default formats text files for printing. It adds a header and page number to the text file and can print documents in columns. \layout Standard Use the \emph on -t \emph default option to avoid the printing of the header and footer on each page. \layout Standard \emph on pr \emph default takes a variety of options, read the man and info page for further information. \begin_inset Note collapsed false \layout Standard not so sure about these commands (both above and below). I have little experience in Linux Printing. \end_inset \layout Subsection KDE-shortcut\SpecialChar ~ Keys -- this was copyright lockergnome anyway \layout Standard \series default respectively match the empty string at the beginning and end of a word. \layout Standard \series bold \backslash ? \series default The preceding item is optional and matched at most once. \layout Standard \series bold \backslash * \series default The preceding item will be matched zero or more times. \layout Standard \series bold \backslash + \series default The preceding item will be matched one or more times. \layout Standard \series bold \backslash {n} \series default The preceding item is matched exactly n times. \layout Standard \series bold \backslash {n,} \series default The preceding item is matched n or more times. \layout Standard \series bold \backslash {n,m} \series default The preceding item is matched at least n times, but not more than m times. \layout Standard Note I now find the above useful, but thats in regular expression matching when making parsers and stuff like that\SpecialChar \ldots{} \layout Description ins (insert) will read lines of text from the standard input and insert them at the beginning of the file. \begin_inset Note collapsed false \layout Standard need more info on this too. Only useful in scripts...? --was removed because of an overcrowded tools section. Not really that useful... \end_inset \layout Standard You can also use \emph on ins \emph default like this: \layout Code ins < from_file some_file.txt \begin_deeper \layout Standard This would have the text from \begin_inset Quotes eld \end_inset from_file \begin_inset Quotes erd \end_inset added to \begin_inset Quotes eld \end_inset some_file.txt \begin_inset Quotes erd \end_inset . \layout Standard \emph on ins \emph default is a utility created by the author of the \begin_inset Quotes eld \end_inset Linux Cookbook \begin_inset Quotes erd \end_inset please go \begin_inset LatexCommand \url[here]{http://addressFIXEMEfixme} \end_inset to get \emph on ins. \end_deeper \layout Standard adding sed and awk as major programming languages (or any other kind of programming language) has been decided against\SpecialChar \ldots{} \layout Description dircmp Compares directories and outputs a list of different files. \begin_inset Note collapsed false \layout Standard this tool was superceeded when diff learnt how to compare directories AFAIK \end_inset \layout Description banner Sends a large, vertical "banner" of the message to the standard output. \begin_deeper \layout Standard \noindent Simply type: \layout Code banner \begin_inset Quotes eld \end_inset message to be written \begin_inset Quotes erd \end_inset \begin_inset Note collapsed false \layout Standard pretty useless so it was removed \end_inset \end_deeper \layout Description znew Recompress a .Z (traditional Unix zip) file into a .gz (gzip) file. Command syntax: \begin_deeper \layout Code znew filename.Z \begin_inset Note collapsed false \layout Standard note used often enough \end_inset \end_deeper \layout Subsection Stopping and Starting Daemons \begin_inset Note collapsed false \layout Standard section replaced elsewhere \end_inset \layout Standard A daemon is system program that runs in the background (with zero interaction and is usually independent of user/terminal), these processes usually perform critical functions such as control swap space, manage incoming connections and do various other tasks. Each of these daemons has a script under /etc/rc.d/init.d/ directory written to accept an argument, which can be (usually) \series bold start \series default , \series bold stop \series default and \series bold restart. \series default You can execute those scripts by hand in fact with a command, you simply run the program name (./program) and then put start stop or restart there, e.g.: \layout Code \series bold [root@hp166 init.d]# \series default ./keytable restart \layout Description nstat This command displays the values of a few dozen statistics relating to network activity that are maintained inside the kernel. Note: this program uses the /proc/snmp files. If you don't have an SNMP daemon installed then this tool won't be installed either. \layout Description The\SpecialChar ~ GNU\SpecialChar ~ Miscfiles \begin_inset Foot collapsed true \layout Standard This information information comes from the Linux Cookbook (without editing). See [3] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset \begin_inset Note collapsed false \layout Standard is this of any use to anyone? \layout Standard possibly remove it\SpecialChar \ldots{} \end_inset Are a collection of text files containing various facts and reference material, such as common abbreviations, telephone area codes, and English connective phrases. The files are stored in the `/usr/share/misc' directory, and they are all compressed; use \emph on zless \emph default to pursue them or any other \emph on z \emph default tool ( \emph on zcat, zmore) \emph default . \layout Standard \begin_inset LatexCommand \url[GNU Miscfiles Homepage]{http://www.gnu.org/directory/misc/miscfiles.html} \end_inset and the \begin_inset LatexCommand \url[GNU Miscfiles Download Site]{http://ftp.gnu.org/gnu/miscfiles/} \end_inset \layout Standard Audio Tools \begin_inset LatexCommand \label{Audio-Tools} \end_inset \layout Standard very, very incomplete. Will this improve the guide or add bloat? Hopefully people will contribute and make this section useful\SpecialChar \ldots{} (or ill strip it). Completely stripped, lack of info and did not really add much to the guide (besides bloating it). Some useful info about sox though\SpecialChar \ldots{} \layout Description mpg123 \begin_inset Note collapsed false \layout Standard there is also an mpg321 probably some competitor\SpecialChar \ldots{} , maybe don't add either?... \end_inset Used to play MPEG layers 1, 2 and 3 audio. Ie. an mp3 player. \layout Standard Useful options: \emph on --test \emph default (test mode) audio is decoded but not actually outputted to audio device, \emph on --resync \emph default will attempt to continue playing an audio file even if it's damaged (there may be loud clicks or pops so dont turn the volume up). Refer to the manual page for detailed information. \layout Standard Basic syntax: \layout Code mpg123 audio_file.mp3 \layout Code \layout SGML Please note \layout SGML \layout SGML Please note that information on mp3 players, encoders or decoders are not included in this section because there are many articles on these subjects on the internet already. \layout SGML \layout SGML \layout Description play \emph on play \emph default is a frontend to \emph on sox \emph default which should be able to play any sound file. (For the effects that you can apply please see the manual page). Useful options: \emph on --device=/dev/xxx specifies \emph default which device to play to, \emph on --volume=xx \emph default change the volume of the file being played. \begin_deeper \layout Standard General syntax: \layout Code play fileName \end_deeper \layout Description rec \emph on record \emph default follows the same syntax as above (it's documented in the same manual page too!). \begin_deeper \layout Standard For normal use simply type: \layout Code rec fileName \end_deeper \layout Description sox ( \begin_inset Quotes eld \end_inset sound eXchange: universal sound sample translator \begin_inset Quotes erd \end_inset ) \emph on sox \emph default is part of a group of very powerful command-line based audio tools which can be used to translate sound files into different types as well as performing various mixing effects on them. It can be considered the audio equivalent of \emph on convert \emph default . \begin_deeper \layout Standard For the most simple usage you may like to try: \layout Code sox soundfile.wav outputfile.ogg \layout Standard where the first extension (.wav) is the type of the input file and the second extension (.ogg) in the type of the output file. \layout Standard \emph on sox \emph default has hundreds of command-line options, you'll need to refer to the manual for details. \end_deeper \layout Description aumix Used to control the audio mixer settings. Use the -v x (where x is a number between 1 and 100) option to change the main volume. Use the \emph on -q \emph default option to list the current settings for everything. \begin_deeper \layout Standard Example: \layout Code aumix -v 100 -q \layout Standard This will change the volume to 100% then print the current settings. \end_deeper \layout Standard Not really command related and everyone can read this elsewhere :P \layout Subsection Drive Letter Labelling (/dev/hd*) \begin_inset LatexCommand \label{drive-letter-labeling} \end_inset \begin_inset Note collapsed false \layout Standard [4] -- too small to be referenced and it's used everywhere anyway --rewritten a little \layout Standard Could be considered common knowledge and removed\SpecialChar \ldots{} \end_inset \begin_inset LatexCommand \label{drive-letter-organisation} \end_inset \layout Standard For IDE drives (normally used in end-user systems) GNU/Linux uses the following naming convention. Starting with /dev/hda as the first one. \layout Itemize a --- first IDE controller set in master mode \layout Itemize b --- first IDE controller set in slave mode \layout Itemize c --- second IDE controller set in master mode \layout Itemize d --- second IDE controller set in slave mode \layout Standard \noindent If you have a third and/or fourth controller, simply continue assigning letters in alphabetical order, going from controller to controller, and master to slave. \layout Subsection Kernel\SpecialChar ~ Modules \begin_inset LatexCommand \label{kernel-modules} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard this section needs revision or removal. -- revised and hopefully more useful now\SpecialChar \ldots{} \layout Standard I know nearly nothing about dealing with kernel modules...does anyone has suggestio ns? \layout Standard this section is a candidate for removal\SpecialChar \ldots{} \end_inset \layout Standard These tools are used to work with kernel modules. Normally hardware is auto-detected and the relevant module(s) (equivalent to a device driver in windows) are loaded into the kernel so the hardware can communicate with the operating system. These tools are helpful if you ever need to manually load modules into the kernel, remove them or find more information about them. \layout Description \noindent lsmod List currently loaded kernel modules (uses /proc/modules). You could always just do \emph on cat /proc/modules. \emph default (or use \emph on less \emph default or \emph on more \emph default or other tools\SpecialChar \ldots{} ) \layout Description lspci (or lscpidrake on Mandrake systems) is used to list various hardware devices (connected via pci) and the modules they use (if known). \begin_deeper \layout Standard Use the \emph on -v \emph default option for more detailed information. Note this uses the /proc/pci information. \end_deeper \layout Description \noindent modprobe \emph on modprobe \emph default is used to insert a module into a running kernel. \begin_deeper \layout Standard \noindent \emph on modprobe \emph default is usually used instead of \emph on insmod \emph default , \emph on modprobe \emph default looks up it's configuration files to work out which particular module you wanted (ie. you don't need to type the full path) and automatically resolves any dependenci es of the particular module. \emph on modprobe \emph default will call \emph on insmod \emph default with the full path name and options. \layout Standard For example: \layout Code modprobe sb \layout Standard This will load the sound-blaster (sb) module into the current running kernel. \layout SGML \layout SGML modprobe \layout SGML \layout SGML The \emph on modprobe \emph default command works with the configuration file /etc/modules.conf you can modify this configuration file to get \emph on modprobe \emph default to run certain scripts before or after inserting a module into the kernel. \layout SGML \layout SGML \end_deeper \layout Description \noindent \begin_inset Note collapsed false \layout Standard don't think its useful anymore, I mean its easier just to use modprobe... \layout Standard insmod (as root) insert modules into the kernel (a module is roughly an equivalent of a DOS device driver). \emph on modprobe \emph default is usually used instead of \emph on insmod \emph default because \emph on insmod \emph default needs a full path to the module and cannot resolve dependencies. \layout Standard \noindent Command syntax: \layout Code \noindent insmod module_name \layout Code \end_inset \layout Description \noindent rmmod \emph on rmmod \emph default is used to remove a module from a running kernel, you may like to use \emph on lsmod \emph default to find out which module to remove. \begin_deeper \layout Standard \noindent Command syntax: \layout Code rmmod module_name \end_deeper \layout Description \noindent modinfo \emph on modinfo \emph default is used to learn more information about a particular module. \begin_deeper \layout Standard \noindent Example: \layout Code modinfo ext3 \layout Standard This will display information about the module named \begin_inset Quotes eld \end_inset ext3 \begin_inset Quotes erd \end_inset if it is installed. \end_deeper \layout Description depmod \emph on depmod \emph default is used to update the module dependency information used by modprobe. If you add or remove new modules you may need to run \emph on depmod \emph default again to update the dependency information. The normal usage of depmod is: \begin_deeper \layout Code depmod -a \layout Standard The 'a' is optional and you no longer need to put it there. \layout Standard \begin_inset Note collapsed true \layout Standard find out info about using kernel 2.6 and depmod --seems to be ok you just don't use make dep. \end_inset \end_deeper \layout Standard Decided to be not useful enough \layout Subsection Recovering from a system freeze \begin_inset LatexCommand \label{system-freeze} \end_inset \layout Standard This information (in this section) has been taken from the Mandrakesoft Starter Guide, with no editing, anything that is quoted has been used from the Mandrakesoft Starter Guide, see [8] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \layout Standard If your system is completely frozen, ie. you can't kill processes or something quite severe has happened you may find the following procedure useful to follow: \layout Standard \begin_inset Quotes eld \end_inset \SpecialChar \ldots{} the "SysRq" ("System Request") sequence. The "SysRq" sequence involves pressing three keys at once, the left ALT key, the SysRq key (labeled PrintScreen on older keyboards) and a letter key. \layout Itemize ALT-SysRq-R this puts the keyboard in "raw" mode. Now try pressing ALT-CTRL-Backspace again to kill X. If that does not work, carry on. \layout Itemize ALT-SysRq-S this attempts to write all unsaved data to disk ("sync" the disk). \layout Itemize ALT-SysRq-E this sends a termination signal to all processes, except for init. \layout Itemize ALT-SysRq-I this sends a kill signal to all processes, except for init. \layout Itemize ALT-SysRq-U this attempts to re-mount all mounted filesystems read-only. This removes the "dirty flag" and will avoid a file system check upon reboot. \layout Itemize ALT-SysRq-B this reboots the system. You might just as well press the "reset" button on your machine. \begin_inset Quotes erd \end_inset \layout SGML \layout SGML This is a sequence \layout SGML \layout SGML "Remember that this is a sequence, i.e. you have to press one combination after the other in the right order: \layout SGML \layout SGML \layout SGML Raw, Sync, tErm, kIll, Umount, reBoot. Read the kernel documentation for more information on this feature." \layout SGML \layout SGML \layout SGML \layout SGML An easy way to remember this: \layout SGML \layout SGML "There is a mnemonic phrase that makes this easier to remember: "Raising Skinny Elephants Is Utterly Boring"" \layout SGML \layout SGML \layout Standard This is usually done by the distro \layout Description symlinks\SpecialChar ~ -r\SpecialChar ~ -cds\SpecialChar ~ / (as root) Check and fix the symbolic links on the system. The various options stand for recursive (recurse through the file system), convert absolute links to relative links (always a good idea), remove \begin_inset Quotes eld \end_inset dangling \begin_inset Quotes erd \end_inset links (links that point to a non-existent file) and detect lengthy links, the last symbol (the slash) stands for start at the top of the filesystem. \layout Chapter Printing \begin_inset LatexCommand \label{Printing} \end_inset \layout Standard The printing chapter only lists the most basic of printing commands. On most modern GNU/Linux system you will find the CUPS printing system, the below commands are the more traditional ones for doing printing\SpecialChar \ldots{} \layout Description lpr Print something, you can either use it as \emph on lpr file \emph default or you can have \emph on lpr \emph default print something you input (type or redirect using <). Obviously you can only print certain types of files, such as text files, most programs do convert the file to postscript first to the printer-daemon can send it. Also try \emph on lp \emph default . \begin_deeper \layout Standard To print a file simply type: \layout Code lpr file_name \end_deeper \layout Description lpq Displays information on printer queue, including the job numbers of print jobs. Job numbers are required if you only want to remove a particular job using \emph on lrpm. \emph default Use \emph on lpq -a \emph default to list jobs on all printers. \begin_deeper \layout Standard Example: \layout Code lpq \layout Standard This would list jobs and status on the default printer \end_deeper \layout Description lprm Which removes the whole line printer queue. To be selective about it and only delete one of the files you will need to give \emph on lprm \emph default a job number. \begin_deeper \layout Standard For example: \layout Code lprm job_no \end_deeper \layout Description mpage \emph on mpage \emph default is used to print multiple pages onto a single page when printing. Use the numbers 1, 2, 4 or 8 as arguments to fit between one and eight normal pages onto a single printed page. Use \emph on mpage \emph default with the \emph on -x \emph default option to list various commmand-line options for \emph on mpage \emph default . \begin_deeper \layout Standard Example: \layout Code mpage 2 file.txt \layout Standard This will print two pages of \begin_inset Quotes eld \end_inset file.txt \begin_inset Quotes erd \end_inset per normal page of printing. \end_deeper \layout Standard \begin_inset Note collapsed false \layout Standard mpage - candidate for removal \layout Standard lpstat no longer exists on Mandriva '06 \layout Description lpstat Query the status of the printer. Has many different options, use \emph on lpstat -d \emph default to find the default printer and \emph on lpstat -v \emph default to display information on the connected printers. \layout Standard Example: \layout Code lpstat -d \begin_deeper \layout Standard Would display the status of the printers connected locally to the machine. \end_inset \end_inset \layout Abstract This document is an attempt to provide a summary of useful command-line tools available to a GNU/Linux based operating system, the tools listed are designed to benefit the majority of users and have being chosen at the authors discretion. This document is not a comprehensive list of \emph on every \emph default existent tool available to a GNU/Linux based system, nor does it have in-depth explanations of how things work. It is a summary which can be used to learn about and how to use many of the tools available to a GNU/Linux based operating system. \layout SGML \layout SGML \layout SGML 1.2 \layout SGML 15th April 2006 \layout SGML GA \layout SGML \layout SGML Corrected typing errors, generated new, much smaller index (more accurate in my opinion). Updated errors in document for TLDP. \layout SGML \layout SGML \layout SGML \layout SGML 1.1 \layout SGML 28th February 2006 \layout SGML CK \layout SGML \layout SGML Corrected typos, generated new index (9000 index entries!). \layout SGML \layout SGML \layout SGML \layout SGML 1.0 \layout SGML 6th February 2006 \layout SGML GA \layout SGML \layout SGML Major restructuring, now in a docbook book format. Removed large chunks of content and revised other parts (removed chapters and sectioned some areas more). This is likely the final release by the author, I hope that someone finds this guide useful as I do not intend to continue work on this guide. \layout SGML \layout SGML \layout SGML \layout SGML 0.7.1 \layout SGML 25th February 2005 \layout SGML CK \layout SGML \layout SGML Set special characters in math mode, produced PDF and PS with Computer Modern fonts in OT1 encoding and created correct SGML for key combinations. \layout SGML \layout SGML \layout SGML \layout SGML 0.7 \layout SGML 5th December 2004 \layout SGML GA \layout SGML \layout SGML Updated document with new grammatical review. Re-ordered the entire Text section. Removed a fair amount of content. \layout SGML \layout SGML \layout SGML \layout SGML v0.6 \layout SGML 20th April 2004 \layout SGML GA \layout SGML \layout SGML Attempted to fix document according to TLDP criticisms. Added notes and tips more sectioning. Now complying to the open group standards for the UNIX system trademark. Document should be ready for TLDP site. \layout SGML \layout SGML \layout SGML \layout SGML v0.5 \layout SGML 6th October 2003 \layout SGML GA \layout SGML \layout SGML Fixed a variety of errors as according to the review and made some consistency improvements to the document. \layout SGML \layout SGML \layout SGML \layout SGML v0.4 \layout SGML 15th July 2003 \layout SGML GA \layout SGML \layout SGML Made small improvements to the document as suggested (so far) by the thorough TLDP review, improved consistency of document and made small content additions. \layout SGML \layout SGML \layout SGML \layout SGML v0.3 \layout SGML 26th June 2003 \layout SGML GA \layout SGML \layout SGML Minor errors fixed, updated the appendix with information for finding where a tool is from. Fixed referencing/citation problems and improved further reading and intro sections, added an audio section. \layout SGML \layout SGML \layout SGML \layout SGML v0.2 \layout SGML 20th April 2003 \layout SGML GA \layout SGML \layout SGML This is the initial public release. Added more code-style then before, broke text-section into more subsections. Improved consistency of document and fixed various index entries. \layout SGML \layout SGML \layout SGML \layout SGML v0.1 \layout SGML 27th March 2003 \layout SGML GA \layout SGML \layout SGML This is the initial draft release (the first release to be converted from LyX to DocBook SGML). \layout SGML \layout SGML \layout SGML \layout Chapter Introduction \begin_inset LatexCommand \label{Introduction} \end_inset \layout Standard This document is an attempt to summarise \begin_inset LatexCommand \index{summarise} \end_inset the many command-line based \begin_inset LatexCommand \index{command-line-based} \end_inset tools available to a GNU/Linux based operating system. This guide \begin_inset LatexCommand \index{guide} \end_inset is not a complete listing (I doubt it's possible to document \begin_inset LatexCommand \index{document} \end_inset all available programs), this document lists many tools which are available to GNU/Linux systems and which are, or can be useful to the majority \begin_inset LatexCommand \index{majority} \end_inset of users. \layout Standard Each tool description \begin_inset LatexCommand \index{description} \end_inset provides a quick overview of it's function \begin_inset LatexCommand \index{function} \end_inset and some useful options \begin_inset LatexCommand \index{options} \end_inset for that individual tool. \layout Standard The tools listed \begin_inset LatexCommand \index{listed} \end_inset that require a GUI, \begin_inset LatexCommand \index{GUI} \end_inset usually the X windowing \begin_inset LatexCommand \index{X windowing} \end_inset system, are those listed in the Graphics \begin_inset LatexCommand \index{Graphics} \end_inset Tools section. All other tools are completely command-line-based \begin_inset LatexCommand \index{command-line-based} \end_inset and do not require a GUI \begin_inset LatexCommand \index{GUI} \end_inset to run. \layout Standard If you are looking \begin_inset LatexCommand \index{looking} \end_inset for information on GUI \begin_inset LatexCommand \index{GUI} \end_inset based tools you will need to look elsewhere. \layout Standard Also note that a few of the tools in this guide are bash \begin_inset LatexCommand \index{bash} \end_inset (the Bourne-Again-SHell \begin_inset LatexCommand \index{Bourne-Again-SHell} \end_inset ) specific, tools specific \begin_inset LatexCommand \index{specific} \end_inset to other shells \begin_inset LatexCommand \index{shells} \end_inset are not listed in this document. \layout Standard For some of the tools that are harder to use, or perform a more complex \begin_inset LatexCommand \index{complex} \end_inset task, \begin_inset LatexCommand \index{task} \end_inset there are several mini-tutorials \begin_inset LatexCommand \index{mini-tutorials} \end_inset (or mini-guides; \begin_inset LatexCommand \index{mini-guides} \end_inset \begin_inset LatexCommand \ref{Mini-guides} \end_inset ) within this document. \layout Standard Where a mini-guide \begin_inset LatexCommand \index{mini-guide} \end_inset was considered unncessary, detailed descriptions that explain in detail how a particular tool works, and some examples \begin_inset LatexCommand \index{examples} \end_inset of how to use it are provided. \begin_inset LatexCommand \index{provided} \end_inset \layout Standard Please note that the word \begin_inset Quotes eld \end_inset tool \begin_inset Quotes erd \end_inset is used interchangeably \begin_inset LatexCommand \index{interchangeably} \end_inset with the word \begin_inset Quotes eld \end_inset command \begin_inset Quotes erd \end_inset , both have the same meaning (at least in this guide). For a more detailed \begin_inset LatexCommand \index{detailed} \end_inset explanation, read about the UNIX Tools Philosophy \begin_inset LatexCommand \index{UNIX Tools Philosophy} \end_inset here: \begin_inset LatexCommand \ref{The-UNIX-Tools-Philosophy} \end_inset or visit the links in the appendix, \begin_inset LatexCommand \index{appendix} \end_inset \begin_inset LatexCommand \ref{unix-tools-further-reading} \end_inset . \begin_inset LatexCommand \index{enable} \end_inset \layout SGML \layout SGML To find out which tools are bash specific \layout SGML To find out which tools are bash specific you can type: \layout SGML enable -a \layout SGML \layout SGML \layout Section Formats \begin_inset LatexCommand \label{formats} \end_inset \layout Standard This document is available in the following formats: \begin_inset LatexCommand \index{formats} \end_inset \layout Itemize \begin_inset LatexCommand \url[HTML (HyperText Markup Language)]{./book1.html} \end_inset , many HTML \begin_inset LatexCommand \index{HTML} \end_inset files, one per section, for viewing with \begin_inset LatexCommand \url[any browser]{http://www.anybrowser.org/campaign/} \end_inset \begin_inset LatexCommand \index{any browser} \end_inset \layout Itemize \begin_inset LatexCommand \url[HTML (HyperText Markup Language)]{./gnu-linux-tools-summary.html} \end_inset , one big HTML \begin_inset LatexCommand \index{HTML} \end_inset file \layout Itemize \begin_inset LatexCommand \url[TXT (ASCII Text)]{./gnu-linux-tools-summary.txt} \end_inset \begin_inset LatexCommand \index{ASCII Text} \end_inset \begin_inset LatexCommand \index{Text} \end_inset \layout Itemize \begin_inset LatexCommand \url[RTF (Rich Text Format)]{./gnu-linux-tools-summary.rtf} \end_inset \begin_inset LatexCommand \index{Rich Text Format} \end_inset \begin_inset LatexCommand \index{RTF} \end_inset \layout Itemize \begin_inset LatexCommand \url[PDF (Portable Document Format)]{./gnu-linux-tools-summary.pdf} \end_inset \begin_inset LatexCommand \index{Portable Document Format} \end_inset \begin_inset LatexCommand \index{PDF} \end_inset \layout Itemize \begin_inset LatexCommand \url[PS.GZ (Compressed Postscript)]{./gnu-linux-tools-summary.ps.gz} \end_inset \begin_inset LatexCommand \index{Postscript} \end_inset \begin_inset LatexCommand \index{PS} \end_inset \layout Itemize \begin_inset LatexCommand \url[SGML (Standard Generalized Markup Language)]{./gnu-linux-tools-summary.sgml} \end_inset \begin_inset LatexCommand \index{Standard Generalized Markup Language} \end_inset \begin_inset LatexCommand \index{SGML} \end_inset (with the \begin_inset LatexCommand \url[Appendix]{appendix.sgml} \end_inset \begin_inset LatexCommand \index{Appendix} \end_inset and the \begin_inset LatexCommand \url[Bibliography]{bibliography.sgml} \end_inset \begin_inset LatexCommand \index{Bibliography} \end_inset ) \layout Itemize \begin_inset LatexCommand \url[LYX (LaTeX frontend LyX)]{./gnu-linux-tools-summary.lyx} \end_inset \begin_inset LatexCommand \index{LyX} \end_inset (with the \begin_inset LatexCommand \url[Appendix]{appendix.lyx} \end_inset and the \begin_inset LatexCommand \url[Bibliography]{bibliography.lyx} \end_inset ) \layout SGML \layout SGML RTF: Page numbers \begin_inset LatexCommand \index{RTF page numbers} \end_inset \layout SGML In order to get correct page numbers \begin_inset LatexCommand \index{correct page numbers} \end_inset (and often to get the images working) in Microsoft Word \begin_inset LatexCommand \index{Microsoft Word} \end_inset , type the following after opening the document: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML CTRL \layout SGML END \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML CTRL \layout SGML A \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML F9 \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML In Word Viewer 97, you must instead do: \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML CTRL \layout SGML END \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ALT \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML V \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML N \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML ALT \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML V \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML P \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML See The OpenJade RTF backend for more details. \layout SGML \layout SGML \layout SGML Important: Downloads for offline reading! \layout SGML \layout SGML If you want to download the HTML or RTF formats for offline reading, you will need to download the images as well - PNG for HTML and BMP for RTF, including the callouts! To save you the hassle, I have compiled the following gzipped tar archives for offline reading: \layout SGML \layout SGML \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), many HTML files with images]{./gnu-linux-tools-summary-html.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), one big HTML file with images]{./gnu-linux-tools-summary-onehtml.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), SGML file with images]{./gnu-linux-tools-summary-sgml.tar.gz} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), RTF file with images]{./gnu-linux-tools-summary-rtf.tar.gz} \end_inset \layout Standard A tarball \begin_inset LatexCommand \index{tarball} \end_inset containing all the above is also available: \begin_inset LatexCommand \index{available} \end_inset \layout Itemize \begin_inset LatexCommand \url[ TAR.GZ (Compressed TAR Archive), All files]{./gnu-linux-tools-summary.tar.gz} \end_inset \layout Section Who would want to read this guide? \begin_inset LatexCommand \label{who-would-want-to-read-this-guide} \end_inset \layout Standard Anyone who is interested in learning \begin_inset LatexCommand \index{learning} \end_inset about the tools (also known as commands) available to them when using their GNU/Linux based operating system. \layout Standard Why would you want to learn \begin_inset LatexCommand \index{learn} \end_inset how to use the command-line \begin_inset LatexCommand \index{command-line} \end_inset (and available tools)? The \series bold \emph on C \emph default ommand \emph on L \emph default ine \emph on -I \emph default nterface \series default (CLI) \begin_inset LatexCommand \index{CLI} \end_inset \begin_inset LatexCommand \index{command line-interface} \end_inset , while difficult to learn, is the quickest \begin_inset LatexCommand \index{quickest} \end_inset and most efficient \begin_inset LatexCommand \index{efficient} \end_inset way to use a computer for many different tasks. The CLI \begin_inset LatexCommand \index{CLI} \end_inset is the normal method of use for most UNIX \begin_inset LatexCommand \index{UNIX system} \end_inset system administrators, \begin_inset LatexCommand \index{administrators} \end_inset programmers \begin_inset LatexCommand \index{programmers} \end_inset and some power users \begin_inset LatexCommand \index{power users} \end_inset . While a GUI \begin_inset LatexCommand \index{GUI} \end_inset is better suited \begin_inset LatexCommand \index{suited} \end_inset to some tasks, many operations are best suited to the CLI. \begin_inset LatexCommand \index{CLI} \end_inset \layout Standard The major motivation \begin_inset LatexCommand \index{motivation} \end_inset behind learning \begin_inset LatexCommand \index{learning} \end_inset the GNU/Linux CLI \begin_inset LatexCommand \index{CLI} \end_inset is the authors \begin_inset LatexCommand \index{authors} \end_inset idea \begin_inset LatexCommand \index{idea} \end_inset that, with software \begin_inset LatexCommand \index{software} \end_inset in general, the more time spent learning something equals less time spent performing that particular task \emph on (authors opinion only \begin_inset LatexCommand \index{authors opinion} \end_inset ) \emph default . \layout Standard This guide is aimed at beginners \begin_inset LatexCommand \index{beginners} \end_inset to intermediate \begin_inset LatexCommand \index{intermediate} \end_inset users who want to learn \begin_inset LatexCommand \index{learn} \end_inset about the command-line \begin_inset LatexCommand \index{command-line} \end_inset tools available to them. Advanced users may wish to use it as a command reference, \begin_inset LatexCommand \index{reference} \end_inset however this document aims to list \begin_inset LatexCommand \index{list} \end_inset commands of interest, as judged \begin_inset LatexCommand \index{judged} \end_inset by the authors opinion, \begin_inset LatexCommand \index{authors opinion} \end_inset it is not designed \begin_inset LatexCommand \index{designed} \end_inset to be completely comprehensive, \begin_inset LatexCommand \index{comprehensive} \end_inset see the appendix, \begin_inset LatexCommand \index{appendix} \end_inset \begin_inset LatexCommand \ref{general-further-reading} \end_inset for further information. Or if you are not looking for a command reference \begin_inset LatexCommand \index{reference} \end_inset guide, but a more gentle introduction to GNU/Linux you may be interested in the \begin_inset LatexCommand \url[Introduction to Linux guide]{http://www.tldp.org/LDP/intro-linux/html/} \end_inset \begin_inset LatexCommand \index{Introduction to Linux guide} \end_inset authored \begin_inset LatexCommand \index{authored} \end_inset by Machtelt Garrels. \begin_inset LatexCommand \index{Machtelt Garrels} \end_inset \layout Standard This guide could also be considered a summarised \begin_inset LatexCommand \index{summarised} \end_inset version of the Linux Cookbook. \begin_inset LatexCommand \index{Linux Cookbook} \end_inset If you are looking for a book \begin_inset LatexCommand \index{book} \end_inset with more detailed descriptions of each tool have a look at the \begin_inset LatexCommand \url[Linux Cookbook Homepage]{http://dsl.org/cookbook/} \end_inset , also check out the \begin_inset LatexCommand \url[command list from "Linux in a Nutshell 3rd Edition"]{http://www.onlamp.com/linux/cmd/} \end_inset \begin_inset LatexCommand \index{command list} \end_inset \begin_inset LatexCommand \index{Linux in a Nutshell 3rd Edition} \end_inset for an index \begin_inset LatexCommand \index{index} \end_inset of 300+ commands and their explanations. \begin_inset LatexCommand \index{explanations} \end_inset \layout Section Who would not want to read this guide? \begin_inset LatexCommand \label{who-would-not-want-to-read-this-guide} \end_inset \layout Standard Anyone who is not interested in the command-line \begin_inset LatexCommand \index{command-line} \end_inset , or anyone looking for a detailed reference to all available GNU/Linux tools should look elsewhere. This is only a summary, \begin_inset LatexCommand \index{summary} \end_inset while it does list many commands, it's not a complete \begin_inset LatexCommand \index{complete} \end_inset listing \begin_inset LatexCommand \index{listing} \end_inset (I don't think it's possible to make a complete listing anyway). \layout Standard This document would not be of interest to those who already have an expert \begin_inset LatexCommand \index{expert} \end_inset knowledge \begin_inset LatexCommand \index{knowledge} \end_inset of the command-line interface \begin_inset LatexCommand \index{command-line interface} \end_inset and do require any reference \begin_inset LatexCommand \index{reference} \end_inset information. \begin_inset LatexCommand \index{information} \end_inset Or those readers \begin_inset LatexCommand \index{readers} \end_inset who require detailed \begin_inset LatexCommand \index{detailed} \end_inset lists \begin_inset LatexCommand \index{lists} \end_inset of options \begin_inset LatexCommand \index{options} \end_inset for each command, the man pages \begin_inset LatexCommand \index{man pages} \end_inset are better suited \begin_inset LatexCommand \index{suited} \end_inset to this purpose. \begin_inset LatexCommand \index{purpose} \end_inset \layout Section Availability of sources \begin_inset LatexCommand \label{sources-of-document} \end_inset \layout Standard The modifiable \begin_inset LatexCommand \index{modifiable} \end_inset sources \begin_inset LatexCommand \index{sources} \end_inset of the original \begin_inset LatexCommand \index{original} \end_inset book \begin_inset LatexCommand \index{book} \end_inset (in english), are available \begin_inset LatexCommand \index{available} \end_inset in LyX \begin_inset LatexCommand \index{LyX} \end_inset format \begin_inset LatexCommand \index{format} \end_inset (LyX Document Processor) or Machine-translated \begin_inset LatexCommand \index{Machine-translated} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset (SGML markup language \begin_inset LatexCommand \index{markup language} \end_inset ). \layout Standard LyX is a completely free document processor \begin_inset LatexCommand \index{document processor} \end_inset based on LaTeX, \begin_inset LatexCommand \index{LaTeX} \end_inset downloadable \begin_inset LatexCommand \index{downloadable} \end_inset from \begin_inset LatexCommand \url[the LyX homepage.]{http://www.lyx.org} \end_inset . \layout Standard See \begin_inset LatexCommand \ref{formats} \end_inset for the modifiable \begin_inset LatexCommand \index{modifiable} \end_inset sources \begin_inset LatexCommand \index{sources} \end_inset of this document. These are the official \begin_inset LatexCommand \index{official} \end_inset versions. \begin_inset LatexCommand \index{versions} \end_inset We (the translators \begin_inset LatexCommand \index{translators} \end_inset and current maintainers \begin_inset LatexCommand \index{maintainers} \end_inset ) plan to continue work on this document and add new chapters and enhancements. \begin_inset LatexCommand \index{enhancements} \end_inset If you want to see the version \begin_inset LatexCommand \index{version} \end_inset we are currently working on (the "bleeding edge" version), check the \begin_inset LatexCommand \url[GNU/Linux Command-Line Tools Summary Homepage]{http://www.karakas-online.de/gnu-linux-tools-summary/} \end_inset \begin_inset LatexCommand \index{GNU/Linux Tools Summary Homepage} \end_inset from time to time (kindly hosted \begin_inset LatexCommand \index{hosted} \end_inset by \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset \begin_inset LatexCommand \index{Chris Karakas} \end_inset ). \layout Section Conventions used in this guide \begin_inset LatexCommand \label{conventions} \end_inset \layout Standard \family sans \series medium The following conventions \begin_inset LatexCommand \index{conventions} \end_inset are used within this guide: \layout Description italic \begin_inset LatexCommand \index{italic} \end_inset Anything appearing in italic, \emph on like\SpecialChar ~ this \emph default is either an executable \begin_inset LatexCommand \index{executable} \end_inset command or emphasized \begin_inset LatexCommand \index{emphasized} \end_inset text. Tools (executable commands) are in italics \begin_inset LatexCommand \index{italics} \end_inset to prevent confusion. Some tools have names which are real english \begin_inset LatexCommand \index{english} \end_inset words, such as the \begin_inset Quotes eld \end_inset locate \begin_inset Quotes erd \end_inset tool. \layout Description key\SpecialChar ~ combinations \begin_inset LatexCommand \index{key combinations} \end_inset Are represented by using a '-' (dash sign) \begin_inset LatexCommand \index{dash sign} \end_inset in-between the key(s), which must be used in combination. \begin_inset LatexCommand \index{combination} \end_inset All combinations \begin_inset LatexCommand \index{combinations} \end_inset are also printed \begin_inset LatexCommand \index{printed} \end_inset in italics \begin_inset LatexCommand \index{italics} \end_inset to improve clarity. \begin_inset LatexCommand \index{clarity} \end_inset For example CTRL-Z means hold down the \emph on Control key \begin_inset LatexCommand \index{Control key} \end_inset \emph default and press the \emph on z \emph default \emph on key. \layout Description admonitions \begin_inset LatexCommand \index{admonitions} \end_inset Admonitions are little pictures \begin_inset LatexCommand \index{pictures} \end_inset used to emphasize \begin_inset LatexCommand \index{emphasize} \end_inset something of importance \begin_inset LatexCommand \index{importance} \end_inset to the reader. \begin_inset LatexCommand \index{reader} \end_inset \begin_deeper \layout Standard The five types used are: \layout SGML \layout SGML This is a note \layout SGML \layout SGML Notes often give important information about a tool. \layout SGML \layout SGML \layout SGML \layout SGML This is a tip \layout SGML \layout SGML This will offer a useful switch or useful way to use a tool. \layout SGML \layout SGML \layout SGML \layout SGML This is something important \layout SGML \layout SGML This is something that is considered very important. Consider it like a note with extra importance, they are usually there to save the reader time. \layout SGML \layout SGML \layout SGML \layout SGML This is a caution \layout SGML \layout SGML This will inform you of something that you be careful about (because it could be harmful to your system). \layout SGML \layout SGML \layout SGML \layout SGML This is a warning \layout SGML \layout SGML This will inform you of something that you shouldn't do (because it probably will break something within your system). \layout SGML \layout SGML \end_deeper \layout Description code\SpecialChar ~ examples Code \begin_inset LatexCommand \index{Code} \end_inset examples \begin_inset LatexCommand \index{examples} \end_inset are shown for most commands. \begin_deeper \layout Standard Below is an example of what code \begin_inset LatexCommand \index{code} \end_inset looks like: \layout Code Hello World, I'm a code example. :) \end_deeper \layout Description command\SpecialChar ~ syntax \begin_inset LatexCommand \index{command syntax} \end_inset (or a similar phrase) simply shows how you would normally use the command. Often real examples \begin_inset LatexCommand \index{examples} \end_inset are used instead of explaining \begin_inset LatexCommand \index{explaining} \end_inset the command syntax. \begin_deeper \layout Standard The phrase \begin_inset Quotes eld \end_inset Command syntax \begin_inset Quotes erd \end_inset is always followed by the way you would type a command in a shell. \begin_inset LatexCommand \index{shell} \end_inset \layout Standard The standard \begin_inset LatexCommand \index{standard} \end_inset syntax \begin_inset LatexCommand \index{syntax} \end_inset for any tool is usually: \layout Code command -options file \layout SGML \layout SGML Note \layout SGML Note that some tools do not accept options. \layout SGML \end_deeper \layout Description wildcards \begin_inset LatexCommand \index{wildcards} \end_inset Also note that most commands, even when not explicitly \begin_inset LatexCommand \index{explicitly} \end_inset stated, will work with standard wildcards \begin_inset LatexCommand \index{standard wildcards} \end_inset (or globbing patterns \begin_inset LatexCommand \index{globbing patterns} \end_inset ) such as *, [A-Z] and various other standard wildcards. Refer \begin_inset LatexCommand \index{Refer} \end_inset to \begin_inset LatexCommand \ref{standard-wildcards} \end_inset for further information. \layout Description access\SpecialChar ~ keys \begin_inset LatexCommand \index{access keys} \end_inset Access keys enable \begin_inset LatexCommand \index{enable} \end_inset navigation through the document, without relying on a mouse. \begin_inset LatexCommand \index{mouse} \end_inset The following keys have been given special \begin_inset LatexCommand \index{special} \end_inset meaning in this document: \begin_deeper \layout Description P Previous \begin_inset LatexCommand \index{Previous} \end_inset page. \begin_inset LatexCommand \index{page} \end_inset \layout Description N Next \begin_inset LatexCommand \index{Next} \end_inset page. \layout Description H Home \begin_inset LatexCommand \index{Home} \end_inset of the document (Table of Contents). \begin_inset LatexCommand \index{Table of Contents} \end_inset \layout Description U Up \begin_inset LatexCommand \index{Up} \end_inset (takes you one level \begin_inset LatexCommand \index{level} \end_inset up the section \begin_inset LatexCommand \index{section} \end_inset hierarchy). \layout Standard If you also happen to be reading \begin_inset LatexCommand \index{reading} \end_inset the document from its original \begin_inset LatexCommand \index{original} \end_inset location, then the following access keys can also be used: \layout Description S Start \begin_inset LatexCommand \index{Start} \end_inset (takes you to the author's start page). \layout Description T The current \begin_inset LatexCommand \index{current} \end_inset ( \begin_inset Quotes eld \end_inset This \begin_inset Quotes erd \end_inset ) page, without the Sitemenu \begin_inset LatexCommand \index{Sitemenu} \end_inset on the left. \layout Description M The current page in a frameset, \begin_inset LatexCommand \index{frameset} \end_inset where the left frame \begin_inset LatexCommand \index{frame} \end_inset contains a Menu. \begin_inset LatexCommand \index{Menu} \end_inset \end_deeper \layout SGML \layout SGML To use the access keys, you have to simultaneously press a modifier key, which may vary from browser to browser. For example in NN6+/Mozilla, the modifier key is ALT, so you have to use \layout SGML \layout SGML ALT \layout SGML N \layout SGML \layout SGML to go to the next page, and \layout SGML \layout SGML ALT \layout SGML P \layout SGML \layout SGML to come back. In other browsers such as IE6, the access keys just give focus to the associate d link, so the sequence becomes \layout SGML \layout SGML \layout SGML ALT \layout SGML N \layout SGML \layout SGML Enter \layout SGML \layout SGML . Try it, you'll like it! ]]> ]]> ]]> ]]> Inline graphic \layout Section Resources used to create this document \begin_inset LatexCommand \label{resources-used-to-create-this-document} \end_inset \layout Standard To create the GNU/Linux Command-Line \begin_inset LatexCommand \index{Command-Line} \end_inset Tools Summary, \begin_inset LatexCommand \index{Summary} \end_inset I used \begin_inset LatexCommand \url[LyX]{http://www.lyx.org} \end_inset , the document processor. \begin_inset LatexCommand \index{document processor} \end_inset To convert \begin_inset LatexCommand \index{convert} \end_inset the LyX files to DocBook \begin_inset LatexCommand \index{DocBook} \end_inset SGML \begin_inset LatexCommand \index{SGML} \end_inset I used the \begin_inset LatexCommand \url[lyxtox Scripts]{http://www.karakas-online.de/mySGML/} \end_inset \begin_inset LatexCommand \index{lyxtox} \end_inset created by \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset \begin_inset LatexCommand \index{Chris Karakas} \end_inset . \layout Standard You may also want to check out the \begin_inset LatexCommand \url[db2lyx ]{http://bgu.chez.tiscali.fr/} \end_inset \begin_inset LatexCommand \index{db2lyx} \end_inset package, \begin_inset LatexCommand \index{package} \end_inset created by Dr. B Guillion \begin_inset LatexCommand \index{Dr. B. Guillion} \end_inset , which can be used to convert LyX files to XML \begin_inset LatexCommand \index{XML} \end_inset DocBook and XML DocBook \begin_inset LatexCommand \index{DocBook} \end_inset back to LyX. \layout Standard I also had assistance \begin_inset LatexCommand \index{assistance} \end_inset from various \begin_inset LatexCommand \url[The Linux Documentation Project]{http://www.tldp.org} \end_inset \begin_inset LatexCommand \index{The Linux Documentation Project} \end_inset volunteers \begin_inset LatexCommand \index{volunteers} \end_inset (see the contributors \begin_inset LatexCommand \index{contributors} \end_inset section \begin_inset LatexCommand \index{section} \end_inset \begin_inset LatexCommand \ref{contributors} \end_inset for specific \begin_inset LatexCommand \index{specific} \end_inset details). \layout Section Feedback \begin_inset LatexCommand \label{feedback} \end_inset \layout Standard Feedback \begin_inset LatexCommand \index{Feedback} \end_inset is necessary for the advancement \begin_inset LatexCommand \index{advancement} \end_inset of this guide. Positive, \begin_inset LatexCommand \index{Positive} \end_inset constructive criticism \begin_inset LatexCommand \index{criticism} \end_inset is encouraged. \begin_inset LatexCommand \index{encouraged} \end_inset If you have ideas, \begin_inset LatexCommand \index{ideas} \end_inset suggestions, \begin_inset LatexCommand \index{suggestions} \end_inset advice, \begin_inset LatexCommand \index{advice} \end_inset or problems \begin_inset LatexCommand \index{problems} \end_inset with this guide, please send \begin_inset LatexCommand \index{send} \end_inset an email \begin_inset LatexCommand \index{email} \end_inset to the author \begin_inset LatexCommand \index{author} \end_inset \begin_inset LatexCommand \url[Gareth Anderson]{mailto:somecsstudent(at)gmail.com} \end_inset \begin_inset LatexCommand \index{Gareth Anderson} \end_inset . \layout SGML \begin_inset Note collapsed false \layout Standard changed to this weird style to stop the paragraph of this note becoming a footnote. Still footnote! --now added something above to try to stop footnote. (will be in version 0.6)--fixed by chris. \layout Standard Seems to work now \end_inset \layout SGML Contributions \layout SGML \layout SGML If you wish to make contributions it is recommended (if possible) to read the LyX file(s) for this document. They contain various notes which you can't see in the other versions. \layout SGML These notes highlight the areas that need contributions, certain tools which I cannot understand, tools which have not been added, or tools which were removed. These notes also explain some of the structure of this document. \layout SGML \layout SGML \layout Section Contributors \begin_inset LatexCommand \label{contributors} \end_inset \layout Standard As you may be able to see, parts \begin_inset LatexCommand \index{parts} \end_inset of this guide are based off \begin_inset LatexCommand \index{based off} \end_inset various advice \begin_inset LatexCommand \index{advice} \end_inset columns \begin_inset LatexCommand \index{columns} \end_inset on GNU/Linux, anything that has being directly quoted \begin_inset LatexCommand \index{quoted} \end_inset from an article \begin_inset LatexCommand \index{article} \end_inset can be found \begin_inset LatexCommand \index{found} \end_inset in the references, \begin_inset LatexCommand \index{references} \end_inset \begin_inset LatexCommand \ref{references} \end_inset , section \begin_inset LatexCommand \index{section} \end_inset of this document. \layout Standard The following is a list \begin_inset LatexCommand \index{list} \end_inset of people \begin_inset LatexCommand \index{people} \end_inset who have made a significant contribution \begin_inset LatexCommand \index{contribution} \end_inset to this document, in a rough \begin_inset LatexCommand \index{rough} \end_inset chronological \begin_inset LatexCommand \index{chronological} \end_inset order. \layout Description \begin_inset LatexCommand \url[Chris Karakas]{http://www.karakas-online.de} \end_inset : Chris allowed the use of his lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset scripts \begin_inset LatexCommand \index{scripts} \end_inset to convert the LyX \begin_inset LatexCommand \index{LyX} \end_inset file of the document to working DocBook SGML \begin_inset LatexCommand \index{SGML} \end_inset output (to learn \begin_inset LatexCommand \index{learn} \end_inset how to use the lyxtox \begin_inset LatexCommand \index{lyxtox} \end_inset scripts \begin_inset LatexCommand \index{scripts} \end_inset yourself, see \begin_inset LatexCommand \url[Document processing with LyX and SGML]{http://www.karakas-online.de/mySGML/} \end_inset ). \begin_deeper \layout Itemize Chris provided useful suggestions \begin_inset LatexCommand \index{suggestions} \end_inset and advice, \begin_inset LatexCommand \index{advice} \end_inset and added an index \begin_inset LatexCommand \index{index} \end_inset listing \begin_inset LatexCommand \index{listing} \end_inset for many of the commands. \layout Itemize Chris is also responsible for the great looking HTML \begin_inset LatexCommand \index{HTML} \end_inset file for this document \begin_inset LatexCommand \index{document} \end_inset (the CSS \begin_inset LatexCommand \index{CSS} \end_inset file and HTML \begin_inset LatexCommand \index{HTML} \end_inset customisations \begin_inset LatexCommand \index{customisations} \end_inset are completely his work). \layout Itemize Chris has also helped fix up problems \begin_inset LatexCommand \index{problems} \end_inset in the document (many times), especially with docbook/sgml, and LyX related issues. \begin_inset LatexCommand \index{issues} \end_inset \layout Itemize Chris has also improved \begin_inset LatexCommand \index{improved} \end_inset the structure \begin_inset LatexCommand \index{structure} \end_inset of the document by adding labels and fixing \begin_inset LatexCommand \index{fixing} \end_inset minor errors. \end_deeper \layout Description William\SpecialChar ~ West: \begin_inset LatexCommand \index{William West} \end_inset William provided a thorough review \begin_inset LatexCommand \index{review} \end_inset of the document as required \begin_inset LatexCommand \index{required} \end_inset by the \begin_inset LatexCommand \url[Linux Documentation Project]{http://www.tldp.org} \end_inset \begin_inset LatexCommand \index{Linux Documentation Project} \end_inset . He is responsible \begin_inset LatexCommand \index{responsible} \end_inset for a variety of improvements \begin_inset LatexCommand \index{improvements} \end_inset to the quality \begin_inset LatexCommand \index{quality} \end_inset of this document. \begin_deeper \layout Standard His contributions \begin_inset LatexCommand \index{contributions} \end_inset include: \begin_inset LatexCommand \index{include} \end_inset \layout Itemize Improvements \begin_inset LatexCommand \index{Improvements} \end_inset to the readability \begin_inset LatexCommand \index{readability} \end_inset of this document. \layout Itemize Improvements \begin_inset LatexCommand \index{Improvements} \end_inset to the structure \begin_inset LatexCommand \index{structure} \end_inset and consistency \begin_inset LatexCommand \index{consistency} \end_inset of this document. \layout Itemize Various grammar \begin_inset LatexCommand \index{grammar} \end_inset improvements throughout the document. \layout Itemize Repair \begin_inset LatexCommand \index{Repair} \end_inset of some minor \begin_inset LatexCommand \index{minor} \end_inset technical errors. \begin_inset LatexCommand \index{errors} \end_inset \end_deeper \layout Description \begin_inset LatexCommand \url[Tabatha Persad/Marshall]{http://www.merlinmonroe.com/} \end_inset : \begin_inset LatexCommand \index{Tabatha Persad} \end_inset \begin_inset LatexCommand \index{Tabatha Marshall} \end_inset Tabatha, as the \begin_inset LatexCommand \url[Linux Documentation Project]{http://www.tldp.org} \end_inset \begin_inset LatexCommand \index{Linux Documentation Project} \end_inset Review Coordinator \begin_inset LatexCommand \index{Review Coordinator} \end_inset (at the time) also gave a brief review \begin_inset LatexCommand \index{review} \end_inset of this document. Her general advice was used to improve \begin_inset LatexCommand \index{improve} \end_inset the structure, \begin_inset LatexCommand \index{structure} \end_inset language \begin_inset LatexCommand \index{language} \end_inset and grammar \begin_inset LatexCommand \index{grammar} \end_inset of the document. \layout Description \begin_inset LatexCommand \url[Rahul Sundaram]{http://rahulsundaram.livejournal.com/} \end_inset : \begin_inset LatexCommand \index{Rahul Sundaram} \end_inset Rahul provided a brief review \begin_inset LatexCommand \index{review} \end_inset of this document for the \begin_inset LatexCommand \url[Linux Documentation Project]{http://www.tldp.org} \end_inset \begin_inset LatexCommand \index{Linux Documentation Project} \end_inset . Advice from his brief review \begin_inset LatexCommand \index{review} \end_inset was integrated \begin_inset LatexCommand \index{integrated} \end_inset into this document to improve \begin_inset LatexCommand \index{improve} \end_inset readability \begin_inset LatexCommand \index{readability} \end_inset and structure, \begin_inset LatexCommand \index{structure} \end_inset several \begin_inset LatexCommand \index{several} \end_inset references \begin_inset LatexCommand \index{references} \end_inset were added as recommended \begin_inset LatexCommand \index{recommended} \end_inset by Rahul. \layout Description \begin_inset LatexCommand \url[David Lawyer]{http://www.lafn.org/~dave/} \end_inset : \begin_inset LatexCommand \index{David Lawyer} \end_inset David's criticism \begin_inset LatexCommand \index{criticism} \end_inset of the document \begin_inset LatexCommand \index{document} \end_inset (via the TLDP \begin_inset LatexCommand \index{TLDP} \end_inset discuss list \begin_inset LatexCommand \index{discuss list} \end_inset ) were listened to, and attempts to improve the document were made. A number of his criticisms \begin_inset LatexCommand \index{criticisms} \end_inset were addressed \begin_inset LatexCommand \index{addressed} \end_inset and improved. \begin_inset LatexCommand \index{improved} \end_inset \begin_inset Note collapsed false \layout Standard I can no longer remember what they were and could not find them in the TLDP archives. \end_inset \layout Description George\SpecialChar ~ Harmon: \begin_inset LatexCommand \index{George Harmon} \end_inset George provided \begin_inset LatexCommand \index{provided} \end_inset a second language review \begin_inset LatexCommand \index{language review} \end_inset . His detailed \begin_inset LatexCommand \index{detailed} \end_inset review of the material \begin_inset LatexCommand \index{material} \end_inset allowed me to improve the general grammar \begin_inset LatexCommand \index{grammar} \end_inset of the document and some minor \begin_inset LatexCommand \index{minor} \end_inset errors. \layout Description \begin_inset LatexCommand \url[Machtelt Garrels (tille)]{http://tille.xalasys.com} \end_inset : \begin_inset LatexCommand \index{tille} \end_inset \begin_inset LatexCommand \index{Machtelt Garrels} \end_inset Machtelt provided tips in regard to referencing \begin_inset LatexCommand \index{referencing} \end_inset the correct \begin_inset LatexCommand \index{correct} \end_inset LDP documents \begin_inset LatexCommand \index{documents} \end_inset from this guide. \begin_inset LatexCommand \index{guide} \end_inset As well as general \begin_inset LatexCommand \index{general} \end_inset advice on improvements \begin_inset LatexCommand \index{improvements} \end_inset to the guide. \layout Description Michael\SpecialChar ~ Kerrisk: \begin_inset LatexCommand \index{Michael Kerrisk} \end_inset Michael pointed out a number of technical errors in the document after his brief review \begin_inset LatexCommand \index{review} \end_inset on behalf of the TLDP \begin_inset LatexCommand \index{TLDP} \end_inset during posts to the discussion list. \begin_inset LatexCommand \index{discuss list} \end_inset \layout Chapter Legal \begin_inset LatexCommand \label{Legal} \end_inset \layout Standard The legal \begin_inset LatexCommand \index{legal} \end_inset chapter provides information \begin_inset LatexCommand \index{information} \end_inset about the disclaimer \begin_inset LatexCommand \index{disclaimer} \end_inset that applies to the entire document and the licensing \begin_inset LatexCommand \index{licensing} \end_inset information. \layout Section Disclaimer \begin_inset LatexCommand \label{disclaimer} \end_inset \layout Standard No liability \begin_inset LatexCommand \index{liability} \end_inset for the contents \begin_inset LatexCommand \index{contents} \end_inset of this document \begin_inset LatexCommand \index{documents} \end_inset can be accepted. Use the concepts, \begin_inset LatexCommand \index{concepts} \end_inset examples \begin_inset LatexCommand \index{examples} \end_inset and other content \begin_inset LatexCommand \index{content} \end_inset at your own risk. \begin_inset LatexCommand \index{risk} \end_inset There may be errors \begin_inset LatexCommand \index{errors} \end_inset and inaccuracies, \begin_inset LatexCommand \index{inaccuracies} \end_inset that may of course be damaging to your system. Although this is highly \begin_inset LatexCommand \index{highly} \end_inset unlikely, you should proceed \begin_inset LatexCommand \index{proceed} \end_inset with caution. \begin_inset LatexCommand \index{caution} \end_inset The author \begin_inset LatexCommand \index{author} \end_inset does not accept any responsibility \begin_inset LatexCommand \index{responsibility} \end_inset for any damage \begin_inset LatexCommand \index{damage} \end_inset incurred. \layout Standard All copyrights \begin_inset LatexCommand \index{copyrights} \end_inset are held by their respective owners \begin_inset LatexCommand \index{respective owners} \end_inset , unless specifically \begin_inset LatexCommand \index{specifically} \end_inset noted otherwise. Use of a term \begin_inset LatexCommand \index{term} \end_inset in this document should not be regarded \begin_inset LatexCommand \index{regarded} \end_inset as affecting the validity \begin_inset LatexCommand \index{validity} \end_inset of any trademark \begin_inset LatexCommand \index{trademark} \end_inset or service mark \begin_inset LatexCommand \index{service mark} \end_inset . \layout Standard Naming \begin_inset LatexCommand \index{Naming} \end_inset of particular products \begin_inset LatexCommand \index{products} \end_inset or brands \begin_inset LatexCommand \index{brands} \end_inset should not be seen as endorsements. \begin_inset LatexCommand \index{endorsements} \end_inset \layout Standard UNIX \begin_inset LatexCommand \index{UNIX} \end_inset is a registered trademark \begin_inset LatexCommand \index{trademark} \end_inset of The Open Group \begin_inset LatexCommand \index{The Open Group} \end_inset . \layout Section License \begin_inset LatexCommand \label{license} \end_inset \layout Standard Copyright \begin_inset LatexCommand \index{Copyright} \end_inset © 2003 - 2006 Gareth Anderson. \begin_inset LatexCommand \index{Gareth Anderson} \end_inset Permission \begin_inset LatexCommand \index{Permission} \end_inset is granted \begin_inset LatexCommand \index{granted} \end_inset to copy, \begin_inset LatexCommand \index{copy} \end_inset distribute \begin_inset LatexCommand \index{distribute} \end_inset and/or modify \begin_inset LatexCommand \index{modify} \end_inset this document under the terms \begin_inset LatexCommand \index{terms} \end_inset of the GNU \begin_inset LatexCommand \index{GNU} \end_inset Free Documentation License, \begin_inset LatexCommand \index{GNU Free Documentation License} \end_inset \begin_inset LatexCommand \index{GFDL} \end_inset Version \begin_inset LatexCommand \index{Version} \end_inset 1.1 or any later version \begin_inset LatexCommand \index{version} \end_inset published by the Free Software Foundation; \begin_inset LatexCommand \index{FSF} \end_inset \begin_inset LatexCommand \index{Free Software Foundation} \end_inset with no Invariant \begin_inset LatexCommand \index{Invariant} \end_inset Sections, \begin_inset LatexCommand \index{Sections} \end_inset with no Front-Cover \begin_inset LatexCommand \index{Front-Cover} \end_inset Texts, and with no Back-Cover \begin_inset LatexCommand \index{Back-Cover} \end_inset Texts. \begin_inset LatexCommand \index{Texts} \end_inset A copy of the license \begin_inset LatexCommand \index{license} \end_inset can be found in the section called the GNU Free Documentation License or at the \begin_inset LatexCommand \url[GNU Documentation License Site]{http://www.gnu.org/licenses/licenses.html} \end_inset . \begin_inset LatexCommand \index{GNU Documentation License Site} \end_inset \layout Chapter The Unix Tools Philosophy \begin_inset LatexCommand \label{The-UNIX-Tools-Philosophy} \end_inset \begin_inset Note collapsed false \layout Standard do I need to comply to the open group's rules for use of the UNIX trademark? -- done now AFAIK renamed a variety of things to UNIX system and stuff, see above notes for further information... \end_inset \layout Standard A tool is a simple program, \begin_inset LatexCommand \index{program} \end_inset usually designed for a specific purpose, it is sometimes referred \begin_inset LatexCommand \index{referred} \end_inset to (at least throughout this document) as a command. \layout Standard The \begin_inset Quotes eld \end_inset Unix tools philosophy \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{Unix Tools Philosophy} \end_inset emerged \begin_inset LatexCommand \index{emerged} \end_inset during the creation of the UNIX \begin_inset LatexCommand \index{UNIX} \end_inset operating system, after the breakthrough invention \begin_inset LatexCommand \index{invention} \end_inset of the pipe \begin_inset LatexCommand \index{pipe} \end_inset '|' (refer to \begin_inset LatexCommand \ref{Directing-input-ouput} \end_inset for information on using the pipe). \layout Standard The pipe \begin_inset LatexCommand \index{pipe} \end_inset allowed the output \begin_inset LatexCommand \index{output} \end_inset of one program to be sent to the input \begin_inset LatexCommand \index{input} \end_inset of another. The tools philosophy was to have small programs to accomplish a particular task instead of trying to develop large monolithic programs to do a large number of tasks. To accomplish more complex \begin_inset LatexCommand \index{complex} \end_inset tasks, \begin_inset LatexCommand \index{tasks} \end_inset tools would simply be connected \begin_inset LatexCommand \index{connected} \end_inset together, using pipes. \begin_inset LatexCommand \index{pipes} \end_inset \layout Standard All the core \begin_inset LatexCommand \index{core} \end_inset UNIX system \begin_inset LatexCommand \index{UNIX system} \end_inset tools were designed \begin_inset LatexCommand \index{designed} \end_inset so that they could operate \begin_inset LatexCommand \index{operate} \end_inset together. The original text-based \begin_inset LatexCommand \index{text-based} \end_inset editors (and even TeX \begin_inset LatexCommand \index{TeX} \end_inset and LaTeX \begin_inset LatexCommand \index{LaTeX} \end_inset ) use ASCII \begin_inset LatexCommand \index{ASCII} \end_inset (the American text encoding standard; \begin_inset LatexCommand \index{American text encoding standard} \end_inset an open standard) and you can use tools such as; \emph on sed \emph default , \emph on awk \emph default , \emph on vi \emph default , \emph on grep \emph default , \emph on cat \emph default , \emph on more \emph default , \emph on tr \emph default and various other text-based \begin_inset LatexCommand \index{text-based} \end_inset tools in conjunction \begin_inset LatexCommand \index{conjunction} \end_inset with these editors. \begin_inset LatexCommand \index{editors} \end_inset \begin_inset Note collapsed false \layout Standard technically mark up languages (technically!) \end_inset \layout Standard Using this philosophy \begin_inset LatexCommand \index{philosophy} \end_inset programmers \begin_inset LatexCommand \index{programmers} \end_inset avoided writing \begin_inset LatexCommand \index{writing} \end_inset a program (within their larger program) that had already been written by someone else (this could be considered a form of code \begin_inset LatexCommand \index{code} \end_inset recycling). For example, command-line \begin_inset LatexCommand \index{command-line} \end_inset spell \begin_inset LatexCommand \index{spell} \end_inset checkers are used by a number of different applications instead of having each application \begin_inset LatexCommand \index{application} \end_inset create its own own spell checker. \begin_inset LatexCommand \index{checker} \end_inset \layout Standard This philosophy \begin_inset LatexCommand \index{philosophy} \end_inset lives on today \begin_inset LatexCommand \index{today} \end_inset in GNU/Linux and various other UNIX system-based operating systems (FreeBSD, \begin_inset LatexCommand \index{FreeBSD} \end_inset NetBSD, \begin_inset LatexCommand \index{NetBSD} \end_inset OpenBSD, \begin_inset LatexCommand \index{OpenBSD} \end_inset etc.). \layout Standard For further information (articles) on the UNIX tools philosophy \begin_inset LatexCommand \index{UNIX tools philosophy} \end_inset please see the further reading \begin_inset LatexCommand \index{further reading} \end_inset section, here: \begin_inset LatexCommand \ref{unix-tools-further-reading} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard well I hope that's correct. My knowledge of UNIX history is not 100% perfect. Should I mention that code evolves as part of the UNIX philosophy? it's sort of connected\SpecialChar \ldots{} \end_inset \layout Chapter Shell Tips \begin_inset LatexCommand \label{Shell-Tips} \end_inset \layout Standard The shell \begin_inset LatexCommand \index{shell} \end_inset tips chapter provides handy tricks that you may wish to use when you are using a GNU/Linux shell (the command-line \begin_inset LatexCommand \index{command-line} \end_inset interface). This information includes handy \begin_inset LatexCommand \index{handy} \end_inset shortcut \begin_inset LatexCommand \index{shortcut} \end_inset key combinations, \begin_inset LatexCommand \index{key combinations} \end_inset the shell's command history \begin_inset LatexCommand \index{command history} \end_inset and information on virtual terminals. \begin_inset LatexCommand \index{virtual terminals} \end_inset \layout SGML \layout SGML If you can't boot into your system \layout SGML If your having problems booting into your system you may like to use a shell so you can boot into your system and attempt to fix things up again. \layout SGML To do this you need to pass the \begin_inset Quotes eld \end_inset init=/bin/sh \begin_inset Quotes erd \end_inset to your system before you boot up. \layout SGML If you don't know how to do this please see \begin_inset LatexCommand \ref{Security} \end_inset \begin_inset LatexCommand \index{Security} \end_inset , the technique is the same except this time you pass "init=bin/sh" rather than "single". \layout SGML \layout Section General Shell Tips \begin_inset LatexCommand \label{general-Shell-Tips} \end_inset \layout Description Automatic\SpecialChar ~ Command\SpecialChar ~ Completion \begin_inset LatexCommand \index{Automatic Command Completion} \end_inset Use the TAB \begin_inset LatexCommand \index{TAB} \end_inset key and bash \begin_inset LatexCommand \index{bash} \end_inset will attempt \begin_inset LatexCommand \index{attempt} \end_inset to complete \begin_inset LatexCommand \index{complete} \end_inset the command for you automatically. \begin_inset LatexCommand \index{automatically} \end_inset You can use it to complete command (tool) names. You can also use it when working with the file-system, \begin_inset LatexCommand \index{file-system} \end_inset when changing directories, copying \begin_inset LatexCommand \index{copying} \end_inset files et cetera. \begin_deeper \layout Standard There are also other lesser \begin_inset LatexCommand \index{lesser} \end_inset known ways to use automatic command completion \begin_inset LatexCommand \index{automatic command completion} \end_inset (for example completing user names): \begin_inset Foot collapsed true \layout Standard This information was adopted (with editing) from Mandrakesoft's Command Line Manual, see [7] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset \layout Description ESC-Y\SpecialChar ~ (Y:\SpecialChar ~ special\SpecialChar ~ character) testing autoindexing Will attempt to complete the command name for you. If it fails it will either list \begin_inset LatexCommand \index{list} \end_inset the possible completions \begin_inset LatexCommand \index{completions} \end_inset (if they exist). If there are none \begin_inset LatexCommand \index{none} \end_inset it will simply beep \begin_inset LatexCommand \index{beep} \end_inset (and/or) flash \begin_inset LatexCommand \index{flash} \end_inset the screen. \begin_inset LatexCommand \index{screen} \end_inset \begin_inset Note collapsed false \layout Standard redundant? Note that you must hold escape and press the special character (see below) for this to work. \end_inset \layout Description CTRL-X-Y\SpecialChar ~ (Y:\SpecialChar ~ special\SpecialChar ~ character) Lists the possible completions (it won't attempt \begin_inset LatexCommand \index{attempt} \end_inset to complete it for you) or beep \begin_inset LatexCommand \index{beep} \end_inset if there are no possible \begin_inset LatexCommand \index{possible} \end_inset completions. \layout Standard \series bold Special-characters: \layout Standard Use the following \begin_inset LatexCommand \index{following} \end_inset special characters \begin_inset LatexCommand \index{special characters} \end_inset combined with either ESC-Y or CTRL-X-Y, where Y is some special characters. For example ESC-$ or CTRL-X-$ to complete an environment variable \begin_inset LatexCommand \index{environment variable} \end_inset name. \layout Itemize \series bold ~ \series default (tilde) \begin_inset LatexCommand \index{tilde} \end_inset \begin_inset LatexCommand \index{~} \end_inset complete a user name \begin_inset LatexCommand \index{user name} \end_inset \layout Itemize @ (at sign) \begin_inset LatexCommand \index{@} \end_inset complete a machine name \begin_inset LatexCommand \index{machine name} \end_inset \layout Itemize $ (dollars sign) \begin_inset LatexCommand \index{$} \end_inset complete an environment variable \begin_inset LatexCommand \index{environment variable} \end_inset name \layout Itemize ! (exclamation mark) \begin_inset LatexCommand \index{!} \end_inset a magic character \begin_inset LatexCommand \index{magic character} \end_inset for completing a command name \begin_inset LatexCommand \index{command name} \end_inset or a file name. \begin_inset LatexCommand \index{file name} \end_inset The ! special character \begin_inset LatexCommand \index{special character} \end_inset has the same function \begin_inset LatexCommand \index{function} \end_inset as the TAB \begin_inset LatexCommand \index{TAB} \end_inset key. It works in some other situations; for example when completing man page \begin_inset LatexCommand \index{man page} \end_inset names. \end_deeper \layout Description alias \begin_inset LatexCommand \index{alias} \end_inset The \emph on alias \emph default command will list your current aliases. \begin_inset LatexCommand \index{aliases} \end_inset You can use \emph on unalias \emph default \begin_inset LatexCommand \index{unalias} \end_inset to remove \begin_inset LatexCommand \index{remove} \end_inset the alias (to disable \begin_inset LatexCommand \index{disable} \end_inset it just for one command add a \begin_inset Quotes eld \end_inset \backslash \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{\} \end_inset (back-slash) before the command)\SpecialChar \ldots{} \begin_deeper \layout Standard An alias allows one command to be substituted \begin_inset LatexCommand \index{substituted} \end_inset for another. This is used to make a command do something else or to automatically \begin_inset LatexCommand \index{automatically} \end_inset add \begin_inset LatexCommand \index{add} \end_inset certain options. \begin_inset LatexCommand \index{options} \end_inset This can be either be done during one session \begin_inset LatexCommand \index{session} \end_inset using the alias command (see below) or the information \begin_inset LatexCommand \index{information} \end_inset can be added to the \emph on .bashrc \emph default file (found in the users home directory). \layout Standard Below is an example of what an alias section (within your \emph on .bashrc \emph default file) might look like: \layout Code \noindent # my personal aliases \layout Code \noindent alias cp='cp -vi' #to prompt when copying if you want to overwrite and will tell you where information is going \layout Code \noindent alias rm='rm -i' #Prompts you if you really want to remove it. \layout Code \noindent alias mv='mv -i' #Prompts you if you are going to overwrite something \layout Standard On any Mandriva GNU/Linux system the global aliases \begin_inset LatexCommand \index{global aliases} \end_inset (for all users) are all in /etc/profile.d/alias.sh. The above listed \begin_inset LatexCommand \index{listed} \end_inset commands already have aliases, \begin_inset LatexCommand \index{aliases} \end_inset as well as several \begin_inset LatexCommand \index{several} \end_inset other commonly \begin_inset LatexCommand \index{commonly} \end_inset used commands. \end_deeper \layout Description set\SpecialChar ~ -x \begin_inset LatexCommand \index{-x} \end_inset \emph on set \begin_inset LatexCommand \index{set} \end_inset \emph default is one of bash's inbuilt \begin_inset LatexCommand \index{inbuilt} \end_inset commands, try looking in the bash \begin_inset LatexCommand \index{bash} \end_inset manual for its many usage \begin_inset LatexCommand \index{usage} \end_inset options. \begin_deeper \layout Standard Using \emph on set \emph default with the \emph on -x \emph default option \begin_inset LatexCommand \index{option} \end_inset will make bash \begin_inset LatexCommand \index{bash} \end_inset print out each command it is going to run \begin_inset LatexCommand \index{run} \end_inset before it runs it. \layout Standard This can be useful to find \begin_inset LatexCommand \index{find} \end_inset out what is happening with certain commands such as things being quoted \begin_inset LatexCommand \index{quoted} \end_inset that contain wildcards \begin_inset LatexCommand \index{wildcards} \end_inset or special symbols \begin_inset LatexCommand \index{special symbols} \end_inset that could cause \begin_inset LatexCommand \index{cause} \end_inset problems, or complex \begin_inset LatexCommand \index{complex} \end_inset aliases. Use \emph on set +x \emph default to turn \begin_inset LatexCommand \index{turn} \end_inset this back off. \begin_inset LatexCommand \index{back off} \end_inset \layout Standard Examples \layout Standard After using \emph on set -x \emph default you can run the command: \layout Code ls \layout Standard \begin_inset LatexCommand \index{ls} \end_inset \begin_inset LatexCommand \index{-F} \end_inset \begin_inset LatexCommand \index{--color=auto} \end_inset The output \begin_inset LatexCommand \index{output} \end_inset printed \begin_inset LatexCommand \index{printed} \end_inset before the command runs (for example): \layout Code + ls -F --color=auto \layout Standard Which means that the command is really an alias to run \emph on ls \emph default with the \emph on -F \emph default and \emph on --color=auto \emph default options. Use a \begin_inset Quotes eld \end_inset \backslash \begin_inset Quotes erd \end_inset (backslash) before the command to run \begin_inset LatexCommand \index{run} \end_inset it without the alias. \end_deeper \layout Description \noindent \backslash \SpecialChar ~ (backslash) \begin_inset LatexCommand \index{\} \end_inset The backslash \begin_inset LatexCommand \index{backslash} \end_inset escape character \begin_inset LatexCommand \index{character} \end_inset can be used before a shell command to override \begin_inset LatexCommand \index{override} \end_inset any aliases. \begin_deeper \layout Standard For example if \emph on rm \emph default was made into an alias for \emph on rm -i \begin_inset LatexCommand \index{-i} \end_inset \begin_inset LatexCommand \index{rm -i} \end_inset \emph default then typing \begin_inset Quotes eld \end_inset rm \begin_inset Quotes erd \end_inset would actually run \emph on rm -i \emph default . \layout Standard However, typing \emph on \backslash rm \emph default lets the shell ignore the alias \begin_inset LatexCommand \index{alias} \end_inset and just run \emph on rm \emph default (its runs exactly \begin_inset LatexCommand \index{exactly} \end_inset what you type), this way it won't confirm \begin_inset LatexCommand \index{confirm} \end_inset if you want to delete \begin_inset LatexCommand \index{delete} \end_inset things. \layout SGML \layout SGML Using rm \layout SGML Please note that the alias for the remove command is there for a reason. Using it incorrectly could remove files which you don't want removed. \layout SGML Only use \emph on \backslash rm \emph default if you know exactly what you are doing (recovering files is not easy, \emph on rm \emph default does not send things to a recycle bin). \layout SGML \layout Standard \noindent The \begin_inset Quotes eld \end_inset \backslash \begin_inset Quotes erd \end_inset character \begin_inset LatexCommand \index{character} \end_inset can be used before special characters \begin_inset LatexCommand \index{special characters} \end_inset (such as a space \begin_inset LatexCommand \index{space} \end_inset or a wildcard \begin_inset LatexCommand \index{wildcard} \end_inset ), to stop \begin_inset LatexCommand \index{stop} \end_inset bash \begin_inset LatexCommand \index{bash} \end_inset from trying to expand \begin_inset LatexCommand \index{expand} \end_inset them. You can make a directory \begin_inset LatexCommand \index{directory} \end_inset name with a space \begin_inset LatexCommand \index{space} \end_inset in it using a backslash before the space. For example you could type \emph on cd \emph default \emph on My \emph default \backslash \emph on Directory \emph default \backslash \emph on With \emph default \backslash \emph on Spaces \emph default which normally wouldn't work. \layout Standard The \begin_inset Quotes eld \end_inset \backslash \begin_inset Quotes erd \end_inset character \begin_inset LatexCommand \index{character} \end_inset can also be used to stop \begin_inset LatexCommand \index{stop} \end_inset bash \begin_inset LatexCommand \index{bash} \end_inset from expanding \begin_inset LatexCommand \index{expanding} \end_inset certain symbols \begin_inset LatexCommand \index{symbols} \end_inset (as an alternative \begin_inset LatexCommand \index{alternative} \end_inset you could use single quotation \begin_inset LatexCommand \index{quotation} \end_inset marks, although you may need to use both). \layout SGML \layout SGML The TAB Key \begin_inset LatexCommand \index{TAB key} \end_inset \layout SGML Please note that using the TAB key (automatic-command-completion) will automatically use escapes for spaces (so you don't have to type them manually). \layout SGML \end_deeper \layout Description script \begin_inset LatexCommand \index{script} \end_inset The \begin_inset Quotes eld \end_inset \emph on script \emph default \begin_inset Quotes erd \end_inset command creates a typescript, \begin_inset LatexCommand \index{typescript} \end_inset or "capture log" of a shell session - it writes a copy \begin_inset LatexCommand \index{copy} \end_inset of your session \begin_inset LatexCommand \index{session} \end_inset to a file, including \begin_inset LatexCommand \index{including} \end_inset commands you type and their output. \layout Description \noindent ~\SpecialChar ~ (tilde\SpecialChar ~ character) \begin_inset LatexCommand \index{~} \end_inset The tilde \begin_inset LatexCommand \index{tilde} \end_inset character \begin_inset LatexCommand \index{character} \end_inset is used as an alias to a users home directory. \begin_deeper \layout Standard \noindent For example, if your user-name \begin_inset LatexCommand \index{user-name} \end_inset was \begin_inset Quotes eld \end_inset fred \begin_inset Quotes erd \end_inset , instead of typing \emph on cd /home/fred \emph default you could simply type \emph on cd \begin_inset LatexCommand \index{cd} \end_inset ~. \emph default Or to get to fred's tmp directory (under his home \begin_inset LatexCommand \index{home} \end_inset directory) you could type \emph on cd \begin_inset LatexCommand \index{cd} \end_inset ~/tmp. \layout SGML \layout SGML Home directory shortcut \layout SGML ~ (tilde) can also be used as a shortcut to other users home directories, simply type: \emph on ~user_name \emph default and it will take you to the users home directory. Note that you need to spell the username exactly correct, no wildcards. \layout SGML \end_deeper \layout Description \begin_inset Note collapsed false \layout Standard useful but for X only\SpecialChar \ldots{} xset\SpecialChar ~ -b turns off x system bell. \end_inset \layout Description set\SpecialChar ~ bell-style\SpecialChar ~ none \begin_inset LatexCommand \index{set bell-style} \end_inset This particular \begin_inset LatexCommand \index{particular} \end_inset \emph on set \emph default command will turn off \begin_inset LatexCommand \index{turn off} \end_inset the system bell \begin_inset LatexCommand \index{system bell} \end_inset from the command-line \begin_inset LatexCommand \index{command-line} \end_inset (use xset \begin_inset LatexCommand \index{xset} \end_inset -b for X windows). If you want the bell \begin_inset LatexCommand \index{bell} \end_inset to stay off pernamently (no audible \begin_inset LatexCommand \index{audible} \end_inset bell) then you can add this command to your \begin_inset Quotes eld \end_inset .bashrc \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset .bash_profile \begin_inset Quotes erd \end_inset (just add it to the same one you have your alises in\SpecialChar \ldots{} ). \layout Description reset \begin_inset LatexCommand \index{reset} \end_inset The \emph on reset \emph default command re-initializes your current terminal. \begin_inset LatexCommand \index{terminal} \end_inset This can be useful when the text \begin_inset LatexCommand \index{text} \end_inset from your terminal \begin_inset LatexCommand \index{terminal} \end_inset becomes garbled, \begin_inset LatexCommand \index{garbled} \end_inset simply type \begin_inset Quotes eld \end_inset reset \begin_inset Quotes erd \end_inset and this will fix \begin_inset LatexCommand \index{fix} \end_inset your terminal. \layout Description exit \begin_inset LatexCommand \index{exit} \end_inset Closes your current terminal (with x-terminals) or logs-out. \begin_inset LatexCommand \index{logs-out} \end_inset Also try CTRL-D. \layout Description \noindent logout \begin_inset LatexCommand \index{logout} \end_inset Logs out of a terminal, also try CTRL-D. \layout Description \noindent echo \begin_inset LatexCommand \index{echo} \end_inset A little command that repeats \begin_inset LatexCommand \index{repeats} \end_inset anything you type. \begin_deeper \layout Standard \noindent Example: \layout Code \noindent echo \begin_inset Quotes eld \end_inset hello world \begin_inset Quotes erd \end_inset \layout Standard \noindent Simply displays \begin_inset Quotes eld \end_inset hello world \begin_inset Quotes erd \end_inset . \layout Standard \noindent Example: \layout Code echo rm -R * \layout Standard This will output what will be passed \begin_inset LatexCommand \index{passed} \end_inset to the \emph on rm \begin_inset LatexCommand \index{rm} \end_inset \emph default command (and therefore what would be deleted), putting \begin_inset LatexCommand \index{putting} \end_inset echo before a command renders \begin_inset LatexCommand \index{renders} \end_inset it harmless \begin_inset LatexCommand \index{harmless} \end_inset (it just expands \begin_inset LatexCommand \index{expands} \end_inset wildcards so you know what it will do). \layout Standard Also try using the \emph on -e \begin_inset LatexCommand \index{-e} \end_inset \emph default option \begin_inset LatexCommand \index{option} \end_inset with echo. \begin_inset LatexCommand \index{echo} \end_inset This will allow \begin_inset LatexCommand \index{allow} \end_inset you to use the escape \begin_inset LatexCommand \index{escape} \end_inset character sequences \begin_inset LatexCommand \index{character sequences} \end_inset to format \begin_inset LatexCommand \index{format} \end_inset the output of a line. \begin_inset LatexCommand \index{line} \end_inset Such as ' \backslash t' for tab, \begin_inset LatexCommand \index{tab} \end_inset ' \backslash n' for newline \begin_inset LatexCommand \index{newline} \end_inset etc. \layout SGML \layout SGML Using echo to prevent accidents \layout SGML \layout SGML Typing: \emph on echo command(s) \emph default could \emph on \emph default save you the trouble of accidentally doing something you didn't expect. \layout SGML \layout SGML \layout SGML Using \emph on echo \emph default allows you to expand the wildcards to understand what will happen before you actually run the command. \layout SGML \layout SGML \end_deeper \layout Section The command-line history \begin_inset LatexCommand \label{the-command-line-history} \end_inset \layout Description Using\SpecialChar ~ the\SpecialChar ~ command\SpecialChar ~ history \begin_inset LatexCommand \index{command history} \end_inset Use the up and down key's to scroll \begin_inset LatexCommand \index{scroll} \end_inset through previously typed commands. Press [Enter] to execute \begin_inset LatexCommand \index{execute} \end_inset them or use the left and right arrow \begin_inset LatexCommand \index{arrow} \end_inset keys to edit \begin_inset LatexCommand \index{edit} \end_inset the command first. Also see \emph on history \emph default (below). \layout Description \noindent The\SpecialChar ~ history\SpecialChar ~ command The \emph on history \begin_inset LatexCommand \index{history} \end_inset \emph default command can be used to list Bash's log \begin_inset LatexCommand \index{log} \end_inset of the commands you have typed: \begin_deeper \layout Standard This log \begin_inset LatexCommand \index{log} \end_inset is called the \begin_inset Quotes eld \end_inset history \begin_inset Quotes erd \end_inset . To access \begin_inset LatexCommand \index{access} \end_inset it type: \layout Code \noindent history n \layout Standard \noindent This will only list the last \begin_inset LatexCommand \index{last} \end_inset \emph on n \emph default commands. Type \begin_inset Quotes eld \end_inset history \begin_inset Quotes erd \end_inset (without options) to see the the entire history \begin_inset LatexCommand \index{history} \end_inset list. \begin_inset LatexCommand \index{list} \end_inset \layout Standard \noindent You can also type \emph on !n \emph default \begin_inset LatexCommand \index{!n} \end_inset to execute command number \begin_inset LatexCommand \index{command number} \end_inset n. Use \emph on !! \begin_inset LatexCommand \index{!!} \end_inset \emph default to execute the last command you typed. \layout Standard \noindent \emph on !-n \begin_inset LatexCommand \index{!-n} \end_inset \emph default will execute the command n times \begin_inset LatexCommand \index{times} \end_inset before (in other words \emph on !-1 \emph default is equivalent \begin_inset LatexCommand \index{equivalent} \end_inset to \emph on !! \emph default ). \layout Standard \noindent \emph on !string \begin_inset LatexCommand \index{!string} \end_inset \emph default will execute the last command starting \begin_inset LatexCommand \index{starting} \end_inset with that \begin_inset Quotes eld \end_inset string \begin_inset Quotes erd \end_inset and \emph on !?string? \emph default will execute the last command containing the word \begin_inset Quotes eld \end_inset string \begin_inset Quotes erd \end_inset . For example: \layout Code !cd \layout Standard Will re-run the command that you last typed starting with \begin_inset Quotes eld \end_inset cd \begin_inset Quotes erd \end_inset . \layout Standard \begin_inset Note collapsed false \layout Standard the idea of the below command came from http://www.linux-mag.com/2004-05/power_01.h tml but I used my own examples and ideas here. Add them to references eventually\SpecialChar \ldots{} \end_inset \layout Standard \emph on \begin_inset Quotes eld \end_inset commandName \begin_inset LatexCommand \index{commandName} \end_inset !* \begin_inset Quotes erd \end_inset \emph default will execute the \begin_inset Quotes eld \end_inset commandName \begin_inset Quotes erd \end_inset with any arguments \begin_inset LatexCommand \index{arguments} \end_inset you used on your last command. This maybe useful if you make a spelling \begin_inset LatexCommand \index{spelling} \end_inset mistake, for example. If you typed: \layout Code emasc /home/fred/mywork.java /tmp/testme.java \layout Standard In an attempt \begin_inset LatexCommand \index{attempt} \end_inset to execute emacs \begin_inset LatexCommand \index{emacs} \end_inset on the above two files this will obviously fail. \begin_inset LatexCommand \index{fail} \end_inset So what you can do is type: \layout Code emacs !* \layout Standard This will execute emacs \begin_inset LatexCommand \index{emacs} \end_inset with the arguments \begin_inset LatexCommand \index{arguments} \end_inset that you last typed on the command-line. \begin_inset LatexCommand \index{command-line} \end_inset In other words this is equivalent \begin_inset LatexCommand \index{equivalent} \end_inset to typing: \layout Code emacs /home/fred/mywork.java /tmp/testme.java \end_deeper \layout Description Searching\SpecialChar ~ through\SpecialChar ~ the\SpecialChar ~ Command\SpecialChar ~ History\SpecialChar ~ (CTRL-R) \begin_inset LatexCommand \index{Command History} \end_inset Use the CTRL-R key \begin_inset LatexCommand \index{key} \end_inset to perform \begin_inset LatexCommand \index{perform} \end_inset a \begin_inset Quotes eld \end_inset reverse-i-search \begin_inset Quotes erd \end_inset . For example, if you wanted to use the command you used the last time you used \emph on snort \emph default \begin_inset LatexCommand \index{snort} \end_inset , you would type: \begin_deeper \layout SGML \layout SGML \noindent \layout SGML \noindent CTRL \layout SGML \noindent R \layout SGML \noindent then type \begin_inset Quotes eld \end_inset snort \begin_inset Quotes erd \end_inset . \layout SGML \layout Standard \noindent What you will see in the console \begin_inset LatexCommand \index{console} \end_inset window \begin_inset LatexCommand \index{window} \end_inset is: \layout Code (reverse-i-search)`': \layout Standard \family roman After you have typed what you are looking for, use the \family default CTRL-R key combination \begin_inset LatexCommand \index{key combination} \end_inset to scroll \begin_inset LatexCommand \index{scroll} \end_inset backward through the history. \begin_inset LatexCommand \index{history} \end_inset \layout Standard \family roman Use \family default CTRL-R repeatedly \begin_inset LatexCommand \index{repeatedly} \end_inset \family roman to find \begin_inset LatexCommand \index{find} \end_inset \family default every \family roman reference \begin_inset LatexCommand \index{reference} \end_inset to the string \begin_inset LatexCommand \index{string} \end_inset you've entered. \begin_inset LatexCommand \index{entered} \end_inset Once you've found \begin_inset LatexCommand \index{found} \end_inset the command you're looking for \family default , \family roman use [Enter] to execute it. \layout Standard Alternatively, \begin_inset LatexCommand \index{alternatively} \end_inset \family roman using the right or left arrow keys \begin_inset LatexCommand \index{arrow keys} \end_inset will place \begin_inset LatexCommand \index{place} \end_inset the command on an actual command \family default - \family roman line \begin_inset LatexCommand \index{command-line} \end_inset so you can \family default edit it. \layout Standard \begin_inset Note collapsed false \layout Standard last sentence left because as Chris pointed out you can't assume that someone will read this start to finish. They may just look at a few commands or just 1 section. \end_inset \end_deeper \layout Section Other Key combinations \begin_inset LatexCommand \label{other-Key-combinations} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard it would be nice to do this all on one line. But I think I would have to do the entire \SpecialChar \ldots{} \SpecialChar \ldots{} \SpecialChar \ldots{} and then I'd be writing SGML (ruining the point of using LyX :P). Re-did the style of the command here\SpecialChar \ldots{} \end_inset \layout Standard GNU/Linux shells \begin_inset LatexCommand \index{shells} \end_inset have many shortcut \begin_inset LatexCommand \index{shortcut} \end_inset keys which you can use to speed \begin_inset LatexCommand \index{speed} \end_inset up your work, below is a rough list of some (also see CTRL-R in the history \begin_inset LatexCommand \index{history} \end_inset section of the commands, over here, \begin_inset LatexCommand \ref{the-command-line-history} \end_inset ). \layout Description CTRL-D the \begin_inset Quotes eld \end_inset end-of-file \begin_inset Quotes erd \end_inset (EOF) key combination can be used to quickly log out of any terminal. CTRL-D is also used in programs such as \emph on \begin_inset Quotes eld \end_inset at \begin_inset Quotes erd \end_inset \emph default to signal that you have finished typing your commands (the EOF command). \layout Description CTRL-Z key combination \begin_inset LatexCommand \index{key combination} \end_inset is used to stop a process. It can be used to put something in the background temporarily. \begin_deeper \layout Standard \noindent For example, if you were editing a file with \emph on vim \emph default or \emph on emacs \emph default just press CTRL-Z to regain control of the terminal do what you want and then type \emph on fg \emph default \begin_inset LatexCommand \index{fg} \end_inset \emph on \emph default to bring it back. \layout Standard For further information please see \begin_inset LatexCommand \ref{controlling-processes} \end_inset . \layout SGML \layout SGML If \emph on fg \emph default doesn't work \layout SGML If \emph on fg \emph default doesn't work you may need to type \emph on jobs \emph default and then \emph on fg job_name or fg job_number \emph default \layout SGML \end_deeper \layout Description CTRL-A\SpecialChar ~ and\SpecialChar ~ CTRL-E These key combinations are used for going to the start and end of the line on the command line. Use CTRL-A to jump to the start of the line, and CTRL-E to jump to the end of the line. \layout Description CTRL-K This key combination can be used to cut or delete what is currently in front of the cursor. \layout Description CTRL-Y This key combination can be used to paste the last thing you deleted (using CTRL-K or CTRL-W). \layout Description CTRL-W This key combination can be used to cut or delete the entire line that has being typed. \layout Section Virtual Terminals and screen \begin_inset LatexCommand \label{virtual-terminals} \end_inset \layout SGML \noindent Using the key combination \layout SGML \noindent \layout SGML \noindent ALT \layout SGML \noindent F* \layout SGML \layout SGML \noindent keys you may change to different virtual terminals. You will have several (usually 6) virtual terminals setup with shells. Number 7 is usually setup with X you need to use CTRL-ALT-F* to change to a terminal from within X (X as in the X windowing system). \layout SGML \layout Description screen \begin_inset LatexCommand \index{screen} \end_inset \begin_inset LatexCommand \index{virtual terminals} \end_inset is a great program that allows \begin_inset LatexCommand \index{allows} \end_inset you to switch \begin_inset LatexCommand \index{switch} \end_inset between multiple virtual terminals \begin_inset LatexCommand \index{virtual terminals} \end_inset on the one physical \begin_inset LatexCommand \index{physical} \end_inset terminal that you are using. Its a command-line \begin_inset LatexCommand \index{command-line} \end_inset based window manager \begin_inset LatexCommand \index{window manager} \end_inset , clearly this isn't that useful if you do have virtual terminals, but its amazingly useful when you log \begin_inset LatexCommand \index{log} \end_inset into machines remotely, using ssh \begin_inset LatexCommand \index{ssh} \end_inset and similar, see \begin_inset LatexCommand \ref{remote-administration} \end_inset . It works on key-combinations, \begin_inset LatexCommand \index{key-combinations} \end_inset you type \begin_deeper \layout Code screen \layout Standard On the command-line to begin. Now you start with one virtual terminal by default, but using the key combinati on CTRL-A and then hitting "C" you can create another virtual terminal to use. \layout Standard Use CTRL-N to go to the next virtual terminal and CTRL-P to go to the previous virtual terminal. Also try hitting CTRL-A to go backwards and forwards between two particular terminals. \layout Standard \emph on screen \emph default \begin_inset LatexCommand \index{screen} \end_inset also has various other abilities \begin_inset LatexCommand \index{abilities} \end_inset that you can test \begin_inset LatexCommand \index{test} \end_inset out. The documentation \begin_inset LatexCommand \index{documentation} \end_inset and guides are well written so please feel free to read the manual \begin_inset LatexCommand \index{manual} \end_inset page \begin_inset LatexCommand \index{page} \end_inset or try searching \begin_inset LatexCommand \index{searching} \end_inset the internet. \begin_inset LatexCommand \index{internet} \end_inset \end_deeper \layout Chapter Help \begin_inset LatexCommand \label{Help} \end_inset \layout Standard The help \begin_inset LatexCommand \index{help} \end_inset chapter provides \begin_inset LatexCommand \index{provides} \end_inset information on how you may access the documentation \begin_inset LatexCommand \index{documentation} \end_inset of the GNU/Linux system. There is normally a document \begin_inset LatexCommand \index{document} \end_inset describing every single tool you have installed, \begin_inset LatexCommand \index{installed} \end_inset even if its only brief\SpecialChar \ldots{} \layout Description man \begin_inset LatexCommand \index{man} \end_inset This command displays summary \begin_inset LatexCommand \index{summary} \end_inset information \begin_inset LatexCommand \index{information} \end_inset on a program from an online \begin_inset LatexCommand \index{online} \end_inset manual. \begin_inset LatexCommand \index{manual} \end_inset For example typing \emph on man man \emph default will bring up the manual \begin_inset LatexCommand \index{manual} \end_inset page for man (the manual \begin_inset LatexCommand \index{manual} \end_inset page viewer). Note: q is the quit \begin_inset LatexCommand \index{quit} \end_inset key. \begin_deeper \layout Standard Command syntax: \layout Code man program_name \layout SGML \layout SGML Also try \layout SGML Specifying the section of the manual page, sometimes the man page is different for the same tool in different sections, note sections are numbered 1 to 9. Use apropos to find which section number to look in. \layout SGML \layout SGML \layout SGML The syntax to look at a different section is: \layout SGML \layout SGML man section_number tool_name \layout SGML \layout SGML For example: \layout SGML \layout SGML man 2 time \layout SGML \layout SGML This will show you the man page called time in section 2, the equivalent page in section 1 is completely different \layout SGML \layout SGML \end_deeper \layout Description man\SpecialChar ~ -K\SpecialChar ~ keyword \begin_inset LatexCommand \index{man -K} \end_inset Search the manual \begin_inset LatexCommand \index{manual} \end_inset pages for a string, \begin_inset LatexCommand \index{string} \end_inset as in it will search \begin_inset LatexCommand \index{search} \end_inset all manual \begin_inset LatexCommand \index{manual} \end_inset pages for a particular string within each individual \begin_inset LatexCommand \index{individual} \end_inset man page, it will then prompt \begin_inset LatexCommand \index{prompt} \end_inset whether you would like to view \begin_inset LatexCommand \index{view} \end_inset each page it will find. Use double \begin_inset LatexCommand \index{double} \end_inset quotes \begin_inset Quotes eld \end_inset and \begin_inset Quotes erd \end_inset if there are spaces \begin_inset LatexCommand \index{spaces} \end_inset in the string you are typing. \begin_deeper \layout SGML \layout SGML Speed issue \layout SGML Please be warned that this method is going to be really, really slow. You are searching *all* man pages for a string \layout SGML \end_deeper \layout Description man\SpecialChar ~ -f\SpecialChar ~ command \begin_inset LatexCommand \index{man -f} \end_inset This will list \begin_inset LatexCommand \index{list} \end_inset details \begin_inset LatexCommand \index{details} \end_inset associated \begin_inset LatexCommand \index{associated} \end_inset with the command. The root \begin_inset LatexCommand \index{root} \end_inset user must run \begin_inset LatexCommand \index{run} \end_inset \emph on makewhatis \emph default \begin_inset LatexCommand \index{makewhatis} \end_inset (see below) before this command will work. \begin_deeper \layout SGML \series medium \layout SGML \series medium \series default Equivalent to \emph on whatis \series medium \emph default \layout SGML \series medium \series default This command is the same as running \emph on whatis \layout SGML \series medium \layout SGML \series medium \end_deeper \layout Description info \begin_inset LatexCommand \index{info} \end_inset Provides a more detailed \begin_inset LatexCommand \index{detailed} \end_inset hyper-text manual \begin_inset LatexCommand \index{manual} \end_inset on a particular command, this only works for some commands. \begin_deeper \layout Standard Command syntax: \layout Code info program_name \end_deeper \layout Description whatis \begin_inset LatexCommand \index{whatis} \end_inset Displays a one-line description \begin_inset LatexCommand \index{description} \end_inset of what a program \begin_inset LatexCommand \index{program} \end_inset does. The string needs to be an exact \begin_inset LatexCommand \index{exact} \end_inset match, otherwise \emph on whatis \emph default won't output \begin_inset LatexCommand \index{output} \end_inset anything. Relies on the whatis database (see below). \begin_deeper \layout Standard Command syntax: \layout Code whatis program_name \end_deeper \layout Description \noindent makewhatis \begin_inset LatexCommand \index{makewhatis} \end_inset Make the whatis database for \emph on apropos \emph default , \emph on whatis \emph default and \emph on man -f. \begin_inset LatexCommand \index{-f} \end_inset \emph default \begin_deeper \layout SGML \noindent \layout SGML \noindent Root Privileges \layout SGML \noindent This takes some time and you require root privileges to do this. \layout SGML \noindent \end_deeper \layout Description apropos \begin_inset LatexCommand \index{apropos} \end_inset Searches \begin_inset LatexCommand \index{Searches} \end_inset the whatis database for strings, \begin_inset LatexCommand \index{strings} \end_inset similar to \emph on whatis \emph default except it finds \begin_inset LatexCommand \index{finds} \end_inset and prints \begin_inset LatexCommand \index{prints} \end_inset anything matching \begin_inset LatexCommand \index{matching} \end_inset the string (or any part of the string). Also relies on the whatis database (see above). \begin_deeper \layout Standard Command syntax: \layout Code apropos string \layout SGML \layout SGML Equivalent to... \layout SGML \emph on apropos \emph default is the same as doing \emph on man -k \emph default (lowercase k). \layout SGML \end_deeper \layout SGML \layout SGML Please note \layout SGML \layout SGML You need to run \emph on makewhatis \emph default (as root) so \emph on whatis \emph default , \emph on man -f \emph default and \emph on apropos \emph default will work. \layout SGML \layout SGML \layout SGML \layout SGML Also try \layout SGML \layout SGML Using a program with the \emph on -? \emph default , \begin_inset LatexCommand \index{-?} \end_inset \emph on --h \emph default , \begin_inset LatexCommand \index{--h} \end_inset \emph on --help \emph default \begin_inset LatexCommand \index{--help} \end_inset , and the \emph on -h \begin_inset LatexCommand \index{-h} \end_inset \emph default options, they will display very short summary information on the command usage options. \layout SGML \layout SGML \layout Chapter Directing Input/Output \begin_inset LatexCommand \label{Directing-input-ouput} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard brand new section \layout Standard hopefully my File Stream theory is correct, its based off C as well as UNIX\SpecialChar \ldots{} \layout Standard Concept definitions have never being used before\SpecialChar \ldots{} (have been used once about alises) \layout Standard kind of out of place in this guide but I don't know how else to put it for now. \end_inset \layout Standard The directing input/output chapter explains \begin_inset LatexCommand \index{explains} \end_inset how you can use a program and send \begin_inset LatexCommand \index{send} \end_inset its output to a file or to another command that you wish to use. This technique \begin_inset LatexCommand \index{technique} \end_inset is very powerful \begin_inset LatexCommand \index{powerful} \end_inset and there are a number \begin_inset LatexCommand \index{number} \end_inset of ways of doing this. \layout Section Concept Definitions \begin_inset LatexCommand \label{concept-definitions} \end_inset \layout Standard All three of the following \begin_inset LatexCommand \index{following} \end_inset definitions \begin_inset LatexCommand \index{definitions} \end_inset are called \begin_inset Quotes eld \end_inset File Streams. \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{File Streams} \end_inset \begin_inset LatexCommand \index{Streams} \end_inset They hold information that is either received \begin_inset LatexCommand \index{received} \end_inset from somewhere or sent to somewhere. In a UNIX \begin_inset LatexCommand \index{UNIX} \end_inset system, the keyboard \begin_inset LatexCommand \index{keyboard} \end_inset input (standard input), information printed to the screen \begin_inset LatexCommand \index{screen} \end_inset (standard output) and error \begin_inset LatexCommand \index{error} \end_inset output (also printed \begin_inset LatexCommand \index{printed} \end_inset to the screen) are treated as separate File Streams. \layout Description Standard\SpecialChar ~ output Standard output \begin_inset LatexCommand \index{Standard output} \end_inset is the output from the program printed \begin_inset LatexCommand \index{printed} \end_inset to the screen, \begin_inset LatexCommand \index{screen} \end_inset not including error output \begin_inset LatexCommand \index{Error output} \end_inset (see below). \layout Description Standard\SpecialChar ~ input Standard input \begin_inset LatexCommand \index{Standard input} \end_inset is the input \begin_inset LatexCommand \index{input} \end_inset from the user. Normally the keyboard \begin_inset LatexCommand \index{keyboard} \end_inset is used as the standard input \begin_inset LatexCommand \index{standard input} \end_inset device in a UNIX \begin_inset LatexCommand \index{UNIX} \end_inset system. \layout Description Standard\SpecialChar ~ error Standard error \begin_inset LatexCommand \index{Standard error} \end_inset is error \begin_inset LatexCommand \index{error} \end_inset output from programs. \begin_inset LatexCommand \index{programs} \end_inset This output is also sent to the screen \begin_inset LatexCommand \index{screen} \end_inset and will normally be seen mixed \begin_inset LatexCommand \index{mixed} \end_inset in with standard output. \begin_inset LatexCommand \index{standard output} \end_inset The difference \begin_inset LatexCommand \index{difference} \end_inset between standard output \begin_inset LatexCommand \index{standard output} \end_inset and standard error \begin_inset LatexCommand \index{standard error} \end_inset is that standard error is unbuffered \begin_inset LatexCommand \index{unbuffered} \end_inset (it appears immediately on the screen) and standard error is only printed \begin_inset LatexCommand \index{printed} \end_inset when something goes wrong (it will give you details of what went wrong). \layout Section Usage \begin_inset LatexCommand \label{usage-input-output} \end_inset \layout Description > \begin_inset LatexCommand \index{>} \end_inset The greater \begin_inset LatexCommand \index{greater} \end_inset than symbol \begin_inset LatexCommand \index{symbol} \end_inset is used to send \begin_inset LatexCommand \index{send} \end_inset information somewhere (for example a text file) \begin_deeper \layout Standard Example: \layout Code cat file1 file2 > file1_and_2.txt \layout Standard This will concatenate \begin_inset LatexCommand \index{concatenate} \end_inset the files together into one big file named \begin_inset Quotes eld \end_inset file1_and_2.txt \begin_inset Quotes erd \end_inset . Note that this will overwrite \begin_inset LatexCommand \index{overwrite} \end_inset any existing \begin_inset LatexCommand \index{existing} \end_inset file. \end_deeper \layout Description \noindent < \begin_inset LatexCommand \index{<} \end_inset The less \begin_inset LatexCommand \index{less} \end_inset than symbol will insert \begin_inset LatexCommand \index{insert} \end_inset information from somewhere (a text file) as if you typed it yourself. Often used with commands that are designed \begin_inset LatexCommand \index{designed} \end_inset to get information from standard input \begin_inset LatexCommand \index{standard input} \end_inset only. \begin_deeper \layout Standard \noindent For example (using tr): \layout Code tr '[A-Z]' '[a-z]' < fileName.txt > fileNameNew.txt \layout Standard The example above would insert \begin_inset LatexCommand \index{insert} \end_inset the contents \begin_inset LatexCommand \index{contents} \end_inset of \begin_inset Quotes eld \end_inset fileName.txt \begin_inset Quotes erd \end_inset into the input \begin_inset LatexCommand \index{input} \end_inset of \emph on tr \emph default \begin_inset LatexCommand \index{tr} \end_inset and output the results \begin_inset LatexCommand \index{results} \end_inset to \begin_inset Quotes eld \end_inset fileNameNew.txt \begin_inset Quotes erd \end_inset . \end_deeper \layout Description \noindent >> \begin_inset LatexCommand \index{>>} \end_inset The >> symbol \begin_inset LatexCommand \index{symbol} \end_inset appends (adds) information to the end of a file or creates one if the file doesn't exist. \begin_inset LatexCommand \index{exist} \end_inset \layout Description << \begin_inset LatexCommand \index{<<} \end_inset The << symbol \begin_inset LatexCommand \index{symbol} \end_inset is sometimes used with commands that use standard input \begin_inset LatexCommand \index{standard input} \end_inset to take information. You simply type \emph on << word \emph default (where word can be any string) at the end \begin_inset LatexCommand \index{end} \end_inset of the command. However its main use is in shell scripting. \begin_inset LatexCommand \index{shell scripting} \end_inset \begin_deeper \layout Standard The command takes your input until you type \begin_inset Quotes eld \end_inset word \begin_inset Quotes erd \end_inset , which causes the command to terminate \begin_inset LatexCommand \index{terminate} \end_inset and process \begin_inset LatexCommand \index{process} \end_inset the input. \layout Standard Using << is similar to using CTRL-D (EOF key) \emph on , \emph default except it uses a string \begin_inset LatexCommand \index{string} \end_inset to perform \begin_inset LatexCommand \index{perform} \end_inset the end-of-file function. This design allows it to be used in shell scripts. \begin_inset LatexCommand \index{shell scripts} \end_inset \layout Standard For example type "cat" \begin_inset LatexCommand \index{cat} \end_inset (with no options\SpecialChar \ldots{} ) and it will work on standard input. \begin_inset LatexCommand \index{standard input} \end_inset \layout Standard To stop \begin_inset LatexCommand \index{stop} \end_inset entering standard input \begin_inset LatexCommand \index{standard input} \end_inset you would normally hit CTRL-D. \layout Standard As an alternative \begin_inset LatexCommand \index{alternative} \end_inset you can type "cat << FINISHED", then type what you want. \layout Standard When you are finished, \begin_inset LatexCommand \index{finished} \end_inset instead of hitting \begin_inset LatexCommand \index{hitting} \end_inset CTRL-D you could type "FINISHED" \begin_inset LatexCommand \index{FINISHED} \end_inset and it will end (the word FINISHED will not be recorded). \layout Standard \begin_inset Note collapsed false \layout Standard I don't personally use that but it might be useful for some people and other people said this explanation made perfect sense to them\SpecialChar \ldots{} \end_inset \end_deeper \layout Description \noindent 2> \begin_inset LatexCommand \index{2>} \end_inset Redirects error output. \begin_inset LatexCommand \index{error output} \end_inset For example, to redirect \begin_inset LatexCommand \index{redirect} \end_inset the error output \begin_inset LatexCommand \index{error output} \end_inset to /dev/null \begin_inset LatexCommand \index{/dev/null} \end_inset , so you do not see it, simply append this to the end of another command\SpecialChar \ldots{} \begin_deeper \layout Standard \noindent For example: \layout Code make some_file 2> /dev/null \layout Standard This will run make on a file and send \begin_inset LatexCommand \index{send} \end_inset all error output to /dev/null \end_deeper \layout Description | \begin_inset LatexCommand \index{|} \end_inset \begin_inset LatexCommand \index{pipe} \end_inset The \begin_inset Quotes eld \end_inset pipe \begin_inset Quotes erd \end_inset command allows the output of one command to be sent to the input of another. \begin_deeper \layout Standard For example: \layout Code \noindent cat file1.txt file2.txt | less \layout Standard \noindent Concatenates \begin_inset LatexCommand \index{Concatenates} \end_inset the files together, then runs \emph on less \emph default on them. If you are only going to look \begin_inset LatexCommand \index{look} \end_inset at a single file, you would simply use \emph on less \begin_inset LatexCommand \index{less} \end_inset \emph default on the file\SpecialChar \ldots{} \end_deeper \layout Description \noindent tee \begin_inset LatexCommand \index{tee} \end_inset Sends output of a program to a file and to standard output. \begin_inset LatexCommand \index{standard output} \end_inset Think of it as a \family sans T \family default intersection\SpecialChar \ldots{} it goes two ways. \begin_deeper \layout Standard For example: \layout Code ls /home/user | tee my_directories.txt \layout Standard Lists \begin_inset LatexCommand \index{Lists} \end_inset the files (displays the output on the screen) and sends \begin_inset LatexCommand \index{sends} \end_inset the output to a file: \begin_inset Quotes eld \end_inset my_directories.txt \begin_inset Quotes erd \end_inset . \end_deeper \layout Description \noindent &> \begin_inset LatexCommand \index{&>} \end_inset Redirects standard output \begin_inset LatexCommand \index{standard output} \end_inset and error output \begin_inset LatexCommand \index{error output} \end_inset to a specific \begin_inset LatexCommand \index{specific} \end_inset location. \begin_inset LatexCommand \index{location} \end_inset \begin_deeper \layout Standard \noindent For example: \layout Code make &> /dev/null \layout Standard Sends \begin_inset LatexCommand \index{Sends} \end_inset both error output \begin_inset LatexCommand \index{error output} \end_inset and standard output \begin_inset LatexCommand \index{standard output} \end_inset to /dev/null so you won't see anything\SpecialChar \ldots{} \end_deeper \layout Section Command Substitution \begin_inset LatexCommand \label{command-substitution} \end_inset \begin_inset Note collapsed false \layout Standard these two sub-sections (6.3, 6.4) are not formatted like any other subsection. Should probably fix them eventually. --broken into 3 subsections, looks better now \layout Standard And I think it comes out ok\SpecialChar \ldots{} , should I only show one method? (to save space and be more concise?) \end_inset \layout Standard Command substitution \begin_inset LatexCommand \index{command substitution} \end_inset is basically another way to do a pipe, \begin_inset LatexCommand \index{pipe} \end_inset you can use pipes and command substitution interchangeably, \begin_inset LatexCommand \index{interchangeably} \end_inset it's up to you which one you find easier\SpecialChar \ldots{} \layout Standard Command substitution can be done in two distinct \begin_inset LatexCommand \index{distinct} \end_inset ways. \layout Description \begin_inset Note collapsed false \layout Standard these descriptions below were subsections but they don't look too good in the output because they get there own HTML page each! And I can't get bold to work in standard mode!!! \end_inset \layout Description Method\SpecialChar ~ One\SpecialChar ~ (back-quotes) \begin_inset LatexCommand \label{command-substitution-back-quotes} \end_inset \begin_deeper \layout Standard Simply type: \layout Code command_1 `command_2 -options` \layout Standard This will execute \begin_inset LatexCommand \index{execute} \end_inset \begin_inset Quotes eld \end_inset command_2 \begin_inset Quotes erd \end_inset and it's output \begin_inset LatexCommand \index{output} \end_inset will become the input to \begin_inset Quotes eld \end_inset command_1 \begin_inset Quotes erd \end_inset . \layout SGML \layout SGML Backquote key \layout SGML \layout SGML The back-quote key is usually located at the same place as the tilde, above the [Tab] key. \layout SGML \layout SGML \end_deeper \layout Description Method\SpecialChar ~ Two\SpecialChar ~ (dollars\SpecialChar ~ sign) \begin_inset LatexCommand \label{command-substitution-dollars-sign} \end_inset \begin_deeper \layout Standard Simply type: \layout Code command_1 $(command_2) \layout Standard This will execute \begin_inset Quotes eld \end_inset command_2 \begin_inset Quotes erd \end_inset and it's output will become the input to \begin_inset Quotes eld \end_inset command_1 \begin_inset Quotes erd \end_inset . \end_deeper \layout Description Using\SpecialChar ~ the\SpecialChar ~ pipe\SpecialChar ~ instead \begin_inset LatexCommand \label{command-substitution-pipe} \end_inset \begin_deeper \layout Standard You can of course use pipes \begin_inset LatexCommand \index{pipes} \end_inset to do the same thing, if you don't know what a pipe \begin_inset LatexCommand \index{pipe} \end_inset is, please see \begin_inset LatexCommand \ref{usage-input-output} \end_inset . For example instead of doing: \layout Code less $cat file1.txt file2.txt \layout Standard You could do: \layout Code cat file1.txt file2.txt | less \layout Standard And end up with exactly \begin_inset LatexCommand \index{exactly} \end_inset the same result, \begin_inset LatexCommand \index{result} \end_inset it's up to you which way you find easier. \end_deeper \layout Section Performing more than one command \begin_inset LatexCommand \label{performing-more-than-one-command} \end_inset \layout Description Executing\SpecialChar ~ the\SpecialChar ~ second\SpecialChar ~ command\SpecialChar ~ only\SpecialChar ~ if\SpecialChar ~ the\SpecialChar ~ first\SpecialChar ~ is\SpecialChar ~ successful \begin_inset LatexCommand \label{execute-command-2-if-1-works} \end_inset \begin_deeper \layout Standard To do this you would type: \layout Code command1 && command2 \layout Standard \begin_inset LatexCommand \index{&&} \end_inset command2 \begin_inset LatexCommand \index{command2} \end_inset will be executed if command1 \begin_inset LatexCommand \index{command1} \end_inset successfully completes (if command1 fails \begin_inset LatexCommand \index{fails} \end_inset command2 \begin_inset LatexCommand \index{command2} \end_inset won't be run). This is called a logical \begin_inset LatexCommand \index{logical} \end_inset AND. \begin_inset LatexCommand \index{AND} \end_inset \begin_inset Note collapsed false \layout Standard not sure if thats correct (the && explanation) \end_inset \end_deeper \layout Description Executing\SpecialChar ~ the\SpecialChar ~ second\SpecialChar ~ command\SpecialChar ~ only\SpecialChar ~ if\SpecialChar ~ the\SpecialChar ~ first\SpecialChar ~ fails \begin_inset LatexCommand \label{execute-command-2-if-1-fails} \end_inset \begin_deeper \layout Standard To do this you would type: \layout Code command1 || command2 \layout Standard \begin_inset LatexCommand \index{||} \end_inset command2 \begin_inset LatexCommand \index{command2} \end_inset will be executed if command1 \begin_inset LatexCommand \index{command1} \end_inset does not successfully complete (if command1 \begin_inset LatexCommand \index{command1} \end_inset is successful \begin_inset LatexCommand \index{successful} \end_inset command2 won't be run). This is called a logical \begin_inset LatexCommand \index{logical} \end_inset OR. \begin_inset LatexCommand \index{OR} \end_inset \begin_inset Note collapsed false \layout Standard more useful in programming or shell scripting then in normal use but added anyway\SpecialChar \ldots{} \end_inset \end_deeper \layout Description Executing\SpecialChar ~ commands\SpecialChar ~ sequentially \begin_inset LatexCommand \label{executing-commands-sequentially} \end_inset \begin_deeper \layout Standard To execute commands sequentially \begin_inset LatexCommand \index{sequentially} \end_inset regardless of the success/failure of the previous \begin_inset LatexCommand \index{previous} \end_inset you simply type: \layout Code \noindent command1; command2 \layout Standard \noindent \begin_inset LatexCommand \index{;} \end_inset command2 \begin_inset LatexCommand \index{command2} \end_inset will execute once command1 \begin_inset LatexCommand \index{command1} \end_inset has completed. \layout SGML \noindent \layout SGML \noindent More than two commands \layout SGML \noindent You can continue to use ';' (semicolon) characters to do more and more commands on the one line. \layout SGML \noindent \end_deeper \layout Chapter \noindent Working with the file-system \begin_inset LatexCommand \label{Working-with-the-file-system} \end_inset \layout Standard The working with the file-system \begin_inset LatexCommand \index{file-system} \end_inset chapter explains a number \begin_inset LatexCommand \index{number} \end_inset of commands that you use to move around the file system \begin_inset LatexCommand \index{file system} \end_inset hierarchy \begin_inset LatexCommand \index{hierarchy} \end_inset and manipulate \begin_inset LatexCommand \index{manipulate} \end_inset the files. Also explained are finding \begin_inset LatexCommand \index{finding} \end_inset files and how to mass-rename \begin_inset LatexCommand \index{mass-rename} \end_inset files. \layout Section Moving around the filesystem \begin_inset LatexCommand \label{using-filesystem} \end_inset \layout Description cd \begin_inset LatexCommand \index{cd} \end_inset Change directory. Use \emph on \begin_inset Quotes eld \end_inset cd .. \begin_inset Quotes erd \end_inset \emph default to go up one directory. \begin_deeper \layout Standard \noindent One dot \begin_inset LatexCommand \index{dot} \end_inset '.' represents \begin_inset LatexCommand \index{represents} \end_inset the current directory \begin_inset LatexCommand \index{current directory} \end_inset while two dots \begin_inset LatexCommand \index{dots} \end_inset '..' represent \begin_inset LatexCommand \index{represent} \end_inset the parent directory. \begin_inset LatexCommand \index{parent directory} \end_inset \layout Standard \noindent \emph on \begin_inset Quotes eld \end_inset cd - \begin_inset Quotes erd \end_inset \emph default will return \begin_inset LatexCommand \index{return} \end_inset you to the previous \begin_inset LatexCommand \index{previous} \end_inset directory (a bit like an \begin_inset Quotes eld \end_inset undo \begin_inset Quotes erd \end_inset ). \layout Standard \noindent You can also use \emph on cd absolute\SpecialChar ~ path \emph default or \emph on cd relative\SpecialChar ~ path \emph default (see below): \layout Description \noindent Absolute\SpecialChar ~ paths \begin_inset LatexCommand \index{Absolute path} \end_inset An \begin_inset Quotes eld \end_inset absolute path \begin_inset Quotes erd \end_inset is easily recognised \begin_inset LatexCommand \index{recognised} \end_inset from the leading \begin_inset LatexCommand \index{leading} \end_inset forward slash, /. The / \begin_inset LatexCommand \index{/} \end_inset means that you start \begin_inset LatexCommand \index{start} \end_inset at the top level directory and continue down. \layout Standard \noindent For example to get to /boot/grub \emph on \emph default you would type: \layout Code \noindent cd /boot/grub \layout Standard \noindent This is an absolute path because you start at the top of the hierarchy and go downwards \begin_inset LatexCommand \index{downwards} \end_inset from there (it doesn't matter where in the filesystem \begin_inset LatexCommand \index{filesystem} \end_inset you were when you typed the command). \layout Description \noindent Relative\SpecialChar ~ paths \begin_inset LatexCommand \index{Relative paths} \end_inset A \begin_inset Quotes eld \end_inset relative path \begin_inset Quotes erd \end_inset doesn't have a preceding \begin_inset LatexCommand \index{preceding} \end_inset slash. Use a relative path when you start from a directory below the top \begin_inset LatexCommand \index{top} \end_inset level directory structure. This is dependent \begin_inset LatexCommand \index{dependent} \end_inset on where you are in the filesystem. \begin_inset LatexCommand \index{filesystem} \end_inset \begin_deeper \layout Standard \noindent For example \emph on \emph default if you are in root's home \begin_inset LatexCommand \index{home} \end_inset directory and want to get to /root/music, you type: \layout Code \noindent cd music \end_deeper \layout Standard Please note that there is no / using the above \emph on cd \begin_inset LatexCommand \index{cd} \end_inset \emph default command. Using a / would cause \begin_inset LatexCommand \index{cause} \end_inset this to be an absolute \begin_inset LatexCommand \index{absolute} \end_inset path, \begin_inset LatexCommand \index{path} \end_inset working from the top \begin_inset LatexCommand \index{top} \end_inset of the hierarchy downward. \end_deeper \layout Description \noindent ls \begin_inset LatexCommand \index{ls} \end_inset List files and directories. \begin_inset LatexCommand \index{directories} \end_inset Typing \begin_inset Quotes eld \end_inset ls \begin_inset Quotes erd \end_inset will list \begin_inset LatexCommand \index{list} \end_inset files and directories, but will not list hidden \begin_inset LatexCommand \index{hidden} \end_inset files or directories \begin_inset LatexCommand \index{directories} \end_inset that start with a leading full stop \begin_inset LatexCommand \index{leading} \end_inset \begin_inset Quotes eld \end_inset . \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{.} \end_inset . \begin_deeper \layout Standard \noindent Example options: \layout Itemize \noindent \emph on ls -l \emph default --- long \begin_inset LatexCommand \index{-l} \end_inset \begin_inset LatexCommand \index{long} \end_inset style, \begin_inset LatexCommand \index{style} \end_inset this lists \begin_inset LatexCommand \index{lists} \end_inset permissions, file size, \begin_inset LatexCommand \index{size} \end_inset modification \begin_inset LatexCommand \index{modification} \end_inset date, \begin_inset LatexCommand \index{date} \end_inset ownership. \begin_inset LatexCommand \index{ownership} \end_inset \begin_inset Note collapsed false \layout Standard not sure if its modification date or creation date\SpecialChar \ldots{} \end_inset \layout Itemize \noindent \emph on ls -a \emph default --- \begin_inset LatexCommand \index{-a} \end_inset this means "show all", this shows \begin_inset LatexCommand \index{shows} \end_inset hidden \begin_inset LatexCommand \index{hidden} \end_inset files, by default \begin_inset LatexCommand \index{default} \end_inset any file or directory \begin_inset LatexCommand \index{directory} \end_inset starting \begin_inset LatexCommand \index{starting} \end_inset with a '.' will not be shown. \begin_inset LatexCommand \index{shown} \end_inset \layout Itemize \noindent \emph on ls -d \emph default --- \begin_inset LatexCommand \index{-d} \end_inset list directory entires rather than contents \begin_inset LatexCommand \index{contents} \end_inset (see example below) \layout Itemize \noindent \emph on ls -F \emph default --- \begin_inset LatexCommand \index{-F} \end_inset append \begin_inset LatexCommand \index{append} \end_inset symbols \begin_inset LatexCommand \index{symbols} \end_inset to particular files, such as * (asterisk) for executable \begin_inset LatexCommand \index{executable} \end_inset files. \layout Itemize \emph on ls -S \emph default --- \begin_inset LatexCommand \index{-S} \end_inset sort \begin_inset LatexCommand \index{sort} \end_inset the output of the command in decending \begin_inset LatexCommand \index{decending} \end_inset order \begin_inset LatexCommand \index{order} \end_inset sorted \begin_inset LatexCommand \index{sorted} \end_inset by size. \layout Itemize \emph on ls -R \emph default --- \begin_inset LatexCommand \index{-R} \end_inset (recursive) to list everything \begin_inset LatexCommand \index{everything} \end_inset in the directories \begin_inset LatexCommand \index{directories} \end_inset below as well as the current directory. \layout Standard \noindent Command syntax, either: \layout Code ls -options \layout Standard This simply lists everything in the current directory, the options \begin_inset LatexCommand \index{options} \end_inset are not required \begin_inset LatexCommand \index{required} \end_inset (options such as \emph on -l \emph default , \emph on -a \emph default et cetera). \layout Code ls -options string \layout Standard This lists files using a certain string. The string \begin_inset LatexCommand \index{string} \end_inset can contain standard wildcards \begin_inset LatexCommand \index{standard wildcards} \end_inset to list multiple files, to learn \begin_inset LatexCommand \index{learn} \end_inset more about standard wildcards please read \begin_inset LatexCommand \ref{standard-wildcards} \end_inset \layout Standard \noindent You can use \emph on ls -d \emph default to show \begin_inset LatexCommand \index{show} \end_inset directories that match \begin_inset LatexCommand \index{match} \end_inset an exact \begin_inset LatexCommand \index{exact} \end_inset string, or use standard wildcards. Type \begin_inset Quotes eld \end_inset ls -d */ \begin_inset Quotes erd \end_inset to list all subdirectories \begin_inset LatexCommand \index{subdirectories} \end_inset of the current directory. Depending \begin_inset LatexCommand \index{Depending} \end_inset on the setup \begin_inset LatexCommand \index{setup} \end_inset of your aliases (see \begin_inset LatexCommand \ref{Shell-Tips} \end_inset ) you may simply be able to type \emph on lsd \begin_inset LatexCommand \index{lsd} \end_inset \emph default as the equivalent \begin_inset LatexCommand \index{equivalent} \end_inset to \emph on ls -d */ \emph default . \layout Standard \noindent Examples \begin_inset LatexCommand \index{Examples} \end_inset for \emph on ls -d \emph default : \layout Code \noindent ls -d \emph on \emph default */ \layout Standard Lists all subdirectories \begin_inset LatexCommand \index{subdirectories} \end_inset of current directory. \layout Code ls -d string* \layout Standard Lists directories that start with "string". \layout Code ls -d /usr/*/*/doc \layout Standard Lists all directories \begin_inset LatexCommand \index{directories} \end_inset that are two levels \begin_inset LatexCommand \index{levels} \end_inset below the /usr/ directory and have a directory called \begin_inset Quotes eld \end_inset doc \begin_inset Quotes erd \end_inset , this trick \begin_inset LatexCommand \index{trick} \end_inset can come in quite handy sometimes. \layout SGML \layout SGML You can also use \layout SGML \layout SGML Depending on how your aliases (see \begin_inset LatexCommand \ref{Shell-Tips} \end_inset ) are setup you can also use \emph on l \emph default , \emph on la \emph default (list all) and \emph on ll \emph default (list long) to perform the above commands \layout SGML \layout SGML \end_deeper \layout Description pwd \begin_inset LatexCommand \index{pwd} \end_inset Print working directory \begin_inset LatexCommand \index{print working directory} \end_inset . Print \begin_inset LatexCommand \index{Print} \end_inset the absolute \begin_inset LatexCommand \index{absolute} \end_inset (complete) path \begin_inset LatexCommand \index{path} \end_inset to the directory the user is currently in. \begin_deeper \layout Standard \noindent Command syntax: \layout Code pwd \layout Standard This will tell you the full path \begin_inset LatexCommand \index{path} \end_inset to the directory you are in, for example it may output \begin_inset LatexCommand \index{output} \end_inset \begin_inset Quotes eld \end_inset /usr/local/bin \begin_inset Quotes erd \end_inset if you are currently in that directory. \end_deeper \layout Description \noindent tree \begin_inset LatexCommand \index{tree} \end_inset Outputs \begin_inset LatexCommand \index{Outputs} \end_inset an ASCII \begin_inset LatexCommand \index{ASCII} \end_inset text tree/graph \begin_inset LatexCommand \index{graph} \end_inset starting at a given directory (by default \begin_inset LatexCommand \index{default} \end_inset the current \begin_inset LatexCommand \index{current} \end_inset directory). This command recursively lists \begin_inset LatexCommand \index{lists} \end_inset all files and all directories. \begin_inset LatexCommand \index{directories} \end_inset \begin_deeper \layout Standard \noindent In other words, it will list files within the directories \begin_inset LatexCommand \index{directories} \end_inset below the current one, as well as all files in the current directory. \layout Standard \noindent \emph on tree \emph default has a large number of options, refer \begin_inset LatexCommand \index{refer} \end_inset to the manual \begin_inset LatexCommand \index{manual} \end_inset page \begin_inset LatexCommand \index{page} \end_inset for details. \begin_inset LatexCommand \index{details} \end_inset \layout Standard \noindent Command syntax: \layout Code tree \layout Standard or \layout Code tree -option(s) /optional/directory/to/list \end_deeper \layout Subsection Finding files \begin_inset LatexCommand \label{finding-files} \end_inset \begin_inset Note collapsed false \layout Standard AFAIK \emph on find \emph default is the only tool necessary on *nix to find files/directories (excluding which, whereis, slocate). Do others exist? (I don't think they're necessary) \end_inset \layout Description find \begin_inset LatexCommand \index{find} \end_inset \emph on find \emph default is a tool which looks \begin_inset LatexCommand \index{looks} \end_inset for files on a filesystem. \begin_inset LatexCommand \index{filesystem} \end_inset \emph on find \emph default has a large number \begin_inset LatexCommand \index{number} \end_inset of options which can be used to customise \begin_inset LatexCommand \index{customise} \end_inset the search \begin_inset LatexCommand \index{search} \end_inset (refer to the manual/info pages). \begin_deeper \layout Standard \noindent Note that find works with standard wildcards, \begin_inset LatexCommand \index{standard wildcards} \end_inset \begin_inset LatexCommand \ref{standard-wildcards} \end_inset , and can work with regular expressions \begin_inset LatexCommand \index{regular expressions} \end_inset , \begin_inset LatexCommand \ref{regular-expressions} \end_inset . \layout Standard \noindent Basic \begin_inset LatexCommand \index{Basic} \end_inset example: \layout Code find / -name file \layout Standard This would look \begin_inset LatexCommand \index{look} \end_inset for a file named \begin_inset LatexCommand \index{named} \end_inset \begin_inset Quotes eld \end_inset file \begin_inset Quotes erd \end_inset and start at the root directory \begin_inset LatexCommand \index{root directory} \end_inset (it will search all directories \begin_inset LatexCommand \index{directories} \end_inset including \begin_inset LatexCommand \index{including} \end_inset those that are mounted \begin_inset LatexCommand \index{mounted} \end_inset filesystems). \layout Standard \noindent The \emph on `-name' \begin_inset LatexCommand \index{-name} \end_inset \emph default option \begin_inset LatexCommand \index{option} \end_inset is case sensitive \begin_inset LatexCommand \index{sensitive} \end_inset you can use the \emph on `-iname' \emph default option to find something regardless \begin_inset LatexCommand \index{regardless} \end_inset of case. \layout Standard Use the \emph on '-regex' \begin_inset LatexCommand \index{-regex} \end_inset \emph default and \emph on '-iregex' \begin_inset LatexCommand \index{-iregex} \end_inset \emph default to find something according to a regular expression (either case sensitive \begin_inset LatexCommand \index{sensitive} \end_inset or case insensitive \begin_inset LatexCommand \index{insensitive} \end_inset respectively). \layout Standard The \emph on '-exec' \begin_inset LatexCommand \index{-exec} \end_inset \emph default option is one of the more advanced \begin_inset LatexCommand \index{advanced} \end_inset find \begin_inset LatexCommand \index{find} \end_inset operations. \begin_inset LatexCommand \index{operations} \end_inset It executes a command on the files it finds \begin_inset LatexCommand \index{finds} \end_inset (such as moving \begin_inset LatexCommand \index{moving} \end_inset or removing \begin_inset LatexCommand \index{removing} \end_inset it or anything else\SpecialChar \ldots{} ). \layout Standard To use the \emph on -exec \emph default option: use find to find something, then add \begin_inset LatexCommand \index{add} \end_inset the \emph on -exec \emph default option to the end, \begin_inset LatexCommand \index{end} \end_inset then: \layout SGML \layout SGML command_to_be_executed then '{}' \emph on \emph default (curly brackets) then the arguments (for example a new directory) and finally a ';' . \layout SGML \layout Standard See below for an example of use this command. \layout SGML \layout SGML \layout SGML \layout SGML This is the tool you want to execute on the files find locates. For example if you wanted to remove everything it finds then you would use \emph on -exec rm -f \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The curly brackets are used in find to represent the current file which has been found. ie. If it found the file shopping.doc then {} would be substituted with shopping.doc. It would then continue to substitute {} for each file it finds. The brackets are normally protected by backslashes (\) or single-quotation marks ('), to stop bash expanding them (trying to interpret them as a special command eg. a wildcard). \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML This is the symbol used by find to signal the end of the commands. It's usually protected by a backslash (\) or quotes to stop bash from trying to expand it. \layout SGML \layout SGML \layout SGML \layout Code find / -name '*.doc' -exec cp '{}' /tmp/ ';' \layout Standard The above command would find \begin_inset LatexCommand \index{find} \end_inset any files with the extension \begin_inset LatexCommand \index{extension} \end_inset '.doc' and copy \begin_inset LatexCommand \index{copy} \end_inset them to your /tmp directory, obviously this command is quite useless, it's just an example of what find can do. Note that the quotation \begin_inset LatexCommand \index{quotation} \end_inset marks are there to stop \begin_inset LatexCommand \index{stop} \end_inset bash \begin_inset LatexCommand \index{bash} \end_inset from trying to interpret \begin_inset LatexCommand \index{interpret} \end_inset the other characters \begin_inset LatexCommand \index{characters} \end_inset as something. \layout Standard Excluding \begin_inset LatexCommand \index{Excluding} \end_inset particular folders \begin_inset LatexCommand \index{folders} \end_inset with \emph on find \emph default can be quite \begin_inset LatexCommand \index{quite} \end_inset confusing, but it may be necessary if you want to search your main disk \begin_inset LatexCommand \index{disk} \end_inset (without searching \begin_inset LatexCommand \index{searching} \end_inset every mounted \begin_inset LatexCommand \index{mounted} \end_inset filesystem). Use the \emph on -path \begin_inset LatexCommand \index{-path} \end_inset \emph default option to exclude \begin_inset LatexCommand \index{exclude} \end_inset the particular folder (note, you cannot have a '/' (forward slash) on the end) and the \emph on -prune \begin_inset LatexCommand \index{-prune} \end_inset \emph default option to exclude \begin_inset LatexCommand \index{exclude} \end_inset the subdirectories. \begin_inset LatexCommand \index{subdirectories} \end_inset An example is below: \layout Code find / -path '/mnt/win_c' -prune -o -name "string" -print \layout Standard \begin_inset LatexCommand \index{-path} \end_inset \begin_inset LatexCommand \index{-prune} \end_inset \begin_inset LatexCommand \index{-o} \end_inset \begin_inset LatexCommand \index{-print} \end_inset This example will search your entire directory tree (everything that is mounted \begin_inset LatexCommand \index{mounted} \end_inset under it) excluding \begin_inset LatexCommand \index{excluding} \end_inset /mnt/win_c and all of the subdirectories \begin_inset LatexCommand \index{subdirectories} \end_inset under /mnt/win_c. When using the \emph on -path \emph default option you can use wildcards. \begin_inset LatexCommand \index{wildcards} \end_inset \layout Standard Note that you could add \begin_inset LatexCommand \index{add} \end_inset more \emph on -path \begin_inset LatexCommand \index{-path} \end_inset '/directory' \emph default statements \begin_inset LatexCommand \index{statements} \end_inset on if you wanted. \layout Standard \emph on find \emph default has many, many different \begin_inset LatexCommand \index{different} \end_inset options, refer \begin_inset LatexCommand \index{refer} \end_inset to the manual (and info) page \begin_inset LatexCommand \index{page} \end_inset for more \begin_inset LatexCommand \index{more} \end_inset details. \end_deeper \layout Description slocate \begin_inset LatexCommand \index{slocate} \end_inset \emph on slocate \emph default outputs \begin_inset LatexCommand \index{outputs} \end_inset a list \begin_inset LatexCommand \index{list} \end_inset of all files on the system that match \begin_inset LatexCommand \index{match} \end_inset the pattern, \begin_inset LatexCommand \index{pattern} \end_inset giving their full path \begin_inset LatexCommand \index{path} \end_inset name (it doesn't have to be an exact \begin_inset LatexCommand \index{exact} \end_inset match, anything which contains the word is shown). \begin_deeper \layout SGML \layout SGML Replaces \emph on locate \emph default \layout SGML Secure locate is a replacement for \emph on locate \emph default , both have identical syntax. On most distributions locate is an alias to \emph on slocate \emph default . \layout SGML \layout Standard \noindent Commmand \begin_inset LatexCommand \index{Commmand} \end_inset syntax: \begin_inset LatexCommand \index{syntax} \end_inset \layout Code slocate string \layout SGML \layout SGML This won't work unless \layout SGML \layout SGML You need to run either \emph on updatedb \emph default (as root) or \emph on slocate -u \begin_inset LatexCommand \index{-u} \end_inset \emph default (as root) for slocate to work. \layout SGML \layout SGML \end_deeper \layout Description whereis \emph on whereis \begin_inset LatexCommand \index{whereis} \end_inset \emph default locates \begin_inset LatexCommand \index{locates} \end_inset the binary, \begin_inset LatexCommand \index{binary} \end_inset source, \begin_inset LatexCommand \index{source} \end_inset and manual page for a particular program, it uses exact \begin_inset LatexCommand \index{exact} \end_inset matches only, if you only know part \begin_inset LatexCommand \index{part} \end_inset of the name use \emph on slocate \emph default \begin_inset LatexCommand \index{slocate} \end_inset . \begin_deeper \layout Standard \noindent Command syntax: \layout Code \noindent whereis program_name \end_deeper \layout Description \noindent which \begin_inset LatexCommand \index{which} \end_inset Virtually the same as whereis, \begin_inset LatexCommand \index{whereis} \end_inset except it only finds \begin_inset LatexCommand \index{finds} \end_inset the executable \begin_inset LatexCommand \index{executable} \end_inset (the physical \begin_inset LatexCommand \index{physical} \end_inset program). It only looks in the PATH \begin_inset LatexCommand \index{PATH} \end_inset (environment variable) of a users shell. \begin_inset LatexCommand \index{shell} \end_inset \begin_deeper \layout Standard \noindent Use the \emph on -a \begin_inset LatexCommand \index{-a} \end_inset \emph default option to list all occurances \begin_inset LatexCommand \index{occurances} \end_inset of the particular program_name \begin_inset LatexCommand \index{program_name} \end_inset in your path \begin_inset LatexCommand \index{path} \end_inset (so if theres more than one you can see it). \layout Standard \noindent Command syntax: \layout Code which program_name \end_deeper \layout Section Working with files and folders \begin_inset LatexCommand \label{working-files-folders} \end_inset \layout Description \noindent mkdir \begin_inset LatexCommand \index{mkdir} \end_inset Make a directory. Use \emph on mkdir -p \begin_inset LatexCommand \index{-p} \end_inset \emph default to create subdirectories \begin_inset LatexCommand \index{subdirectories} \end_inset automatically. \begin_inset LatexCommand \index{automatically} \end_inset \begin_deeper \layout SGML \noindent \layout SGML \noindent Directories are Folders \layout SGML \noindent Directories are sometimes called folders in other operating systems (such as Microsoft Windows) \layout SGML \noindent \layout Standard \noindent Examples: \layout Code mkdir -p /home/matt/work/maths \layout Standard This would create the directories \begin_inset LatexCommand \index{directories} \end_inset \begin_inset Quotes eld \end_inset work \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset maths \begin_inset Quotes erd \end_inset under matt's home \begin_inset LatexCommand \index{home} \end_inset directory (if matt's home \begin_inset LatexCommand \index{home} \end_inset directory \begin_inset LatexCommand \index{directory} \end_inset didn't exist \begin_inset LatexCommand \index{exist} \end_inset it would create that too). \layout Code mkdir foo \layout Standard This would create a directory in the current path \begin_inset LatexCommand \index{path} \end_inset named \begin_inset Quotes eld \end_inset foo \begin_inset Quotes erd \end_inset . \end_deeper \layout Description \noindent rm \begin_inset LatexCommand \index{rm} \end_inset Remove/delete \begin_inset LatexCommand \index{delete} \end_inset \begin_inset LatexCommand \index{remove} \end_inset a file(s) or directories(s). You can use standard wildcards \begin_inset LatexCommand \index{standard wildcards} \end_inset with this command \begin_inset LatexCommand \ref{standard-wildcards} \end_inset . \begin_deeper \layout Standard \noindent Command syntax: \layout Code rm -options file_or_folder \layout Standard You can of course use standard wildcards to delete multiple files or multiple \begin_inset LatexCommand \index{multiple} \end_inset directories \begin_inset LatexCommand \index{directories} \end_inset and files. \layout Standard Use the \emph on -R \begin_inset LatexCommand \index{-R} \end_inset \emph default or \emph on -r \begin_inset LatexCommand \index{-r} \end_inset \emph default option to remove \begin_inset LatexCommand \index{remove} \end_inset recursively, this removes \begin_inset LatexCommand \index{removes} \end_inset everything \begin_inset LatexCommand \index{everything} \end_inset within subdirectories. \begin_inset LatexCommand \index{subdirectories} \end_inset Also try the \emph on -f \begin_inset LatexCommand \index{-f} \end_inset \emph default option to force \begin_inset LatexCommand \index{force} \end_inset removal (useful when you don't want to be prompted). \layout SGML \noindent \layout SGML Disabling Aliases (per execution) \layout SGML \layout SGML On some systems such as Mandrake an alias will send \emph on rm \emph default to \emph on rm -i \begin_inset LatexCommand \index{-i} \end_inset \emph default (prompting you for every file you wish to delete). To override this use: \emph on \backslash rm -R directory \emph default (using the \backslash disables the alias for this run only) \layout SGML \layout SGML \layout SGML \begin_inset Note collapsed false \layout Standard does redhat and other distro's do this?\SpecialChar \ldots{} I'm not a redhat user, or debian\SpecialChar \ldots{} \end_inset \end_deeper \layout Description \noindent rmdir \begin_inset LatexCommand \index{rmdir} \end_inset Remove an empty \begin_inset LatexCommand \index{empty} \end_inset directory. If you want to remove \begin_inset LatexCommand \index{remove} \end_inset a directory with files in it type \begin_inset Quotes eld \end_inset rm -R directory \begin_inset Quotes erd \end_inset , read above for information \begin_inset LatexCommand \index{information} \end_inset on \emph on rm -R \begin_deeper \layout Standard \noindent Command syntax: \layout Code rmdir directory \layout Standard This will only remove \begin_inset LatexCommand \index{remove} \end_inset directory if it's empty \begin_inset LatexCommand \index{empty} \end_inset otherwise it will exit \begin_inset LatexCommand \index{exit} \end_inset with an error \begin_inset LatexCommand \index{error} \end_inset message. \end_deeper \layout Description \noindent mv \begin_inset LatexCommand \index{mv} \end_inset Move a file or a directory to a new \begin_inset LatexCommand \index{new} \end_inset location or rename \begin_inset LatexCommand \index{rename} \end_inset a file/directory. \begin_deeper \layout Standard \noindent Rename \begin_inset LatexCommand \index{Rename} \end_inset example: \layout Code \noindent mv filename1 filename2 \layout Standard Renames \begin_inset LatexCommand \index{Renames} \end_inset filename1 \begin_inset LatexCommand \index{filename1} \end_inset to filename2. \begin_inset LatexCommand \index{filename2} \end_inset \layout Standard \noindent To move \begin_inset LatexCommand \index{move} \end_inset a file or directory, simply type: \layout Code \noindent mv original_file_or_folder new_location \layout Standard Note that this command can use standard wildcards \begin_inset LatexCommand \index{standard wildcards} \end_inset \begin_inset LatexCommand \ref{standard-wildcards} \end_inset to move \begin_inset LatexCommand \index{move} \end_inset files (not for renaming). \layout SGML \layout SGML Move and rename \layout SGML \layout SGML Note that you can also move and rename a file in a single command. The difference is with the destination (right hand side) you change the filename to the new name of the file. \layout SGML \layout SGML For example typing: \layout SGML \layout SGML This would move the file "configuration.txt" to /home/joe/ and rename it "backupconfig" \layout SGML \end_deeper \layout Description \noindent cp \begin_inset LatexCommand \index{cp} \end_inset Copy a file. Has a number \begin_inset LatexCommand \index{number} \end_inset of useful options, such as \emph on -R \begin_inset LatexCommand \index{-R} \end_inset \emph default (or \emph on -r \emph default ) which \begin_inset LatexCommand \index{which} \end_inset recursively \begin_inset LatexCommand \index{recursively} \end_inset copies \begin_inset LatexCommand \index{copies} \end_inset directories and subdirectories. \begin_inset LatexCommand \index{subdirectories} \end_inset \begin_deeper \layout Standard \noindent Command syntax: \layout Code cp -options file_or_files new_location \layout Standard \noindent Examples: \layout Code \noindent cp file1 file2 \layout Standard Simply copy file1 \begin_inset LatexCommand \index{file1} \end_inset to file2 \begin_inset LatexCommand \index{file2} \end_inset (in the same directory). \layout Code \noindent cp /tmp/file1 ~/file2 /mnt/win_c \layout Standard \noindent Where the last \begin_inset LatexCommand \index{last} \end_inset option is the directory to be copied to. The above example copies \begin_inset LatexCommand \index{Copies} \end_inset two files from different areas of the file system to /mnt/win_c \layout Code \noindent cp -R directory_and_or_files new_location \layout Standard \noindent This command will copy directories (and all subdirectories) and/or files t \emph on o new_location \begin_inset LatexCommand \index{new_location} \end_inset \emph default \begin_inset Note collapsed false \layout Standard and from core-untiles 5.0 cp -r is ok. and -r is equivalent to -R in most other commands too \end_inset \layout Standard Note that this command can use standard wildcards \begin_inset LatexCommand \index{standard wildcards} \end_inset \begin_inset LatexCommand \ref{standard-wildcards} \end_inset to copy \begin_inset LatexCommand \index{copy} \end_inset multiple files. \layout Standard You may also like to try the \begin_inset Quotes eld \end_inset -u \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{-u} \end_inset when moving \begin_inset LatexCommand \index{moving} \end_inset large directories \begin_inset LatexCommand \index{directories} \end_inset around, this copies \begin_inset LatexCommand \index{copies} \end_inset only if the source \begin_inset LatexCommand \index{source} \end_inset file is newer \begin_inset LatexCommand \index{newer} \end_inset than the destination \begin_inset LatexCommand \index{destination} \end_inset to where you are copying \begin_inset LatexCommand \index{copying} \end_inset to, or if the destination file does not exist \begin_inset LatexCommand \index{exist} \end_inset at all. \end_deeper \layout Description ln \begin_inset LatexCommand \index{ln} \end_inset Create a link \begin_inset LatexCommand \index{link} \end_inset to a file. There are two types \begin_inset LatexCommand \index{types} \end_inset of links: \begin_inset LatexCommand \index{links} \end_inset \begin_deeper \layout Description \series bold Hard\SpecialChar ~ links \series default \begin_inset LatexCommand \index{hard links} \end_inset Hard links are considered pointers \begin_inset LatexCommand \index{pointers} \end_inset to a file (the number is listed \begin_inset LatexCommand \index{listed} \end_inset by typing \emph on ls -l \emph default ) \emph on \begin_inset LatexCommand \index{ls} \end_inset \emph default . Each hard-link \begin_inset LatexCommand \index{hard-link} \end_inset is a reference \begin_inset LatexCommand \index{reference} \end_inset to a file. \begin_deeper \layout Standard The file itself only goes away when all hard-links \begin_inset LatexCommand \index{hard-links} \end_inset are deleted. \begin_inset LatexCommand \index{deleted} \end_inset If you delete the original \begin_inset LatexCommand \index{original} \end_inset file and there are hard links \begin_inset LatexCommand \index{links} \end_inset to it the original file will remain. \layout Standard Example: \layout Code ln target_name link_name \layout Standard Will create a \begin_inset Quotes eld \end_inset hard link \begin_inset Quotes erd \end_inset to target_name \begin_inset LatexCommand \index{target_name} \end_inset called link_name, \begin_inset LatexCommand \index{link_name} \end_inset you need to delete both of these to remove \begin_inset LatexCommand \index{remove} \end_inset the file. \end_deeper \layout Description \series bold Symbolic \series default \SpecialChar ~ \series bold links \series default \begin_inset LatexCommand \index{Symbolic links} \end_inset Symbolic links are created by typing \begin_inset Quotes eld \end_inset ln -s \begin_inset Quotes erd \end_inset . \begin_inset LatexCommand \index{-s} \end_inset \emph on \emph default When you remove \begin_inset LatexCommand \index{remove} \end_inset the original \begin_inset LatexCommand \index{original} \end_inset file the symbolic link \begin_inset LatexCommand \index{symbolic link} \end_inset becomes broken, \begin_inset LatexCommand \index{broken} \end_inset a symbolic link \begin_inset LatexCommand \index{link} \end_inset is similar to a windows \begin_inset LatexCommand \index{windows} \end_inset \begin_inset Quotes eld \end_inset short-cut \begin_inset Quotes erd \end_inset . \begin_deeper \layout Standard The advantage \begin_inset LatexCommand \index{advantage} \end_inset of symbolic \begin_inset LatexCommand \index{symbolic} \end_inset links is that the target can be to something on another file-system, while hard-links \begin_inset LatexCommand \index{hard-links} \end_inset can only exist \begin_inset LatexCommand \index{exist} \end_inset on the same file-system. \begin_inset LatexCommand \index{file-system} \end_inset \layout Standard For example: \layout Code ln -s target_name link_name \layout Standard This creates a symbolic link to \begin_inset Quotes eld \end_inset target_name \begin_inset Quotes erd \end_inset called \begin_inset Quotes eld \end_inset link_name \begin_inset Quotes erd \end_inset , if you delete the original \begin_inset LatexCommand \index{original} \end_inset file the symbolic link won't work (it becomes a broken \begin_inset LatexCommand \index{broken} \end_inset link). \end_deeper \end_deeper \layout Description shred \begin_inset LatexCommand \index{shred} \end_inset Securely remove \begin_inset LatexCommand \index{remove} \end_inset a file by overwriting \begin_inset LatexCommand \index{overwriting} \end_inset it first. Prevents \begin_inset LatexCommand \index{Prevents} \end_inset the data \begin_inset LatexCommand \index{data} \end_inset from being recovered \begin_inset LatexCommand \index{recovered} \end_inset by software \begin_inset LatexCommand \index{software} \end_inset (and even by most hardware), please be very careful \begin_inset LatexCommand \index{careful} \end_inset when using shred as you may never be able \begin_inset LatexCommand \index{able} \end_inset to retrieve \begin_inset LatexCommand \index{retrieve} \end_inset the data \begin_inset LatexCommand \index{data} \end_inset you have run \begin_inset LatexCommand \index{run} \end_inset the application \begin_inset LatexCommand \index{application} \end_inset on. \begin_deeper \layout Standard For example: \layout Code shred -n 2 -z -v /dev/hda1 \layout Quotation \begin_inset LatexCommand \index{-n} \end_inset \begin_inset LatexCommand \index{-z} \end_inset \begin_inset LatexCommand \index{-v} \end_inset \begin_inset Quotes eld \end_inset What this tells shred, is to overwrite \begin_inset LatexCommand \index{overwrite} \end_inset the partition \begin_inset LatexCommand \index{partition} \end_inset 2 times with random \begin_inset LatexCommand \index{random} \end_inset data \begin_inset LatexCommand \index{data} \end_inset (- n 2) then finish \begin_inset LatexCommand \index{finish} \end_inset it up by writing \begin_inset LatexCommand \index{writing} \end_inset over it with zeroes \begin_inset LatexCommand \index{zeroes} \end_inset (-z) and show \begin_inset LatexCommand \index{show} \end_inset you its progress (-v). Of course, change \begin_inset LatexCommand \index{change} \end_inset /dev/hda1 to the correct partition \begin_inset LatexCommand \index{partition} \end_inset . Each pass \begin_inset LatexCommand \index{pass} \end_inset can take some time, \begin_inset LatexCommand \index{time} \end_inset which is why I set \begin_inset LatexCommand \index{set} \end_inset it to only do 2 random \begin_inset LatexCommand \index{random} \end_inset passes \begin_inset LatexCommand \index{passes} \end_inset instead of the default \begin_inset LatexCommand \index{default} \end_inset 25. You can adjust \begin_inset LatexCommand \index{adjust} \end_inset this number, of course, to your particular level of paranoia \begin_inset LatexCommand \index{paranoia} \end_inset and the amount \begin_inset LatexCommand \index{amount} \end_inset of time you have. \layout Quotation Since shred writes on such a low-level, \begin_inset LatexCommand \index{low-level} \end_inset it doesn't actually matter what kind of filesystem \begin_inset LatexCommand \index{filesystem} \end_inset is on the partition--everything will be unrecoverable. \begin_inset LatexCommand \index{unrecoverable} \end_inset Once shred is finished, \begin_inset LatexCommand \index{finished} \end_inset you can shutdown the machine \begin_inset LatexCommand \index{machine} \end_inset and sell \begin_inset LatexCommand \index{sell} \end_inset or throw \begin_inset LatexCommand \index{throw} \end_inset away the drive \begin_inset LatexCommand \index{drive} \end_inset with peace \begin_inset LatexCommand \index{peace} \end_inset of mind. \begin_inset LatexCommand \index{mind} \end_inset \layout Quotation \SpecialChar \ldots{} However, even shre dding devices \begin_inset LatexCommand \index{devices} \end_inset is not always completely reliable. \begin_inset LatexCommand \index{reliable} \end_inset For example, most disks \begin_inset LatexCommand \index{disks} \end_inset map \begin_inset LatexCommand \index{map} \end_inset out bad sectors \begin_inset LatexCommand \index{sectors} \end_inset invisibly to the application; \begin_inset LatexCommand \index{application} \end_inset if the bad sectors \begin_inset LatexCommand \index{sectors} \end_inset contain sensitive \begin_inset LatexCommand \index{sensitive} \end_inset data, \begin_inset LatexCommand \index{data} \end_inset `shred' won't be able \begin_inset LatexCommand \index{able} \end_inset to destroy \begin_inset LatexCommand \index{destroy} \end_inset it. [ shred info page \begin_inset LatexCommand \index{page} \end_inset ]. \begin_inset Quotes erd \end_inset \begin_inset Foot collapsed false \layout Standard This information (as quoted) has come from the \begin_inset Quotes eld \end_inset Please, For the Love of All That's Recoverable, Shred Your Hard Drive! \begin_inset Quotes erd \end_inset article, number 18 in the \begin_inset LatexCommand \ref{references} \end_inset \end_inset \begin_inset Note collapsed true \layout SGML \layout SGML Be careful \layout SGML \layout SGML If you use this utility remember that the data cannot be recovered with software (undelete utilities) or even most hardware. It is recommended that you do not use this utility as root, as you can destroy anything. \layout SGML \layout SGML \layout SGML Please DO NOT use this utility if you do not understand how to use it. \layout SGML \layout SGML \end_inset \layout SGML \layout SGML Shredding files doesn't work with all filesystems \layout SGML \layout SGML Please note that as mentioned in the shred manual page (please see the manual and preferably info pages for more information). \emph on shred \emph default does not work correctly \emph on \emph default on log-structured or journaled filesystems, such as JFS, ReiserFS, XFS, Ext3 and many other modern filesystems \layout SGML \layout SGML \layout SGML \layout SGML Alternatives to using shred \layout SGML shred has its disadvantages when run on a filesystem. First of all since it has to be installed you cannot run shred on your operating systems filesystem, you also cannot use shred on a windows machine easily since you cannot install \emph on shred \emph default on this machine. \layout SGML You may like to try alternatives such as the DBAN project that create self-booting floppy disks that can completely erase a machines hard disk. \layout SGML \layout Standard You may also like to see how \emph on chattr \emph default \begin_inset LatexCommand \index{chattr} \end_inset can assist \begin_inset LatexCommand \index{assist} \end_inset you in shredding \begin_inset LatexCommand \index{shredding} \end_inset files once they are removed (it has similar problems \begin_inset LatexCommand \index{problems} \end_inset to shred, \begin_inset LatexCommand \index{shred} \end_inset only ext2 \begin_inset LatexCommand \index{ext2} \end_inset and ext3 \begin_inset LatexCommand \index{ext3} \end_inset style filesystems\SpecialChar \ldots{} ), please see \begin_inset LatexCommand \ref{file-permissions} \end_inset . \end_deeper \layout Description du \begin_inset LatexCommand \index{du} \end_inset Displays information \begin_inset LatexCommand \index{information} \end_inset about file size. Use \emph on du filename \emph default to display \begin_inset LatexCommand \index{display} \end_inset the size \begin_inset LatexCommand \index{size} \end_inset of a particular \begin_inset LatexCommand \index{particular} \end_inset file. If you use it on directories \begin_inset LatexCommand \index{directories} \end_inset it will display the information on the size of the files in the directory and each subdirectory. \begin_inset LatexCommand \index{subdirectory} \end_inset \begin_deeper \layout Standard \noindent Options \begin_inset LatexCommand \index{Options} \end_inset for du \begin_inset LatexCommand \index{du} \end_inset (use \emph on du -option(s) \emph default ): \layout Itemize \emph on -c \begin_inset LatexCommand \index{-c} \end_inset \emph default -- this will make \emph on du \emph default print \begin_inset LatexCommand \index{print} \end_inset a grand \begin_inset LatexCommand \index{grand} \end_inset total \begin_inset LatexCommand \index{total} \end_inset after all arguments \begin_inset LatexCommand \index{arguments} \end_inset have being processed. \begin_inset LatexCommand \index{processed} \end_inset \layout Itemize \emph on -s \begin_inset LatexCommand \index{-s} \end_inset \emph default -- summarises \begin_inset LatexCommand \index{summarises} \end_inset for each argument \begin_inset LatexCommand \index{argument} \end_inset (prints the total). \layout Itemize \noindent \emph on -h \begin_inset LatexCommand \index{-h} \end_inset \emph default -- prints \begin_inset LatexCommand \index{prints} \end_inset things in \begin_inset Quotes eld \end_inset human readable \begin_inset LatexCommand \index{human readable} \end_inset \begin_inset Quotes erd \end_inset mode; \begin_inset LatexCommand \index{mode} \end_inset for example printing \begin_inset LatexCommand \index{printing} \end_inset 1M (megabyte) rather than 1,024,000 (bytes). \layout Standard \noindent Using the \emph on -hs \emph default options on a directory will display the total \begin_inset LatexCommand \index{total} \end_inset size of the directory \begin_inset LatexCommand \index{directory} \end_inset and all subdirectories. \begin_inset LatexCommand \index{subdirectories} \end_inset \layout Standard \noindent Command syntax: \layout Code du -options file_directory_or_files \layout Standard Example: \layout Code du -hs * \layout Standard This command will list \begin_inset LatexCommand \index{list} \end_inset the size of all files in the current directory and it will list the size of subdirectories, \begin_inset LatexCommand \index{subdirectories} \end_inset it will list things in human-readable \begin_inset LatexCommand \index{human-readable} \end_inset sizes \begin_inset LatexCommand \index{sizes} \end_inset using 1024 Kb \begin_inset LatexCommand \index{Kb} \end_inset is a Megabyte, \begin_inset LatexCommand \index{Megabyte} \end_inset M for megabyte, \begin_inset LatexCommand \index{megabyte} \end_inset K for kilobyte \begin_inset LatexCommand \index{kilobyte} \end_inset etc. \layout Standard \begin_inset Note collapsed false \layout Standard could be technically incorrect if they use the MiB and KiB standards\SpecialChar \ldots{} cos I think they dont (not sure) \end_inset \end_deeper \layout Description \noindent file Attempts \begin_inset LatexCommand \index{Attempts} \end_inset to find \begin_inset LatexCommand \index{find} \end_inset out what type of file it is, for example it may say it's: binary, \begin_inset LatexCommand \index{binary} \end_inset an image \begin_inset LatexCommand \index{image} \end_inset file (well it will say jpeg, \begin_inset LatexCommand \index{jpeg} \end_inset bmp \begin_inset LatexCommand \index{bmp} \end_inset et cetera), ASCII \begin_inset LatexCommand \index{ASCII} \end_inset text, \begin_inset LatexCommand \index{text} \end_inset C header \begin_inset LatexCommand \index{header} \end_inset file and many other kinds of files, it's a very useful utility. \begin_inset LatexCommand \index{utility} \end_inset \begin_deeper \layout Standard \noindent Command syntax: \layout Code file file_name \end_deeper \layout Description \noindent stat \begin_inset LatexCommand \index{stat} \end_inset Tells you detailed \begin_inset LatexCommand \index{detailed} \end_inset information \begin_inset LatexCommand \index{information} \end_inset about a file, including \begin_inset LatexCommand \index{including} \end_inset inode number creation/access date. Also has many advanced \begin_inset LatexCommand \index{advanced} \end_inset options and uses. \begin_inset Note collapsed true \layout Standard although I really don't know what the options are used for. \end_inset \begin_deeper \layout Standard \noindent For simple use type: \layout Code stat file \end_deeper \layout Description dd \begin_inset LatexCommand \index{dd} \end_inset Copies data \begin_inset LatexCommand \index{data} \end_inset on a very low \begin_inset LatexCommand \index{low} \end_inset level and can be used to create copies \begin_inset LatexCommand \index{copies} \end_inset of disks \begin_inset LatexCommand \index{disks} \end_inset \begin_inset LatexCommand \ref{duplicating-disks} \end_inset and many other things (for example CD image \begin_inset LatexCommand \index{image} \end_inset files). \begin_deeper \layout Standard \emph on dd \emph default can also perform \begin_inset LatexCommand \index{perform} \end_inset conversions on files and vary the block \begin_inset LatexCommand \index{block} \end_inset size used when writing \begin_inset LatexCommand \index{writing} \end_inset the file. \layout Standard Command syntax, note the block \begin_inset LatexCommand \index{block} \end_inset size and count \begin_inset LatexCommand \index{count} \end_inset are optional \begin_inset LatexCommand \index{optional} \end_inset and you can use files instead of devices\SpecialChar \ldots{} \layout SGML \layout SGML Please note \layout SGML \emph on dd \emph default is an advanced and difficult to use command. Its also very powerful, so be careful what you do with it \layout SGML \layout Standard Command syntax: \layout Standard \begin_inset Note collapsed false \layout Standard need more info on this utility, I've hardly used it. \end_inset \layout Code dd if=/dev/xxx of=/dev/xxx bs=xxxx count=x \layout SGML \layout SGML Warning \layout SGML \layout SGML The command \emph on dd \emph default is used to work on a very low level. It can be used to overwrite important information such as your master-boot record or various important sections of your hard-disk. Please be careful when using it (especially when working with devices instead of files). \layout SGML \layout SGML \end_deeper \layout Description touch \begin_inset LatexCommand \index{touch} \end_inset This command is used to create empty \begin_inset LatexCommand \index{empty} \end_inset files, simply do \emph on touch file_name \emph default . It is also used to update \begin_inset LatexCommand \index{update} \end_inset the timestamps \begin_inset LatexCommand \index{timestamps} \end_inset on files. \begin_deeper \layout Standard \noindent \emph on touch \emph default can be used to change \begin_inset LatexCommand \index{change} \end_inset the time and/or date of a file: \layout Code \noindent touch -t \begin_inset LatexCommand \index{-t} \end_inset 05070915 my_report.txt \begin_inset Foot collapsed false \layout Standard This particular command and explanation has been used (with editing) from the Linux Online Classroom, see [4] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset \layout Standard \noindent This command would change \begin_inset LatexCommand \index{change} \end_inset the timestamp \begin_inset LatexCommand \index{timestamp} \end_inset on my_report.txt \family roman \family default so that it would \family roman look \begin_inset LatexCommand \index{look} \end_inset like you created it at 9:15. The first four digits \begin_inset LatexCommand \index{digits} \end_inset stand for May 7th (0507), in MM-DD (American style), and the last \begin_inset LatexCommand \index{last} \end_inset four (0915) the time, \begin_inset LatexCommand \index{time} \end_inset 9:15 in the morning. \begin_inset LatexCommand \index{morning} \end_inset \layout Standard Instead of using plain \begin_inset LatexCommand \index{plain} \end_inset numbers to change \begin_inset LatexCommand \index{change} \end_inset the time, you can use options similar to that of the \emph on date \emph default tool. For example: \layout Code touch -d '5 May 2000' some_file.txt \layout Standard You can also use \emph on --date= \emph default instead of \emph on -d \begin_inset LatexCommand \index{-d} \end_inset \begin_inset LatexCommand \index{--date=} \end_inset . \emph default Also have a look at the date command under \begin_inset LatexCommand \ref{date-time-calendars} \end_inset for examples \begin_inset LatexCommand \index{examples} \end_inset on using \emph on -d \emph default and \emph on --date= \emph default (the syntax \begin_inset LatexCommand \index{syntax} \end_inset for the date \begin_inset LatexCommand \index{date} \end_inset part is exactly \begin_inset LatexCommand \index{exactly} \end_inset the same when using \emph on -d \emph default or \emph on --date \emph default ). \end_deeper \layout Description split \begin_inset LatexCommand \index{split} \end_inset Splits \begin_inset LatexCommand \index{Splits} \end_inset files into several \begin_inset LatexCommand \index{several} \end_inset smaller \begin_inset LatexCommand \index{smaller} \end_inset files. \begin_deeper \layout Standard \noindent Use the \emph on -b\SpecialChar ~ xx \emph default \begin_inset LatexCommand \index{-b} \end_inset option \begin_inset LatexCommand \index{option} \end_inset to split \begin_inset LatexCommand \index{split} \end_inset into \emph on xx \emph default bytes, \begin_inset LatexCommand \index{bytes} \end_inset also try \emph on -k \emph default \begin_inset LatexCommand \index{-k} \end_inset for kilobytes, \begin_inset LatexCommand \index{kilobytes} \end_inset and \emph on -m \emph default \begin_inset LatexCommand \index{-m} \end_inset for megabytes. \begin_inset LatexCommand \index{megabytes} \end_inset You can use it to split text files and any other files\SpecialChar \ldots{} you can use \emph on cat \emph default to re-combine \begin_inset LatexCommand \index{re-combine} \end_inset the files. \layout Standard \noindent This may be useful if you have to transfer \begin_inset LatexCommand \index{transfer} \end_inset something to floppy \begin_inset LatexCommand \index{floppy} \end_inset disks \begin_inset LatexCommand \index{disks} \end_inset or you wish to divide \begin_inset LatexCommand \index{divide} \end_inset text files into certain sizes. \begin_inset LatexCommand \index{sizes} \end_inset \layout Standard \noindent Command syntax: \layout Code split -options file \layout Standard This will split \begin_inset LatexCommand \index{split} \end_inset the input \begin_inset LatexCommand \index{input} \end_inset file into 1000 lines \begin_inset LatexCommand \index{lines} \end_inset of input each (thats the default\SpecialChar \ldots{} ), and output \begin_inset LatexCommand \index{output} \end_inset (using the above example), with the input name file, \begin_inset Quotes eld \end_inset fileaa \begin_inset Quotes erd \end_inset (1st part \begin_inset LatexCommand \index{part} \end_inset of file), \begin_inset Quotes eld \end_inset fileab \begin_inset Quotes erd \end_inset (2nd part \begin_inset LatexCommand \index{part} \end_inset of file), \begin_inset Quotes eld \end_inset fileac \begin_inset Quotes erd \end_inset (3rd part \begin_inset LatexCommand \index{part} \end_inset of file) etc. until the there is no more \begin_inset LatexCommand \index{more} \end_inset of the file left to split. \begin_inset LatexCommand \index{split} \end_inset \end_deeper \layout Section Mass Rename/copy/link Tools \begin_inset LatexCommand \label{mass-rename} \end_inset \layout Standard There are a few different ways to perform mass renaming \begin_inset LatexCommand \index{mass renaming} \end_inset of files in GNU/Linux (yes, mass renaming is possible!). There is also a perl \begin_inset LatexCommand \index{perl} \end_inset script that renames \begin_inset LatexCommand \index{renames} \end_inset the extentions \begin_inset LatexCommand \index{extentions} \end_inset on files, see \begin_inset LatexCommand \ref{Miscellaneous} \end_inset . \layout Standard Below are three ways to perform mass renaming of files, using the commands \emph on mmv \emph default , \emph on rename \emph default (a perl \begin_inset LatexCommand \index{perl} \end_inset script) or some bash \begin_inset LatexCommand \index{bash} \end_inset shell scripting. \begin_inset LatexCommand \index{scripting} \end_inset \layout Description \begin_inset Note collapsed false \layout Standard yes this was a subsection converted back to plain description again! \end_inset \layout Description mmv \begin_inset LatexCommand \index{mmv} \end_inset \emph on mmv \emph default is a mass \begin_inset LatexCommand \index{mass} \end_inset move/copy/renaming tool \begin_inset LatexCommand \index{move} \end_inset \begin_inset LatexCommand \index{renaming} \end_inset that uses standard wildcards \begin_inset LatexCommand \index{standard wildcards} \end_inset to perform its functions. \begin_inset LatexCommand \index{functions} \end_inset \begin_deeper \layout Standard \emph on mmv's \emph default manual page is quite difficult to understand, I have only a limited \begin_inset LatexCommand \index{limited} \end_inset understanding \begin_inset LatexCommand \index{ng} \end_inset of this tool. However \emph on mmv \emph default supports \begin_inset LatexCommand \index{supports} \end_inset some standard \begin_inset LatexCommand \index{standard} \end_inset wildcards. \begin_inset LatexCommand \index{standard wildcards} \end_inset \begin_inset LatexCommand \index{wildcards} \end_inset \layout Standard According to the manual \begin_inset LatexCommand \index{manual} \end_inset the \begin_inset Quotes eld \end_inset ; \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{;} \end_inset wildcard \begin_inset LatexCommand \index{wildcard} \end_inset is useful for matching \begin_inset LatexCommand \index{matching} \end_inset files at any depth \begin_inset LatexCommand \index{depth} \end_inset in the directory tree (ie it will go below the current directory, recursively). \layout Standard An example of how to use \emph on mmv \begin_inset LatexCommand \index{mmv} \end_inset \emph default is shown \begin_inset LatexCommand \index{shown} \end_inset below: \layout Code mmv \backslash *.JPG \backslash #1.jpg \layout Standard The first pattern \begin_inset LatexCommand \index{pattern} \end_inset matches anything with a \begin_inset Quotes eld \end_inset .JPG \begin_inset Quotes erd \end_inset and renames \begin_inset LatexCommand \index{renames} \end_inset each file (the \begin_inset Quotes eld \end_inset #1 \begin_inset Quotes erd \end_inset matches the first wildcard) to \begin_inset Quotes eld \end_inset .jpg \begin_inset Quotes erd \end_inset . \layout Standard Each time you use a \backslash (wildcard) you can use a #x to get that wildcard. Where x is a positive \begin_inset LatexCommand \index{positive} \end_inset number starting \begin_inset LatexCommand \index{starting} \end_inset at 1. \layout SGML \layout SGML mmv Homepage \layout SGML You can find \emph on mmv \emph default on the web \begin_inset LatexCommand \url[here.]{http://linux.maruhn.com/sec/mmv.html} \end_inset \layout SGML Also be aware that certain options used with \emph on mmv \emph default are also applicable to other tools in the suite, these include \emph on mcp \emph default (mass copy), \emph on mad \emph default (mass append contents of source file to target name), \emph on mln \emph default (mass link to a source file). \layout SGML \layout SGML \layout SGML Tip: \layout SGML A Java alternative to \emph on mmv \emph default which runs on both GNU/Linux and Windows is available, \begin_inset LatexCommand \url[Esomaniac]{http://www.esomaniac.de/} \end_inset \layout SGML \end_deeper \layout Description rename \begin_inset LatexCommand \index{rename} \end_inset \emph on rename \emph default is a perl \begin_inset LatexCommand \index{perl} \end_inset script which \begin_inset LatexCommand \index{which} \end_inset can be used to mass rename \begin_inset LatexCommand \index{mass rename} \end_inset files according to a regular expression \begin_inset LatexCommand \index{regular expression} \end_inset . \begin_deeper \layout Standard An example for renaming \begin_inset LatexCommand \index{renaming} \end_inset all \begin_inset Quotes eld \end_inset .JPG \begin_inset Quotes erd \end_inset files to \begin_inset Quotes eld \end_inset .jpg \begin_inset Quotes erd \end_inset is: \layout Code rename 's/ \backslash .JPG$/.jpg/' *.JPG \layout SGML \layout SGML Finding rename \layout SGML You can get rename from various places. I would recommend trying \begin_inset LatexCommand \url[CPAN Search Site]{http://search.cpan.org} \end_inset , I found the script here \begin_inset LatexCommand \url[Rename Script Version 1.4]{http://search.cpan.org/~pederst/rename-1.4/} \end_inset \layout SGML \end_deeper \layout Description Bash\SpecialChar ~ scripting \begin_inset LatexCommand \index{scripting} \end_inset Bash \begin_inset LatexCommand \index{Bash} \end_inset scripting is one way to rename \begin_inset LatexCommand \index{rename} \end_inset files. You can develop \begin_inset LatexCommand \index{develop} \end_inset a set \begin_inset LatexCommand \index{set} \end_inset of instructions \begin_inset LatexCommand \index{instructions} \end_inset (a script) to rename \begin_inset LatexCommand \index{rename} \end_inset files. Scripts \begin_inset LatexCommand \index{Scripts} \end_inset are useful if you don't have \emph on mmv \emph default or \emph on rename \emph default \SpecialChar \ldots{} \begin_deeper \layout Standard One way to this is shown \begin_inset LatexCommand \index{shown} \end_inset below: \layout Code for i in *.JPG; \layout Code do mv $i `basename $i JPG`jpg; \layout Code done \layout Standard Note that the above script \begin_inset LatexCommand \index{script} \end_inset came from a usenet \begin_inset LatexCommand \index{usenet} \end_inset post. \begin_inset LatexCommand \index{post} \end_inset Unfortunately \begin_inset LatexCommand \index{Unfortunately} \end_inset I do not know the author's name. \layout Standard The first line \begin_inset LatexCommand \index{line} \end_inset says find everything \begin_inset LatexCommand \index{everything} \end_inset with the \begin_inset Quotes eld \end_inset .JPG \begin_inset Quotes erd \end_inset extension \begin_inset LatexCommand \index{extension} \end_inset (capitals only, because the UNIX system \begin_inset LatexCommand \index{UNIX} \end_inset is case sensitive). \layout Standard The second line uses \emph on basename \emph default (type man \begin_inset LatexCommand \index{man} \end_inset basename for more details) with the '$i' argument. \begin_inset LatexCommand \index{argument} \end_inset The '$i' is a string \begin_inset LatexCommand \index{string} \end_inset containing the name of the file that matches. The next \begin_inset LatexCommand \index{next} \end_inset portion of the line removes the JPG \begin_inset LatexCommand \index{JPG} \end_inset extension from the end \begin_inset LatexCommand \index{end} \end_inset and adds the jpg \begin_inset LatexCommand \index{jpg} \end_inset extention to each file. The command \emph on mv \emph default is run \begin_inset LatexCommand \index{run} \end_inset on the output. \layout Standard An alternative \begin_inset LatexCommand \index{alternative} \end_inset is: \layout Code for i in *.JPG; \layout Code do mv $i ${i%%.JPG}.jpg; \layout Code done \layout Standard The above script renames \begin_inset LatexCommand \index{renames} \end_inset files using a built-in \begin_inset LatexCommand \index{built-in} \end_inset bash \begin_inset LatexCommand \index{bash} \end_inset function. For more information \begin_inset LatexCommand \index{information} \end_inset on bash \begin_inset LatexCommand \index{bash} \end_inset scripting \begin_inset LatexCommand \index{bash scripting} \end_inset you may like to see the \begin_inset LatexCommand \url[advanced bash scripting guide]{http://www.tldp.org/LDP/abs/html/} \end_inset , authored by Mendel Cooper \begin_inset LatexCommand \index{Mendel Cooper} \end_inset \begin_inset LatexCommand \index{advanced bash scripting} \end_inset . \end_deeper \layout Chapter \noindent Finding information about the system \begin_inset LatexCommand \label{Finding-information} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard Just don't see this being used\SpecialChar \ldots{} re-added time command. Its more of a programmers tool but can be useful\SpecialChar \ldots{} \layout Description logname Prints the user name the user used to login, possibly useful if you use \emph on su \emph default a lot. Doesn't need or take any options. \layout Standard Simply type: \layout Description logname \layout Standard This is a programmers tool! Left it out: \end_inset \layout Description time If you are looking \begin_inset LatexCommand \index{looking} \end_inset for how to change \begin_inset LatexCommand \index{change} \end_inset the time please refer \begin_inset LatexCommand \index{refer} \end_inset to \emph on date \emph default here: \begin_inset LatexCommand \ref{date-time-calendars} \end_inset . \begin_deeper \layout Standard \emph on time \emph default is a utility \begin_inset LatexCommand \index{utility} \end_inset to measure \begin_inset LatexCommand \index{measure} \end_inset the amount \begin_inset LatexCommand \index{amount} \end_inset of time it takes a program \begin_inset LatexCommand \index{program} \end_inset to execute. \begin_inset LatexCommand \index{execute} \end_inset It also measures \begin_inset LatexCommand \index{measures} \end_inset CPU \begin_inset LatexCommand \index{CPU} \end_inset usage and displays statistics. \begin_inset LatexCommand \index{statistics} \end_inset \layout Standard Use \emph on time -v \begin_inset LatexCommand \index{-v} \end_inset \emph default (verbose mode) to display \begin_inset LatexCommand \index{display} \end_inset even more detailed \begin_inset LatexCommand \index{detailed} \end_inset statistics about the particular \begin_inset LatexCommand \index{particular} \end_inset program. \layout Standard Example usage: \layout Code time program_name options \end_deeper \layout Description \noindent /proc The files under the /proc \begin_inset LatexCommand \index{/proc} \end_inset (process information pseudo file-system) \begin_inset LatexCommand \index{process information} \end_inset show \begin_inset LatexCommand \index{show} \end_inset various information about the system. Consider it a window \begin_inset LatexCommand \index{window} \end_inset to the information that the kernel \begin_inset LatexCommand \index{kernel} \end_inset uses. \begin_deeper \layout Standard \noindent For example: \layout Code \noindent cat /proc/cpuinfo \layout Standard \noindent Displays information about the CPU. \begin_inset LatexCommand \index{CPU} \end_inset \layout Code \noindent less /proc/modules \emph on \layout Standard \noindent Use the above command to view \begin_inset LatexCommand \index{view} \end_inset information about what kernel-modules \begin_inset LatexCommand \index{kernel-modules} \end_inset are loaded \begin_inset LatexCommand \index{loaded} \end_inset on your system. \end_deeper \layout Description dmesg \begin_inset LatexCommand \index{dmesg} \end_inset \emph on dmesg \emph default can be used to print \begin_inset LatexCommand \index{print} \end_inset (or control) the \begin_inset Quotes eld \end_inset kernel ring buffer \begin_inset LatexCommand \index{kernel ring buffer} \end_inset \begin_inset Quotes erd \end_inset . \emph on dmesg \emph default is generally used to print the contents \begin_inset LatexCommand \index{contents} \end_inset of your bootup \begin_inset LatexCommand \index{bootup} \end_inset messages displayed by the kernel. \begin_inset LatexCommand \index{kernel} \end_inset This is often useful when debugging \begin_inset LatexCommand \index{debugging} \end_inset problems. \begin_inset LatexCommand \index{problems} \end_inset \begin_inset Note collapsed false \layout Standard consider removing this one \end_inset \begin_deeper \layout Standard Simply type: \layout Code dmesg \end_deeper \layout Description df \begin_inset LatexCommand \index{df} \end_inset Displays information about the space \begin_inset LatexCommand \index{space} \end_inset on mounted \begin_inset LatexCommand \index{mounted} \end_inset file-systems. Use the \emph on -h \begin_inset LatexCommand \index{-h} \end_inset \emph default option \begin_inset LatexCommand \index{option} \end_inset to have \emph on df \emph default list \begin_inset LatexCommand \index{list} \end_inset the space in a 'human readable' format. \begin_inset LatexCommand \index{format} \end_inset ie. if there are 1024 kilobytes \begin_inset LatexCommand \index{kilobytes} \end_inset left (approximately) then \emph on df \emph default will say there is 1MB \begin_inset LatexCommand \index{1MB} \end_inset left. \begin_deeper \layout Standard Command syntax: \layout Code df -options /dev/hdx \layout Standard The latter part \begin_inset LatexCommand \index{part} \end_inset is optional, \begin_inset LatexCommand \index{optional} \end_inset you can simply use \emph on df \emph default with or without options \begin_inset LatexCommand \index{options} \end_inset to list space on all file-systems. \begin_inset LatexCommand \index{file-systems} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard confused on the mebibyte vs megabyte issue again. 1 megabyte = 1000 kilobytes according to the new NIST standard and one mega-binary-byte = 1024 kilobytes (1 MiB) a mebibyte\SpecialChar \ldots{} but most people still use the old terms\SpecialChar \ldots{} 1MB is CS is still 2^10, they use the old standards\SpecialChar \ldots{} \SpecialChar \ldots{} therefore I use the old standards. I think the new standards sort-of didn't happen. \end_inset \end_deeper \layout Description \noindent who \begin_inset LatexCommand \index{who} \end_inset Displays information on which users are logged \begin_inset LatexCommand \index{logged} \end_inset into the system including the time they logged in. \begin_deeper \layout Standard \noindent Command syntax: \layout Code who \end_deeper \layout Description w \begin_inset LatexCommand \index{w} \end_inset Displays information on who \begin_inset LatexCommand \index{who} \end_inset is logged into the system and what they are doing (ie. the processes \begin_inset LatexCommand \index{processes} \end_inset they are running). It's similar to \emph on who \emph default but displays slightly different information. \begin_deeper \layout Standard Command syntax: \layout Code w \end_deeper \layout Description users Very similar to \emph on who \emph default except it only prints \begin_inset LatexCommand \index{prints} \end_inset out the user names who \begin_inset LatexCommand \index{who} \end_inset are currently logged in. (Doesn't need or take any options). \begin_deeper \layout Standard Command syntax: \layout Code users \end_deeper \layout Description last \begin_inset LatexCommand \index{last} \end_inset Displays records \begin_inset LatexCommand \index{records} \end_inset of when various users have logged in or out. This includes \begin_inset LatexCommand \index{includes} \end_inset information on when the computer \begin_inset LatexCommand \index{computer} \end_inset was rebooted. \begin_inset LatexCommand \index{rebooted} \end_inset \begin_deeper \layout Standard To execute this simply type: \layout Code last \end_deeper \layout Description lastlog \begin_inset LatexCommand \index{lastlog} \end_inset Displays a list of users and what day/time they logged \begin_inset LatexCommand \index{logged} \end_inset into the system. \begin_deeper \layout Standard Simply type: \layout Code lastlog \end_deeper \layout Description \noindent whoami \begin_inset LatexCommand \index{whoami} \end_inset Tells the user who they are currently logged in as, this is normally the usename they logged in with but can be changed with commands like su). \begin_inset LatexCommand \index{su} \end_inset \emph on whoami \emph default does not need or take any options. \begin_deeper \layout Standard \noindent Simply type: \layout Code whoami \end_deeper \layout Description \noindent free \begin_inset LatexCommand \index{free} \end_inset Displays memory \begin_inset LatexCommand \index{memory} \end_inset statistics \begin_inset LatexCommand \index{statistics} \end_inset (total, free, used, cached, \begin_inset LatexCommand \index{cached} \end_inset swap). Use the \emph on -t \begin_inset LatexCommand \index{-t} \end_inset \emph default option to display totals \begin_inset LatexCommand \index{totals} \end_inset of everything \begin_inset LatexCommand \index{everything} \end_inset and use the \emph on -m \begin_inset LatexCommand \index{-m} \end_inset \emph default to display memory \begin_inset LatexCommand \index{memory} \end_inset in megabytes. \begin_inset LatexCommand \index{megabytes} \end_inset \begin_deeper \layout Standard \noindent Example: \layout Code free -tm \layout Standard This will display the memory \begin_inset LatexCommand \index{memory} \end_inset usage including \begin_inset LatexCommand \index{including} \end_inset totals \begin_inset LatexCommand \index{totals} \end_inset in megabytes. \begin_inset LatexCommand \index{megabytes} \end_inset \end_deeper \layout Description uptime \begin_inset LatexCommand \index{uptime} \end_inset Print how long \begin_inset LatexCommand \index{long} \end_inset the computer has been \begin_inset Quotes eld \end_inset up \begin_inset Quotes erd \end_inset , how long \begin_inset LatexCommand \index{long} \end_inset the computer has been running. \begin_inset LatexCommand \index{running} \end_inset It also displays the number \begin_inset LatexCommand \index{number} \end_inset of users and the processor \begin_inset LatexCommand \index{processor} \end_inset load (how hard the CPU has been working\SpecialChar \ldots{} ). \begin_deeper \layout SGML \layout SGML The w command \layout SGML The \emph on w \emph default command displays the output \begin_inset LatexCommand \index{output} \end_inset of the uptime command when you run this command. You could use the \emph on w \emph default command instead of uptime. \layout SGML \layout SGML \end_deeper \layout Description uname \emph on uname \begin_inset LatexCommand \index{uname} \end_inset \emph default is used to print information \begin_inset LatexCommand \index{information} \end_inset on the system such as OS \begin_inset LatexCommand \index{OS} \end_inset type, kernel version \begin_inset LatexCommand \index{kernel version} \end_inset et cetera. \begin_deeper \layout Standard Some \emph on uname \emph default options: \layout Itemize \emph on -a \begin_inset LatexCommand \index{-a} \end_inset \emph default --- print all the available \begin_inset LatexCommand \index{available} \end_inset information. \layout Itemize \emph on -m \begin_inset LatexCommand \index{-m} \end_inset \emph default --- print only information related to the machine \begin_inset LatexCommand \index{machine} \end_inset itself. \layout Itemize \emph on -n \begin_inset LatexCommand \index{-n} \end_inset \emph default --- print only the machine hostname. \layout Itemize \emph on -r \begin_inset LatexCommand \index{-r} \end_inset \emph default --- print the release number \begin_inset LatexCommand \index{release number} \end_inset of the current \begin_inset LatexCommand \index{current} \end_inset kernel. \begin_inset LatexCommand \index{kernel} \end_inset \layout Itemize \emph on -s \begin_inset LatexCommand \index{-s} \end_inset \emph default --- print the operating \begin_inset LatexCommand \index{operating} \end_inset system name \layout Itemize \emph on -p \begin_inset LatexCommand \index{-p} \end_inset \emph default --- print the processor \begin_inset LatexCommand \index{processor} \end_inset type. \layout Standard Command syntax: \layout Code uname -options \end_deeper \layout Description xargs \begin_inset LatexCommand \index{xargs} \end_inset Note that \emph on xargs \emph default is an advanced, \begin_inset LatexCommand \index{advanced} \end_inset confusing, \begin_inset LatexCommand \index{confusing} \end_inset yet powerful \begin_inset LatexCommand \index{powerful} \end_inset command. \emph on xargs \emph default is a command used to run other commands as many times \begin_inset LatexCommand \index{times} \end_inset as necessary, this way it prevents any kind of overload\SpecialChar \ldots{} When you run a command then add a \emph on \begin_inset Quotes eld \end_inset | xargs \begin_inset LatexCommand \index{xargs} \end_inset command2 \begin_inset LatexCommand \index{command2} \end_inset \emph default \begin_inset Quotes erd \end_inset . The results \begin_inset LatexCommand \index{results} \end_inset of command1 \begin_inset LatexCommand \index{command1} \end_inset will be passed \begin_inset LatexCommand \index{passed} \end_inset to command2, possibly on a line-by-line basis or something similar. \begin_inset LatexCommand \index{command2} \end_inset \begin_deeper \layout Standard Understanding \emph on xargs \emph default tends \begin_inset LatexCommand \index{tends} \end_inset to be very difficult and my explanation \begin_inset LatexCommand \index{explanation} \end_inset is not the best. Refer \begin_inset LatexCommand \index{Refer} \end_inset to the examples \begin_inset LatexCommand \index{examples} \end_inset below or try [6] of the \begin_inset LatexCommand \ref{references} \end_inset for another \emph on xargs \emph default tutorial. \begin_inset LatexCommand \index{tutorial} \end_inset \layout SGML \layout SGML Alternatives to using xargs \layout SGML Please note that the below explanation of \emph on xargs \emph default is not the strongest (at the time of writing I could not find anything better :()). \layout SGML Alternatives may include writing a simple bash script to do the job which is not the most difficult task in the world. \layout SGML \layout Standard Examples: \layout Code ls | xargs grep work \layout Standard The first command is obvious, it will list \begin_inset LatexCommand \index{list} \end_inset the files in the current directory. For each line \begin_inset LatexCommand \index{line} \end_inset of output of \emph on ls \emph default , \emph on xargs \emph default will run \emph on grep \emph default on that particular line and look \begin_inset LatexCommand \index{look} \end_inset for the string \begin_inset Quotes eld \end_inset work \begin_inset Quotes erd \end_inset . The output have the each time \emph on grep \emph default is executed on a new \begin_inset LatexCommand \index{new} \end_inset line, the output would look like: \layout Code file_name: results_of_grep \layout Standard If \emph on grep \emph default didn't find \begin_inset LatexCommand \index{find} \end_inset the word then there would be no output if it had an error \begin_inset LatexCommand \index{error} \end_inset then it will output the error. \begin_inset LatexCommand \index{error} \end_inset Obviously this isn't very useful (you could just do: \layout Code grep 'word' * \layout Standard \emph on \begin_inset LatexCommand \index{grep} \end_inset \emph default This is just a simple example\SpecialChar \ldots{} \layout Standard \emph on xargs \begin_inset LatexCommand \index{xargs} \end_inset \emph default also takes various options: \layout Itemize \emph on -nx \begin_inset LatexCommand \index{-nx} \end_inset \emph default --- will group \begin_inset LatexCommand \index{group} \end_inset the first x commands together \layout Itemize \emph on -lx \begin_inset LatexCommand \index{-lx} \end_inset \emph default --- xargs \begin_inset LatexCommand \index{xargs} \end_inset will execute \begin_inset LatexCommand \index{execute} \end_inset the command for every x number of lines \begin_inset LatexCommand \index{lines} \end_inset of input \begin_inset LatexCommand \index{input} \end_inset \layout Itemize \emph on -p \begin_inset LatexCommand \index{-p} \end_inset \emph default --- prompt \begin_inset LatexCommand \index{prompt} \end_inset whether or not to execute this particular string \layout Itemize \emph on -t \begin_inset LatexCommand \index{-t} \end_inset \emph default --- (tell) be verbose, \begin_inset LatexCommand \index{verbose} \end_inset echo \begin_inset LatexCommand \index{echo} \end_inset each command before performing \begin_inset LatexCommand \index{performing} \end_inset it \layout Itemize \emph on -i \begin_inset LatexCommand \index{-i} \end_inset \emph default --- will use substitution \begin_inset LatexCommand \index{substitution} \end_inset similar to find's -exec \begin_inset LatexCommand \index{-exec} \end_inset option, it will execute certain commands on something. \layout Standard Example: \layout Code ls dir1 | xargs -i mv dir1/'{}' dir2/'{}' \layout Standard The {} would be substituted \begin_inset LatexCommand \index{substituted} \end_inset for the current input (in this example the current file/directory) listed \begin_inset LatexCommand \index{listed} \end_inset within the directory. \begin_inset LatexCommand \index{directory} \end_inset The above command would move \begin_inset LatexCommand \index{move} \end_inset every file listed in dir1 \begin_inset LatexCommand \index{dir1} \end_inset to dir2. \begin_inset LatexCommand \index{dir2} \end_inset Obviously this command won't be too useful, it would be easier to go to dir1 \begin_inset LatexCommand \index{dir1} \end_inset and type \emph on mv * ../dir2 \layout Standard Here is a more \begin_inset LatexCommand \index{more} \end_inset useful example: \layout Code \backslash ls *.wav | xargs -i lame -h '{}' '{}'.mp3 \layout Standard This would find all wave \begin_inset LatexCommand \index{wave} \end_inset files within the current directory and convert \begin_inset LatexCommand \index{convert} \end_inset them to mp3 \begin_inset LatexCommand \index{mp3} \end_inset files (encoded with lame) and append \begin_inset LatexCommand \index{append} \end_inset a \begin_inset Quotes eld \end_inset .mp3 \begin_inset Quotes erd \end_inset to the end of the filename, unfortunately it doesn't remove the .wav and so its not too useful\SpecialChar \ldots{} but it works. \end_deeper \layout Section Date/Time/Calendars \begin_inset LatexCommand \label{date-time-calendars} \end_inset \layout Standard There is one command to change \begin_inset LatexCommand \index{change} \end_inset both the date \begin_inset LatexCommand \index{date} \end_inset and time on a UNIX \begin_inset LatexCommand \index{UNIX} \end_inset like system, \emph on date \emph default , there is also a simple calendar \begin_inset LatexCommand \index{calendar} \end_inset utility, \emph on cal \emph default . If you are looking \begin_inset LatexCommand \index{looking} \end_inset to change \begin_inset LatexCommand \index{change} \end_inset the timestamps \begin_inset LatexCommand \index{timestamps} \end_inset on files please see \begin_inset LatexCommand \ref{Finding-information} \end_inset \layout Description date Tells you the date (and the time \begin_inset LatexCommand \index{time} \end_inset ) and is also used to set \begin_inset LatexCommand \index{set} \end_inset the date/time. \begin_deeper \layout Standard To set the date, type \emph on date MM:DD:YYYY \emph default (American style date) where MM is month, \begin_inset LatexCommand \index{month} \end_inset DD \begin_inset LatexCommand \index{DD} \end_inset is the number of days \begin_inset LatexCommand \index{days} \end_inset within the month \begin_inset LatexCommand \index{month} \end_inset and YYYY \begin_inset LatexCommand \index{YYYY} \end_inset is the year. \begin_inset LatexCommand \index{year} \end_inset \layout Standard For example to set the date to the 1st January 2000 you would type: \layout Code date 01:01:2000 \layout Standard To set the time (where the \emph on -s \begin_inset LatexCommand \index{-s} \end_inset \emph default option is to set a new \begin_inset LatexCommand \index{new} \end_inset time), type: \layout Code date \emph on \emph default -s hh:mm:ss \layout Standard Another useful option you can use is \emph on --date= \begin_inset Quotes eld \end_inset string \begin_inset Quotes erd \end_inset \emph default \begin_inset LatexCommand \index{--date=} \end_inset (or \emph on -d \begin_inset LatexCommand \index{-d} \end_inset \emph default \emph on \begin_inset Quotes eld \end_inset string \begin_inset Quotes erd \end_inset \emph default ) option to display \begin_inset LatexCommand \index{display} \end_inset a date from x days \begin_inset LatexCommand \index{days} \end_inset ago or in x days \begin_inset LatexCommand \index{days} \end_inset (or x weeks, months, \begin_inset LatexCommand \index{months} \end_inset years \begin_inset LatexCommand \index{years} \end_inset et cetera). See the examples below. \layout Standard Examples: \layout Code date --date="3 months 1 day ago" \layout Standard Will print the date 3 months \begin_inset LatexCommand \index{months} \end_inset and 1 day \begin_inset LatexCommand \index{day} \end_inset ago from the current date. Note that \emph on --date= \begin_inset Quotes erd \end_inset x month x day ago \begin_inset Quotes erd \end_inset \emph default and \emph on -d \begin_inset LatexCommand \index{-d} \end_inset \begin_inset Quotes eld \end_inset x month x day ago \begin_inset Quotes erd \end_inset \emph default are equivalent. \begin_inset LatexCommand \index{equivalent} \end_inset \layout Code date -d "3 days" \layout Standard The above command will print the date 3 days \begin_inset LatexCommand \index{days} \end_inset in the future from now. \end_deeper \layout Description cal \begin_inset LatexCommand \index{cal} \end_inset Typing \emph on cal \emph default will give you the calendar \begin_inset LatexCommand \index{calendar} \end_inset of the present \begin_inset LatexCommand \index{present} \end_inset month on your screen, \begin_inset LatexCommand \index{screen} \end_inset in the nice \begin_inset LatexCommand \index{nice} \end_inset standard calendar \begin_inset LatexCommand \index{calendar} \end_inset format. There are various options \begin_inset LatexCommand \index{options} \end_inset to customise \begin_inset LatexCommand \index{customise} \end_inset the calendar, \begin_inset LatexCommand \index{calendar} \end_inset refer \begin_inset LatexCommand \index{refer} \end_inset to the info/man page. \begin_inset LatexCommand \index{page} \end_inset \begin_deeper \layout Standard Example: \layout Code cal -y year \layout Standard \begin_inset LatexCommand \index{-y} \end_inset Will display a calendar \begin_inset LatexCommand \index{calendar} \end_inset for a specific \begin_inset LatexCommand \index{specific} \end_inset year, simply use cal -y \begin_inset LatexCommand \index{-y} \end_inset to print the calendar \begin_inset LatexCommand \index{calendar} \end_inset for the current year. \layout Code cal 2 2004 \layout Standard This will display the calendar \begin_inset LatexCommand \index{calendar} \end_inset for February 2004 \end_deeper \layout Section Finding information about partitions \begin_inset LatexCommand \label{hard-disk-partition-info} \end_inset \layout Standard There are a number of ways to find out information \begin_inset LatexCommand \index{information} \end_inset on your hard disk \begin_inset LatexCommand \index{disk} \end_inset drives, for information on mounted \begin_inset LatexCommand \index{mounted} \end_inset partitions also try \emph on df \begin_inset LatexCommand \index{df} \end_inset \emph default in \begin_inset LatexCommand \ref{Finding-information} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard the idea behind this section is that people may need to find out which partition on which hard disk has a particular file system. Might need a better name \layout Standard was subsectioned. Now just plain description style again \end_inset \layout Description Using\SpecialChar ~ the\SpecialChar ~ proc\SpecialChar ~ filesystem You can look \begin_inset LatexCommand \index{look} \end_inset through the information \begin_inset LatexCommand \index{information} \end_inset in the relevant \begin_inset LatexCommand \index{relevant} \end_inset area of the proc \begin_inset LatexCommand \index{/proc} \end_inset filesystem, \begin_inset LatexCommand \index{proc filesystem} \end_inset \begin_inset LatexCommand \index{filesystem} \end_inset under the directory \begin_inset LatexCommand \index{directory} \end_inset of either /proc/ide/ or /proc/ide?/hd? where the first question \begin_inset LatexCommand \index{question} \end_inset mark is a number \begin_inset LatexCommand \index{number} \end_inset and the second is a letter \begin_inset LatexCommand \index{letter} \end_inset (starting with 'a'). \begin_deeper \layout Standard For example: \layout Code cd /proc/ide0/hda \layout Standard Under this directory there will be various information on the hard drive \begin_inset LatexCommand \index{drive} \end_inset or cdrom \begin_inset LatexCommand \index{cdrom} \end_inset connected. \end_deeper \layout Description Using\SpecialChar ~ fdisk \begin_inset LatexCommand \label{using-fdisk} \end_inset Using \emph on fdisk \emph default \begin_inset LatexCommand \index{fdisk} \end_inset with the \emph on -l \begin_inset LatexCommand \index{-l} \end_inset \emph default option will output information on any hard drives \begin_inset LatexCommand \index{drives} \end_inset connected \begin_inset LatexCommand \index{connected} \end_inset to the system and information on their partitions \begin_inset LatexCommand \index{partitions} \end_inset (for example, the type of partition). \begin_deeper \layout Standard Information relating to using \emph on fdisk \emph default to partition \begin_inset LatexCommand \index{partition} \end_inset hard disks \begin_inset LatexCommand \index{disks} \end_inset can be found \begin_inset LatexCommand \index{found} \end_inset in your distributions \begin_inset LatexCommand \index{distributions} \end_inset documentation, \begin_inset LatexCommand \index{documentation} \end_inset the \emph on fdisk \emph default manual \begin_inset LatexCommand \index{manual} \end_inset page or online. \begin_inset LatexCommand \index{online} \end_inset \layout SGML \layout SGML Root Access Required \layout SGML This command needs root access to work \layout SGML \end_deeper \layout Chapter Controlling the system \begin_inset LatexCommand \label{Controlling-the-system} \end_inset \layout Standard The controlling \begin_inset LatexCommand \index{controlling} \end_inset the system chapter details \begin_inset LatexCommand \index{details} \end_inset commands that you may wish to use to interact \begin_inset LatexCommand \index{interact} \end_inset with devices \begin_inset LatexCommand \index{devices} \end_inset on your system and then details how to control \begin_inset LatexCommand \index{control} \end_inset processes \begin_inset LatexCommand \index{processes} \end_inset and services/daemons. \layout Description \noindent eject \emph on eject \begin_inset LatexCommand \index{eject} \end_inset \emph default simply tells \begin_inset LatexCommand \index{tells} \end_inset a device \begin_inset LatexCommand \index{device} \end_inset to open \begin_inset LatexCommand \index{open} \end_inset (eject) the drive. Useful for cdrom/DVD drives. \begin_inset LatexCommand \index{drives} \end_inset \begin_deeper \layout Standard \noindent For example the command below would eject the cdrom-drive \begin_inset LatexCommand \index{cdrom-drive} \end_inset (if your cdrom \begin_inset LatexCommand \index{cdrom} \end_inset is linked \begin_inset LatexCommand \index{linked} \end_inset to /dev/cdrom): \layout Code eject /dev/cdrom \layout SGML \layout SGML This won't work unless \layout SGML \layout SGML This will only work if the user has permission to mount the partition. Please see the tip in \begin_inset LatexCommand \ref{mounting-and-unmounting} \end_inset for more information. \layout SGML \layout SGML \layout Standard \begin_inset Note collapsed false \layout Standard should confirm the above fact \end_inset \end_deeper \layout Section \noindent Mounting and Unmounting (Floppy/CDROM/Hard-drive Partitions) \begin_inset LatexCommand \label{mounting-and-unmounting} \end_inset \layout SGML \layout SGML Allowing Users to mount partitions \layout SGML \layout SGML By default a UNIX system will allow normal users to unmount partitions. However unless given permission by the superuser, users will not be allowed to mount partitions. \layout SGML \layout SGML \layout SGML The commands listed below will not work for normal users unless users have permission to mount that device. \layout SGML \layout SGML \layout SGML If your particular distribution is setup not to allow users to mount partitions its not very hard to change this, simply edit the \emph on /etc/fstab \emph default file (as root) and: \layout SGML \layout SGML \layout SGML Replace the word "defaults" with "user" \series bold or \series default \layout SGML Add "user" to the end of the options list for the particular partition(s ). \layout SGML \layout SGML \layout Description mount \begin_inset LatexCommand \index{mount} \end_inset Mount a device. \begin_inset LatexCommand \index{device} \end_inset Attach \begin_inset LatexCommand \index{Attach} \end_inset the device \begin_inset LatexCommand \index{device} \end_inset to the file-system \begin_inset LatexCommand \index{file-system} \end_inset hierarchy \begin_inset LatexCommand \index{hierarchy} \end_inset (the tree \begin_inset LatexCommand \index{tree} \end_inset ( / )). This needs to be done so you can access \begin_inset LatexCommand \index{access} \end_inset the drive \begin_inset LatexCommand \index{drive} \end_inset (see below, \begin_inset LatexCommand \ref{mounting-and-unmounting} \end_inset for an example). \layout Description \noindent umount \begin_inset LatexCommand \index{umount} \end_inset 'Unmount' a device. \begin_inset LatexCommand \index{device} \end_inset The command \emph on umount \emph default (no 'n') unmount's a device. \begin_inset LatexCommand \index{device} \end_inset It removes \begin_inset LatexCommand \index{removes} \end_inset it from the file-system hierarchy (the tree ( / )). This needs to be done before you remove \begin_inset LatexCommand \index{remove} \end_inset a floppy/CDROM or any other removable \begin_inset LatexCommand \index{removable} \end_inset device \begin_inset LatexCommand \index{device} \end_inset (see below, \begin_inset LatexCommand \ref{mounting-and-unmounting} \end_inset for an example). \layout Description smbmount\SpecialChar ~ //wincomp/c\SpecialChar ~ /mnt/win \begin_inset LatexCommand \index{smbmount} \end_inset Where \begin_inset Quotes eld \end_inset win \begin_inset Quotes erd \end_inset would be the place \begin_inset LatexCommand \index{place} \end_inset you want it mounted \begin_inset LatexCommand \index{mounted} \end_inset and \begin_inset Quotes eld \end_inset wincomp \begin_inset Quotes erd \end_inset is the IP address \begin_inset LatexCommand \index{IP address} \end_inset or name of your windows \begin_inset LatexCommand \index{windows} \end_inset computer. \begin_deeper \layout SGML \layout SGML Please note \layout SGML Using ping/smbmount/ssh or other UNIX system programs with a computer name rather than IP address will only work if you have the computer listed in your /etc/hosts \begin_inset LatexCommand \index{/etc/hosts} \end_inset file. Here is an example: \layout SGML \layout SGML 192.168.1.100 new \layout SGML This line says that their is a computer called \begin_inset Quotes eld \end_inset new \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{new} \end_inset with IP address 192.168.1.100 \begin_inset LatexCommand \index{192.168.1.100} \end_inset . Now that it exists in the /etc/hosts file I don't have to type the IP address anymore, just the name \begin_inset Quotes eld \end_inset new \begin_inset Quotes erd \end_inset . \layout SGML \layout SGML \layout Standard \emph on smbmount \emph default is a tool from the samba \begin_inset LatexCommand \index{samba} \end_inset package, it can mount \begin_inset LatexCommand \index{mount} \end_inset a remote \begin_inset LatexCommand \index{remote} \end_inset windows \begin_inset LatexCommand \index{windows} \end_inset file-system onto your current \begin_inset LatexCommand \index{current} \end_inset computer. \layout Standard Un-mounting uses the same syntax \begin_inset LatexCommand \index{syntax} \end_inset as 'umount', as listed above, or you may like to use: \layout Code smbumount /mountpoint \layout Standard \begin_inset LatexCommand \index{smbumount} \end_inset Here are some more examples of how to mount \begin_inset LatexCommand \index{mount} \end_inset a file-system: \layout SGML \layout SGML mount -t \begin_inset LatexCommand \index{-t} \end_inset ext2 /dev/fd0 /mnt/floppy \series bold \series default \layout SGML mount -t iso9660 /dev/hdb /mnt/cdrom \layout SGML mount -t iso /tmp/image_file /mnt/iso_file/ -o loop \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The windows filesystem is known as vfat \begin_inset LatexCommand \index{vfat} \end_inset (standard on Windows 9x) or NFTS \begin_inset LatexCommand \index{NFTS} \end_inset (standard on Windows 2000 and XP). \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML for CDROM's \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML This will mount an image file (usually a CD image file) so you can view/chang e the files (it will appear to be like any other device). \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML The -t option \layout SGML \layout SGML On any system running a newer version of the Linux kernel the \emph on -t \emph default option is not always necessary and can be left out. \layout SGML \layout SGML \layout Standard \begin_inset Note collapsed false \layout Standard above is kernel dependent \end_inset \layout Standard \noindent Examples of how to unmount \begin_inset LatexCommand \index{unmount} \end_inset a file-system (necessary before you eject/remove disk): \layout Code \noindent umount /mount_point \layout Standard An example unmount point could be \begin_inset Quotes eld \end_inset /mnt/floppy \begin_inset Quotes erd \end_inset or \begin_inset Quotes eld \end_inset /mnt/cdrom \begin_inset Quotes erd \end_inset \end_deeper \layout Section Shutting Down/Rebooting the System \begin_inset LatexCommand \label{shutting-down} \end_inset \begin_inset Note collapsed false \layout Standard add poweroff? its usually called by shutdown -h or halt\SpecialChar \ldots{} \end_inset \layout Description shutdown\SpecialChar ~ now \begin_inset LatexCommand \index{shutdown} \end_inset Shutdown the computer immediately (don't power down \begin_inset LatexCommand \index{power down} \end_inset ). Note that in UNIX \begin_inset LatexCommand \index{UNIX} \end_inset systems this kind of shutdown \begin_inset LatexCommand \index{shutdown} \end_inset means to go to \begin_inset Quotes eld \end_inset single-user mode \begin_inset Quotes erd \end_inset . \begin_inset LatexCommand \index{single-user} \end_inset \begin_inset LatexCommand \index{mode} \end_inset Single-user mode is a mode where only the administrator \begin_inset LatexCommand \index{administrator} \end_inset (root) has access \begin_inset LatexCommand \index{access} \end_inset to the computer, this mode \begin_inset LatexCommand \index{mode} \end_inset is designed \begin_inset LatexCommand \index{designed} \end_inset for maintenance \begin_inset LatexCommand \index{maintenance} \end_inset and is often used for repairs. \begin_inset LatexCommand \index{repairs} \end_inset \begin_deeper \layout Standard For example this would take you to single user mode \layout Code shutdown now \end_deeper \layout Description shutdown\SpecialChar ~ -h\SpecialChar ~ now \begin_inset LatexCommand \index{shutdown -h} \end_inset Shutdown \emph on (-h \begin_inset LatexCommand \index{-h} \end_inset = halt) \emph default the computer immediately. It begins the shutdown procedure, \begin_inset LatexCommand \index{procedure} \end_inset press CTRL-C (break-key) to stop \begin_inset LatexCommand \index{stop} \end_inset it. After the end of the command you can also leave a message \begin_inset LatexCommand \index{message} \end_inset in quotation \begin_inset LatexCommand \index{quotation} \end_inset marks \begin_inset LatexCommand \index{marks} \end_inset which will be broad-casted \begin_inset LatexCommand \index{broad-casted} \end_inset to all users, for example: \begin_deeper \layout Code shutdown -h now "Warning system malfunction, self-destruct imminent" \layout Standard This would halt \begin_inset LatexCommand \index{halt} \end_inset the system and send \begin_inset LatexCommand \index{send} \end_inset the message \begin_inset LatexCommand \index{message} \end_inset to anyone who \begin_inset LatexCommand \index{who} \end_inset is currently logged \begin_inset LatexCommand \index{logged} \end_inset in. \layout SGML \layout SGML Shutting down at a particular time \layout SGML You can also put a time that the system should shutdown instead of \begin_inset Quotes eld \end_inset now \begin_inset Quotes erd \end_inset . Typing \begin_inset Quotes eld \end_inset +x minutes \begin_inset LatexCommand \index{minutes} \end_inset \begin_inset Quotes erd \end_inset (any number \begin_inset LatexCommand \index{number} \end_inset of minutes \begin_inset LatexCommand \index{minutes} \end_inset is appropriate) or you can even set an exact \begin_inset LatexCommand \index{exact} \end_inset time. For example to shutdown \begin_inset LatexCommand \index{shutdown} \end_inset at \begin_inset LatexCommand \index{at} \end_inset 11:50 type: \layout SGML shutdown -h 11:50 \layout SGML \layout SGML \layout SGML \layout SGML Shutdown -h vs poweroff \layout SGML On some systems, \emph on shutdown -h \emph default and \emph on halt \emph default do not actually turn the system's power off. On systems that do not power off with these commands use the \emph on poweroff \emph default \begin_inset LatexCommand \index{poweroff} \end_inset command \layout SGML \end_deeper \layout Description halt \begin_inset LatexCommand \index{halt} \end_inset The same as \emph on shutdown -h now \emph default doesn't take any options, \begin_inset LatexCommand \index{options} \end_inset this command simply shuts down immediately. \layout Description \noindent shutdown\SpecialChar ~ -r\SpecialChar ~ now \begin_inset LatexCommand \index{shutdown -r} \end_inset Shutdown ( \emph on -r \begin_inset LatexCommand \index{-r} \end_inset = reboot \begin_inset LatexCommand \index{reboot} \end_inset \emph default ) the computer immediately. It begins the reboot procedure, \begin_inset LatexCommand \index{procedure} \end_inset press \begin_inset LatexCommand \index{press} \end_inset CTRL-C (break-key) to stop \begin_inset LatexCommand \index{stop} \end_inset it. After the end of the command you can also leave a message \begin_inset LatexCommand \index{message} \end_inset in quotation \begin_inset LatexCommand \index{quotation} \end_inset marks \begin_inset LatexCommand \index{marks} \end_inset which will be broad-casted \begin_inset LatexCommand \index{broad-casted} \end_inset to all users, for example: \begin_deeper \layout Code \noindent shutdown -r now "Warning system rebooting, all files will be destroyed" \layout Standard \noindent This would reboot the system and send \begin_inset LatexCommand \index{send} \end_inset the message \begin_inset LatexCommand \index{message} \end_inset to anyone who \begin_inset LatexCommand \index{who} \end_inset was logged in. \layout SGML \layout SGML Rebooting at a particular time \layout SGML You can also put a time that the system should reboot instead of \begin_inset Quotes eld \end_inset now \begin_inset Quotes erd \end_inset . Typing \begin_inset Quotes eld \end_inset +x minutes \begin_inset LatexCommand \index{minutes} \end_inset \begin_inset Quotes erd \end_inset (any number of minutes \begin_inset LatexCommand \index{minutes} \end_inset is appropriate) or you can even set \begin_inset LatexCommand \index{set} \end_inset an exact \begin_inset LatexCommand \index{exact} \end_inset time. For example to reboot \begin_inset LatexCommand \index{shutdown} \end_inset at 11:50 type: \layout SGML shutdown -r 11:50 \layout SGML \layout SGML \end_deeper \layout Description \noindent reboot The same as \emph on shutdown -r now \emph default , doesn't take any options, simply reboots \begin_inset LatexCommand \index{reboots} \end_inset the computer immediately. \layout Description \noindent CTRL-ALT-DEL (key-combination) May be used from a terminal \begin_inset LatexCommand \index{terminal} \end_inset to reboot or shutdown, \begin_inset LatexCommand \index{shutdown} \end_inset it depends on your system configuration. Note that this doesn't work from an xterminal. \begin_inset LatexCommand \index{xterminal} \end_inset CTRL-ALT-DEL begins the reboot/shutdown immediately, the user does not have to be logged in. \begin_deeper \layout SGML \layout SGML You can change the behaviour of CTRL-ALT-DEL from rebooting \layout SGML \layout SGML To disable CTRL-ALT-DEL from rebooting your computer (or to have it do something different), you can edit the /etc/inittab \begin_inset LatexCommand \index{/etc/inittab} \end_inset file (as root). \layout SGML \layout SGML \layout SGML Here is how it looks on a Mandrake/Mandriva Linux system: \layout SGML \layout SGML # Trap CTRL-ALT-DEL \layout SGML ca::ctrlaltdel:/sbin/shutdown -t3 -r now \layout SGML \layout SGML \layout SGML \layout SGML Note that the # means a comment (and is not used). If you simply put a # (hash) before the command it would disable it (it would become a comment). \layout SGML \layout SGML \layout SGML You could also change the command it runs for example if you changed the \emph on -r \emph default to a \emph on -h \emph default the computer would turn off instead of rebooting, or you could have it do anything you want. It's up to your creativity to make it do something interesting. \layout SGML \layout SGML \end_deeper \layout Section Controlling Processes \begin_inset LatexCommand \label{controlling-processes} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard should this be kept? because I'm sure 90% of users use bash only\SpecialChar \ldots{} \layout Description nohup (no-hangup). Stops a particular process from being stopped by the user logging out, because if you start a process and logout, some shells will stop the process (bash, by default doesn't do this). \begin_deeper \layout Description Command syntax: \layout Code nohup command_to_be_protected \end_deeper \layout Standard (too oldschool): \layout Description sync \emph on sync \emph default forces all things in buffers to be put to disk. \end_inset \layout Description ps \begin_inset LatexCommand \index{ps} \end_inset Will give you a list \begin_inset LatexCommand \index{list} \end_inset of the processes \begin_inset LatexCommand \index{processes} \end_inset running on your system. With no options, \emph on ps \emph default will list processes \begin_inset LatexCommand \index{processes} \end_inset that belong to the current user and have a controlling \begin_inset LatexCommand \index{controlling} \end_inset terminal. \begin_deeper \layout Standard Example options include: \layout Itemize \emph on -aux \emph default --- list all running \begin_inset LatexCommand \index{running} \end_inset processes \begin_inset LatexCommand \index{processes} \end_inset (by all users with some information). \layout Itemize \emph on -a \begin_inset LatexCommand \index{-a} \end_inset \emph default --- list all processes from all users. \layout Itemize \emph on -u \begin_inset LatexCommand \index{-u} \end_inset \emph default --- list more information \begin_inset LatexCommand \index{information} \end_inset including user names, %cpu \begin_inset LatexCommand \index{%cpu} \end_inset usage, and %mem \begin_inset LatexCommand \index{%mem} \end_inset usage et cetera. \layout Itemize \emph on -x \begin_inset LatexCommand \index{-x} \end_inset \emph default --- list processes \begin_inset LatexCommand \index{processes} \end_inset without controlling \begin_inset LatexCommand \index{controlling} \end_inset terminals. \layout Itemize \emph on -l \begin_inset LatexCommand \index{-l} \end_inset \emph default --- display different information including UID \begin_inset LatexCommand \index{UID} \end_inset and nice \begin_inset LatexCommand \index{nice} \end_inset value. \begin_inset LatexCommand \index{value} \end_inset \layout Itemize \emph on --forest \begin_inset LatexCommand \index{--forest} \end_inset \emph default --- this makes it easier to see the process \begin_inset LatexCommand \index{process} \end_inset hierarchy, which \begin_inset LatexCommand \index{which} \end_inset will give you an indication \begin_inset LatexCommand \index{indication} \end_inset of how the various processes \begin_inset LatexCommand \index{processes} \end_inset on your system interrelate \begin_inset LatexCommand \index{interrelate} \end_inset (although you should also try \emph on pstree \emph default ). \layout Standard For example to list all running \begin_inset LatexCommand \index{running} \end_inset processes \begin_inset LatexCommand \index{processes} \end_inset with additional \begin_inset LatexCommand \index{additional} \end_inset information, simply type: \layout Code ps -aux \end_deeper \layout Description pstree \begin_inset LatexCommand \index{pstree} \end_inset Displays the processes \begin_inset LatexCommand \index{processes} \end_inset in the form \begin_inset LatexCommand \index{form} \end_inset of a tree \begin_inset LatexCommand \index{tree} \end_inset structure (similar to how \emph on tree \emph default does it for directories). \begin_deeper \layout Standard Use the \emph on -p \begin_inset LatexCommand \index{-p} \end_inset \emph default option \begin_inset LatexCommand \index{option} \end_inset to show \begin_inset LatexCommand \index{show} \end_inset process id's. \begin_inset LatexCommand \index{id's} \end_inset \layout Standard Example: \layout Code pstree -p \layout Standard This would list all processes \begin_inset LatexCommand \index{processes} \end_inset and their id's. \begin_inset LatexCommand \index{id's} \end_inset \end_deeper \layout Description pgrep \begin_inset LatexCommand \index{pgrep} \end_inset This command is useful for finding \begin_inset LatexCommand \index{finding} \end_inset the process id \begin_inset LatexCommand \index{process id} \end_inset of a particular \begin_inset LatexCommand \index{particular} \end_inset process when you know part \begin_inset LatexCommand \index{part} \end_inset of its name. \begin_deeper \layout Standard Use the \emph on -l \begin_inset LatexCommand \index{-l} \end_inset \emph default option to list the name of the process as well and the \emph on -u \begin_inset LatexCommand \index{-u} \end_inset \emph default option to search \begin_inset LatexCommand \index{search} \end_inset via a particular user(s). \layout Standard Normally \emph on pgrep \emph default will only return \begin_inset LatexCommand \index{return} \end_inset the pid \begin_inset LatexCommand \index{pid} \end_inset number; this way you can use it with other commands. \layout Standard Examples: \layout Code kill $(pgrep mozilla) \layout Standard This would kill \begin_inset LatexCommand \index{kill} \end_inset any process name that starts \begin_inset LatexCommand \index{starts} \end_inset with mozilla. \begin_inset LatexCommand \index{mozilla} \end_inset Note that this is the same as using \emph on pkill \emph default (see below). \layout Standard If you are unfamiliar \begin_inset LatexCommand \index{unfamiliar} \end_inset with the \emph on $(\SpecialChar ~ ) \emph default part \begin_inset LatexCommand \index{part} \end_inset of this command, please refer \begin_inset LatexCommand \index{refer} \end_inset to \begin_inset LatexCommand \ref{performing-more-than-one-command} \end_inset . \layout Standard To list processes id's and names type: \layout Code pgrep -l process_name \end_deeper \layout Description top \begin_inset LatexCommand \index{top} \end_inset Displays the 'top' (as in CPU \begin_inset LatexCommand \index{CPU} \end_inset usage) processes, \begin_inset LatexCommand \index{processes} \end_inset provides \begin_inset LatexCommand \index{provides} \end_inset more detail \begin_inset LatexCommand \index{detail} \end_inset than \emph on ps \emph default . \begin_deeper \layout Standard \emph on top \emph default also provides \begin_inset LatexCommand \index{provides} \end_inset an updated \begin_inset LatexCommand \index{updated} \end_inset display, it has many options \begin_inset LatexCommand \index{option} \end_inset that make it fully customisable, \begin_inset LatexCommand \index{customisable} \end_inset refer \begin_inset LatexCommand \index{refer} \end_inset to the manual or info \begin_inset LatexCommand \index{info} \end_inset page \begin_inset LatexCommand \index{page} \end_inset for details. \begin_inset Note collapsed false \layout Standard does someone want to explain the options? I don't know how to use \emph on top \emph default \SpecialChar \ldots{} \end_inset \end_deeper \layout Description kill To kill processes \begin_inset LatexCommand \index{processes} \end_inset on your system, you will need their pid's \begin_inset LatexCommand \index{pid's} \end_inset or id's \begin_inset LatexCommand \index{id's} \end_inset . Use \emph on ps \emph default or \emph on pstree \emph default to find \begin_inset LatexCommand \index{find} \end_inset out the process id's \begin_inset LatexCommand \index{id's} \end_inset (pid's), or use \emph on jobs \emph default to find out id's. \begin_inset LatexCommand \index{id's} \end_inset \begin_deeper \layout SGML \layout SGML killall and pkill - kill a process by name \layout SGML \emph on pkill \emph default and \emph on killall \emph default can be a lot easier to use than \emph on kill \emph default . \emph on pkill \emph default allows you to type part of the name of a process to kill it, while \emph on killall \emph default requires the full process name. See below for more information. \layout SGML \layout Standard Examples: \layout Code kill pid \layout Standard Simply kill a process (allow it time \begin_inset LatexCommand \index{time} \end_inset to save \begin_inset LatexCommand \index{save} \end_inset it's files and exit) \layout Code kill %id \layout Standard Same as above, except it uses an id \begin_inset LatexCommand \index{id} \end_inset instead of a pid, \begin_inset LatexCommand \index{pid} \end_inset you need to use a % (percent) when using an id \begin_inset LatexCommand \index{id} \end_inset to kill. \layout Code kill -kill pid \begin_inset LatexCommand \index{-kill} \end_inset \layout Standard Force \begin_inset LatexCommand \index{Force} \end_inset a process to be killed \begin_inset LatexCommand \index{killed} \end_inset (won't allow \begin_inset LatexCommand \index{allow} \end_inset files to be saved \begin_inset LatexCommand \index{saved} \end_inset or updated); only use when necessary because all data \begin_inset LatexCommand \index{data} \end_inset that the program \begin_inset LatexCommand \index{program} \end_inset had will be lost. \begin_inset LatexCommand \index{lost} \end_inset \layout Standard There are also many other kill options such as kill -HUP \begin_inset LatexCommand \index{-HUP} \end_inset \emph on \emph default (hangup) \emph on \SpecialChar \ldots{} \emph default refer \begin_inset LatexCommand \index{refer} \end_inset to the manual/info pages \begin_inset LatexCommand \index{pages} \end_inset for more \begin_inset LatexCommand \index{more} \end_inset information. \end_deeper \layout Standard \begin_inset Note collapsed false \layout Standard personally I think removing kill and killall would be ok, but that may offend some people\SpecialChar \ldots{} \end_inset \layout Description killall \begin_inset LatexCommand \index{killall} \end_inset Kill a process by it's name, uses names instead of process \begin_inset LatexCommand \index{process} \end_inset id's \begin_inset LatexCommand \index{id's} \end_inset (pid's). Use \emph on -v \begin_inset LatexCommand \index{-v} \end_inset \emph default to have \emph on killall \emph default report \begin_inset LatexCommand \index{report} \end_inset whether the kill \begin_inset LatexCommand \index{kill} \end_inset was successful \begin_inset LatexCommand \index{successful} \end_inset or not and \emph on -i \begin_inset LatexCommand \index{-i} \end_inset \emph default for interactive \begin_inset LatexCommand \index{interactive} \end_inset mode (will prompt \begin_inset LatexCommand \index{prompt} \end_inset you before attempting \begin_inset LatexCommand \index{attempting} \end_inset to kill). \begin_deeper \layout SGML \layout SGML pkill - a little like a killall with regular expressions \layout SGML pkill is another command that allows processes to be killed but does so using regular expressions. See below for more information. \layout SGML \layout Standard For example: \layout Code killall -iv mozilla \layout Standard Would kill anything named \begin_inset LatexCommand \index{named} \end_inset \begin_inset Quotes eld \end_inset mozilla \begin_inset Quotes erd \end_inset and prompt \begin_inset LatexCommand \index{prompt} \end_inset you before each kill and report \begin_inset LatexCommand \index{report} \end_inset whether the kill was successful \begin_inset LatexCommand \index{successful} \end_inset or not. Unfortunately \begin_inset LatexCommand \index{Unfortunately} \end_inset you need to get the name exactly \begin_inset LatexCommand \index{exactly} \end_inset right for \emph on killall \emph default to work, you would need to use \begin_inset Quotes eld \end_inset mozilla-bin \begin_inset Quotes erd \end_inset to kill the mozilla \begin_inset LatexCommand \index{mozilla} \end_inset browser. If you want something where you don't need to know the exact \begin_inset LatexCommand \index{exact} \end_inset name try \emph on pkill \emph default (below). \end_deeper \layout Description pkill \begin_inset LatexCommand \index{pkill} \end_inset \emph on pkill \emph default is used to kill processes \begin_inset LatexCommand \index{processes} \end_inset according to an extended \begin_inset LatexCommand \index{extended} \end_inset regular expression. \begin_inset LatexCommand \index{regular expression} \end_inset Use the \emph on -u \begin_inset LatexCommand \index{-u} \end_inset \emph default option to kill using a user name(s) and process name (for example to only kill a process of a certain user). \emph on pkill \emph default can also send \begin_inset LatexCommand \index{send} \end_inset specific signals \begin_inset LatexCommand \index{signals} \end_inset to processes. \begin_inset LatexCommand \index{processes} \end_inset \begin_deeper \layout Standard For normal \begin_inset LatexCommand \index{normal} \end_inset usage simply type: \layout Code pkill process_name \layout Standard Note that the \begin_inset Quotes eld \end_inset process_name \begin_inset Quotes erd \end_inset doesn't have to be an exact match\SpecialChar \ldots{} \layout Standard Or to kill the \begin_inset Quotes eld \end_inset process_name \begin_inset Quotes erd \end_inset of only the users \begin_inset Quotes eld \end_inset fred \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset anon \begin_inset Quotes erd \end_inset type: \layout Code pkill -u fred anon process_name \end_deeper \layout Description skill \begin_inset LatexCommand \index{skill} \end_inset \emph on skill \emph default is used to send \begin_inset LatexCommand \index{send} \end_inset a command/username/tty a particular \begin_inset LatexCommand \index{particular} \end_inset signal. \begin_inset LatexCommand \index{signal} \end_inset \begin_inset Note collapsed false \layout Standard skill and snice do not use regular expressions (tested!!!!) \end_inset \begin_deeper \layout Standard \emph on skill \emph default has a number \begin_inset LatexCommand \index{number} \end_inset of options \begin_inset LatexCommand \index{options} \end_inset available \begin_inset LatexCommand \index{available} \end_inset to ensure correct \begin_inset LatexCommand \index{correct} \end_inset interpretation (otherwise it just guesses what it is), simply type \emph on skill \begin_inset LatexCommand \index{skill} \end_inset -option(s) \layout Itemize \emph on -L \begin_inset LatexCommand \index{-L} \end_inset \emph default --- list \begin_inset LatexCommand \index{list} \end_inset the various signals \begin_inset LatexCommand \index{signals} \end_inset that can be sent \layout Itemize \emph on -u \begin_inset LatexCommand \index{-u} \end_inset \emph default --- specify \begin_inset LatexCommand \index{specify} \end_inset a username; this is obviously followed \begin_inset LatexCommand \index{followed} \end_inset by the user name or a space-seperated \begin_inset LatexCommand \index{space-seperated} \end_inset list of usernames. \begin_inset LatexCommand \index{usernames} \end_inset \layout Itemize \emph on -p \begin_inset LatexCommand \index{-p} \end_inset \emph default --- process id \begin_inset LatexCommand \index{id} \end_inset (followed by the process id) \layout Itemize \emph on -c \begin_inset LatexCommand \index{-c} \end_inset \emph default --- command name (this is the same as \emph on killall \emph default ) \layout Itemize \emph on -t \begin_inset LatexCommand \index{-t} \end_inset \emph default --- (tty number) \layout Itemize \emph on -v \begin_inset LatexCommand \index{-v} \end_inset \emph default --- verbose \begin_inset LatexCommand \index{verbose} \end_inset mode \begin_inset LatexCommand \index{mode} \end_inset \layout Itemize \emph on -i \begin_inset LatexCommand \index{-i} \end_inset \emph default --- interactive \begin_inset LatexCommand \index{interactive} \end_inset mode. \layout Standard \emph on skill \emph default can be used to stop, \begin_inset LatexCommand \index{stop} \end_inset continue, or kill processes \begin_inset LatexCommand \index{processes} \end_inset using the username, \begin_inset LatexCommand \index{username} \end_inset command name or process id (or send \begin_inset LatexCommand \index{send} \end_inset them any variety \begin_inset LatexCommand \index{variety} \end_inset of signals \begin_inset LatexCommand \index{signals} \end_inset you like). \layout Standard Useful example: \layout Code skill -STOP \begin_inset LatexCommand \index{-STOP} \end_inset abusive_user_name \layout Standard The above command will stop \begin_inset LatexCommand \index{stop} \end_inset all of that users processes, \begin_inset LatexCommand \index{processes} \end_inset this will cause \begin_inset LatexCommand \index{cause} \end_inset his screen \begin_inset LatexCommand \index{screen} \end_inset to freeze \begin_inset LatexCommand \index{freeze} \end_inset until you type: \layout Code skill -CONT \begin_inset LatexCommand \index{-CONT} \end_inset abusive_user_name \layout Standard This would tell \begin_inset LatexCommand \index{tell} \end_inset that all processes \begin_inset LatexCommand \index{processes} \end_inset may continue as before. Note that this would only work if you are root. \begin_inset LatexCommand \index{root} \end_inset Also note you can list more than one user name with the command so it will apply \begin_inset LatexCommand \index{apply} \end_inset to multiple \begin_inset LatexCommand \index{multiple} \end_inset users. \end_deeper \layout Description CTRL-C The break key, \begin_inset LatexCommand \index{break key} \end_inset will kill (break, stop) something that's running \begin_inset LatexCommand \index{running} \end_inset on your terminal. \begin_inset LatexCommand \index{terminal} \end_inset \layout Description jobs \begin_inset LatexCommand \index{jobs} \end_inset Prints \begin_inset LatexCommand \index{Prints} \end_inset currently running \begin_inset LatexCommand \index{running} \end_inset jobs, as in processes \begin_inset LatexCommand \index{processes} \end_inset you have executed within the shell. \begin_inset LatexCommand \index{shell} \end_inset \layout Description bg \begin_inset LatexCommand \index{bg} \end_inset Backgrounds \begin_inset LatexCommand \index{Backgrounds} \end_inset a process. To start \begin_inset LatexCommand \index{start} \end_inset a program in the background \begin_inset LatexCommand \index{background} \end_inset (so it doesn't take over the terminal) use an \begin_inset Quotes eld \end_inset & \begin_inset Quotes erd \end_inset (ampersand) sign \begin_inset LatexCommand \index{sign} \end_inset at the end of the command. You usually use CTRL-Z to suspend \begin_inset LatexCommand \index{suspend} \end_inset something you are currently using. You can simply use \emph on bg \emph default to resume in the background the last job suspended\SpecialChar \ldots{} \begin_deeper \layout Standard Command syntax: \layout Code bg job_number \layout Standard or \layout Code bg job_name \end_deeper \layout Description fg \begin_inset LatexCommand \index{fg} \end_inset Bring a process to the foreground, \begin_inset LatexCommand \index{foreground} \end_inset so you can interact \begin_inset LatexCommand \index{interact} \end_inset with it. The process will use your current terminal. \begin_inset LatexCommand \index{terminal} \end_inset Note simply use \emph on fg \emph default to foreground the last job number suspended\SpecialChar \ldots{} \begin_deeper \layout Standard You can bring jobs \begin_inset LatexCommand \index{jobs} \end_inset to the foreground \begin_inset LatexCommand \index{foreground} \end_inset by name or by number (use \emph on jobs \emph default to find the number). \layout Standard Command syntax: \layout Code fg job_number \layout Standard or \layout Code fg job_name \end_deeper \layout Description nice \begin_inset LatexCommand \index{nice} \end_inset Sets \begin_inset LatexCommand \index{Sets} \end_inset the priority \begin_inset LatexCommand \index{priority} \end_inset for a process. \emph on nice -20 \emph default is the maximum \begin_inset LatexCommand \index{maximum} \end_inset priority \begin_inset LatexCommand \index{priority} \end_inset (only administrative \begin_inset LatexCommand \index{administrative} \end_inset users can assign \begin_inset LatexCommand \index{assign} \end_inset negative priorities), \emph on nice 20 \emph default is the minimum \begin_inset LatexCommand \index{minimum} \end_inset priority. You must \begin_inset LatexCommand \index{must} \end_inset be root to give a process a higher \begin_inset LatexCommand \index{higher} \end_inset priority, but you can always lower the priority of your own processes\SpecialChar \ldots{} \begin_deeper \layout Standard Example: \layout Code nice -20 make \layout Standard Would execute \begin_inset LatexCommand \index{execute} \end_inset \emph on make \emph default and it would run \begin_inset LatexCommand \index{run} \end_inset at maximum priority. \begin_inset LatexCommand \index{priority} \end_inset \end_deeper \layout Description renice \begin_inset LatexCommand \index{renice} \end_inset Changes the priority of an existing \begin_inset LatexCommand \index{existing} \end_inset command. You may use the options \emph on -u \begin_inset LatexCommand \index{-u} \end_inset \emph default to change \begin_inset LatexCommand \index{change} \end_inset the priorities \begin_inset LatexCommand \index{priorities} \end_inset of all processes \begin_inset LatexCommand \index{processes} \end_inset for a particular user name and \emph on -g \begin_inset LatexCommand \index{-g} \end_inset \emph default to change \begin_inset LatexCommand \index{change} \end_inset priorities for all processes \begin_inset LatexCommand \index{processes} \end_inset of a particular group. \begin_inset LatexCommand \index{group} \end_inset The default \begin_inset LatexCommand \index{default} \end_inset is to change \begin_inset LatexCommand \index{change} \end_inset via the process id number. \begin_deeper \layout Standard Example: \layout Code renice +20 2222 \layout Standard This would change \begin_inset LatexCommand \index{change} \end_inset the priority \begin_inset LatexCommand \index{priority} \end_inset of process 2222 to +20 (minimum priority). \end_deeper \layout Description snice \begin_inset LatexCommand \index{snice} \end_inset \emph on snice \emph default works very similarly to \emph on skill \emph default , only it changes the priority \begin_inset LatexCommand \index{priority} \end_inset of the process(es). Its function \begin_inset LatexCommand \index{function} \end_inset is similar to that of \emph on renice \emph default . \begin_deeper \layout Standard To use options (to ensure correct \begin_inset LatexCommand \index{correct} \end_inset interpretation) you simply type \emph on snice -option(s): \layout Itemize \emph on -u \emph default --- specify \begin_inset LatexCommand \index{specify} \end_inset a username; this is obviously followed \begin_inset LatexCommand \index{followed} \end_inset by the user name or a space-seperated \begin_inset LatexCommand \index{space-seperated} \end_inset list of usernames. \begin_inset LatexCommand \index{usernames} \end_inset \layout Itemize \emph on -p \emph default --- process id \begin_inset LatexCommand \index{id} \end_inset (followed by the process id) \layout Itemize \emph on -c \emph default --- command name (this is the same as \emph on killall \emph default ) \layout Itemize \emph on -t \emph default --- tty number \layout Itemize \emph on -v \emph default --- verbose \begin_inset LatexCommand \index{verbose} \end_inset mode \begin_inset LatexCommand \index{mode} \end_inset \layout Itemize \emph on -i \begin_inset LatexCommand \index{-i} \end_inset \emph default --- interactive \begin_inset LatexCommand \index{interactive} \end_inset mode. \layout Standard Example: \layout Code snice -10 -u root \layout Standard This would increase \begin_inset LatexCommand \index{increase} \end_inset the priority \begin_inset LatexCommand \index{priority} \end_inset of all root's processes. \begin_inset LatexCommand \index{processes} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard does this command replace renice or is it just more useful or something? it seems to have more functionality. \end_inset \end_deeper \layout Section Controlling services \begin_inset LatexCommand \label{controlling-services} \end_inset \layout Description Concept\SpecialChar ~ Definitions \begin_inset LatexCommand \label{services-concept} \end_inset \begin_deeper \layout Standard UNIX \begin_inset LatexCommand \index{UNIX} \end_inset systems use scripts \begin_inset LatexCommand \index{scripts} \end_inset to control \begin_inset LatexCommand \index{control} \end_inset \begin_inset Quotes eld \end_inset daemons \begin_inset Quotes erd \end_inset which provide \begin_inset LatexCommand \index{provide} \end_inset \begin_inset Quotes eld \end_inset services \begin_inset Quotes erd \end_inset (for example your sound \begin_inset LatexCommand \index{sound} \end_inset output) to run a UNIX system. UNIX systems consist of a variety \begin_inset LatexCommand \index{variety} \end_inset of services \begin_inset LatexCommand \index{services} \end_inset (daemons). \layout Standard A \begin_inset Quotes eld \end_inset daemon \begin_inset Quotes erd \end_inset is a system process which runs in the background \begin_inset LatexCommand \index{background} \end_inset (zero interaction) performing \begin_inset LatexCommand \index{performing} \end_inset a particular task. \begin_inset LatexCommand \index{task} \end_inset \layout Standard Daemons \begin_inset LatexCommand \index{Daemons} \end_inset normally have a \begin_inset Quotes eld \end_inset d \begin_inset Quotes erd \end_inset on the end of their name and either listen \begin_inset LatexCommand \index{listen} \end_inset for certain events \begin_inset LatexCommand \index{events} \end_inset or perform \begin_inset LatexCommand \index{perform} \end_inset a system task, \begin_inset LatexCommand \index{task} \end_inset for example \emph on sshd \emph default listens \begin_inset LatexCommand \index{listens} \end_inset for secure shell requests to the particular \begin_inset LatexCommand \index{particular} \end_inset machine \begin_inset LatexCommand \index{machine} \end_inset and handles \begin_inset LatexCommand \index{handles} \end_inset them when they occur. \layout Standard Daemons usually perform critical \begin_inset LatexCommand \index{critical} \end_inset system tasks \begin_inset LatexCommand \index{tasks} \end_inset such as control \begin_inset LatexCommand \index{control} \end_inset swap-space, memory \begin_inset LatexCommand \index{memory} \end_inset management \begin_inset LatexCommand \index{management} \end_inset and various other tasks. \begin_inset LatexCommand \index{tasks} \end_inset \end_deeper \layout Description service \begin_inset LatexCommand \index{service} \end_inset \emph on service \emph default is a shell script available \begin_inset LatexCommand \index{available} \end_inset on Mandrake/Mandriva \begin_inset LatexCommand \index{Mandriva} \end_inset \begin_inset LatexCommand \index{Mandrake} \end_inset and Redhat \begin_inset LatexCommand \index{Redhat} \end_inset systems which allows \begin_inset LatexCommand \index{allows} \end_inset you to perform various tasks \begin_inset LatexCommand \index{tasks} \end_inset on services. \begin_inset LatexCommand \index{services} \end_inset \begin_deeper \layout Itemize Use the \emph on -s \begin_inset LatexCommand \index{-s} \end_inset \emph default option to print \begin_inset LatexCommand \index{print} \end_inset the status \begin_inset LatexCommand \index{status} \end_inset of all services \begin_inset LatexCommand \index{services} \end_inset available \begin_inset LatexCommand \index{available} \end_inset \layout Itemize Use the \emph on -f \begin_inset LatexCommand \index{-f} \end_inset \emph default option followed \begin_inset LatexCommand \index{followed} \end_inset by a service \begin_inset LatexCommand \index{service} \end_inset name to restart \begin_inset LatexCommand \index{restart} \end_inset that particular service. \layout Itemize Use the \emph on -R \begin_inset LatexCommand \index{-R} \end_inset \emph default option to restart \begin_inset LatexCommand \index{restart} \end_inset all services \begin_inset LatexCommand \index{services} \end_inset (note that this will kill \begin_inset LatexCommand \index{kill} \end_inset any current services running, \begin_inset LatexCommand \index{running} \end_inset including the X windows system). \layout Standard For example to restart \begin_inset LatexCommand \index{restart} \end_inset the daemon \begin_inset LatexCommand \index{daemon} \end_inset \emph on sshd \begin_inset LatexCommand \index{sshd} \end_inset \emph default you would type: \layout Code service -f sshd \end_deeper \layout Description Using\SpecialChar ~ the\SpecialChar ~ script\SpecialChar ~ directly You may also execute the shell script directly from \emph on /etc/init.d \emph default \begin_inset LatexCommand \index{/etc/init.d} \end_inset . Simply go to that directory \begin_inset LatexCommand \index{directory} \end_inset then type \emph on ./script_name \emph default . \begin_deeper \layout Standard Executing the script \begin_inset LatexCommand \index{script} \end_inset should return \begin_inset LatexCommand \index{return} \end_inset the options it can take, by default \begin_inset LatexCommand \index{default} \end_inset they will be: \layout Itemize restart \begin_inset LatexCommand \index{restart} \end_inset --- this will make the service \begin_inset LatexCommand \index{service} \end_inset stop \begin_inset LatexCommand \index{stop} \end_inset and then start again. \layout Itemize start --- this option \begin_inset LatexCommand \index{option} \end_inset will start a service (assuming its not running). \layout Itemize stop --- this option will stop a service (assuming its running). \layout Itemize status \begin_inset LatexCommand \index{status} \end_inset --- this option will tell \begin_inset LatexCommand \index{tell} \end_inset you about the service \begin_inset LatexCommand \index{service} \end_inset \end_deeper \layout Chapter Managing users \begin_inset LatexCommand \label{Managing-users} \end_inset \layout Description su\SpecialChar ~ username \begin_inset LatexCommand \index{su} \end_inset (Switch User), change \begin_inset LatexCommand \index{change} \end_inset to a different \begin_inset LatexCommand \index{different} \end_inset user. \begin_deeper \layout Standard Use \emph on su\SpecialChar ~ - \emph default to switch \begin_inset LatexCommand \index{switch} \end_inset to root or \emph on su username \emph default , to switch \begin_inset LatexCommand \index{switch} \end_inset to a different \begin_inset LatexCommand \index{different} \end_inset username. \layout SGML \layout SGML Using sudo \begin_inset LatexCommand \index{sudo} \end_inset \layout SGML Its often considered better practice to use the \emph on sudo \emph default command rather than switch to the root user \layout SGML The \emph on sudo \emph default command allows you to perform actions as root but logs the actions you take (so you can trace anything that was done to the system by yourself or others). \emph on sudo \emph default has a very good manual page which provides plenty of information about it. \layout SGML You use sudo similar to how you execute a normal command with sudo prepended to it, for example: \layout SGML sudo rpm -U myrpm.i386.rpm \layout SGML This would allow you to install a rpm even if you have the correct sudo access \layout SGML \layout Standard Note that if you want to return \begin_inset LatexCommand \index{return} \end_inset to your original \begin_inset LatexCommand \index{original} \end_inset user you don't use \emph on su \emph default again, type \emph on exit \emph default or press \begin_inset LatexCommand \index{press} \end_inset CTRL-D. \layout Standard Simply typing \emph on su \emph default will give you some root \begin_inset LatexCommand \index{root} \end_inset privileges, \begin_inset LatexCommand \index{privileges} \end_inset but there are minor \begin_inset LatexCommand \index{minor} \end_inset complications relating to environment \begin_inset LatexCommand \index{environment} \end_inset variables. It's generally considered better practice \begin_inset LatexCommand \index{practice} \end_inset to use \emph on su\SpecialChar ~ - \emph default because it has no restrictions. \begin_inset LatexCommand \index{restrictions} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard do I need to explain why? I think it relates to not having certain environment variables as root so you are slightly restricted (but I'm not sure)\SpecialChar \ldots{} LinuxChix group knows. \layout Standard probably similar to the information on newgrp (using the - and not using it)\SpecialChar \ldots{} re-initializes the environment. Added an explanation that I *think* is correct. \end_inset \end_deeper \layout Description root The superuser. \begin_inset LatexCommand \index{superuser} \end_inset This user has power \begin_inset LatexCommand \index{power} \end_inset over everything \begin_inset LatexCommand \index{everything} \end_inset and all, and can do anything with the system (including destroy \begin_inset LatexCommand \index{destroy} \end_inset it, and of course fix \begin_inset LatexCommand \index{fix} \end_inset it :)). This user is used to perform most administration \begin_inset LatexCommand \index{administration} \end_inset functions \begin_inset LatexCommand \index{functions} \end_inset on the system. \layout Section \noindent Users/Groups \begin_inset LatexCommand \label{users-and-groups} \end_inset \layout Standard \begin_inset Note collapsed false \layout Subsubsection General \begin_inset LatexCommand \label{general} \end_inset \layout Description id Print UID and GID (user and group ID) information of a particular user. \begin_deeper \layout Standard Command syntax: \layout Code id user_name \layout Standard This will print out the UID and GID for that particular user. \end_deeper \layout Description users Lists which users are currently logged into the system. Doesn't need or take any options. \begin_deeper \layout Standard Simply type: \layout Code users \end_deeper \layout Subsubsection User Specific \begin_inset LatexCommand \label{user-specific} \end_inset \layout Description useradd Adds a new user to the system. \layout Standard Command syntax: \layout Code useradd user_name \layout Description adduser Same as above. Sometimes used instead of \emph on useradd \emph default , on some systems it's simply a symbolic link to \emph on useradd \emph default . \layout Description \noindent userdel Deletes a user and their related files (home directory, mail directory). \begin_deeper \layout Standard \noindent Command syntax: \layout Code userdel user_name \end_deeper \layout Description deluser Same as above. Sometimes used instead of \emph on userdel \emph default , on some systems it's simply a symbolic link to \emph on userdel. \layout Description \noindent usermod To change certain attributes of a user (eg. name). \begin_deeper \layout SGML \layout SGML Tip: \layout SGML \layout SGML Use the \emph on -g \emph default switch to specify the initial group of the user. Then use the \emph on -G \emph default option to specify supplementary groups, you will need to list all groups you want the user to be in (because this will replace any existing group memberships). \layout SGML \layout SGML \end_deeper \layout Subsubsection Group Specific \begin_inset LatexCommand \label{group-specific} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard This might be useful but I don't know what it does really\SpecialChar \ldots{} \layout Standard gpasswd This command allows the administration of the /etc/group file. \layout Standard You can use this command to add administrators to a particular group, these admins can then add or remove users. \layout Standard gpasswd group_name -A list_of_users \end_inset \layout Description \noindent chgrp To change which group the file belongs too (so more users can access it). \begin_deeper \layout Standard \noindent Command syntax: \layout Code chgrp group_name file_or_files \end_deeper \layout Description \noindent groupadd Create a new group (so you can add users to this new group). \begin_deeper \layout Standard \noindent Command syntax: \layout Code groupadd group_name \end_deeper \layout Description \noindent groupdel Delete a group from the system. \begin_deeper \layout Code groupdel group_name \end_deeper \layout Description \noindent groupmod Modify group information (eg. to change the name of a group). \layout Description \noindent groups To find out what groups you are in or what groups other users are in. \begin_deeper \layout Standard \noindent Command syntax: \layout Code groups user_name \end_inset \layout Standard All user information \begin_inset LatexCommand \index{information} \end_inset is normally listed in the \begin_inset Quotes eld \end_inset /etc/passwd \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{/etc/passwd} \end_inset file and the group \begin_inset LatexCommand \index{group} \end_inset information in the \begin_inset Quotes eld \end_inset /etc/groups \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{/etc/groups} \end_inset file. \layout Standard If you need to edit \begin_inset LatexCommand \index{edit} \end_inset either file it is recommended \begin_inset LatexCommand \index{recommended} \end_inset that you use \emph on vipw \emph default to edit the password file and \emph on vigr \emph default to edit the group \begin_inset LatexCommand \index{group} \end_inset file. These particular \begin_inset LatexCommand \index{particular} \end_inset commands take care of any processing \begin_inset LatexCommand \index{processing} \end_inset and locking \begin_inset LatexCommand \index{locking} \end_inset of the files before and after editing \begin_inset LatexCommand \index{editing} \end_inset them. \layout Standard There is a lot of information about adding/removing/controlling users and groups, \begin_inset LatexCommand \index{groups} \end_inset this information is only the minimal \begin_inset LatexCommand \index{minimal} \end_inset information required. \layout Description chsh \begin_inset LatexCommand \index{chsh} \end_inset Used to change \begin_inset LatexCommand \index{change} \end_inset your login \begin_inset LatexCommand \index{login} \end_inset shell. \begin_deeper \layout Standard To list \begin_inset LatexCommand \index{list} \end_inset the shells \begin_inset LatexCommand \index{shells} \end_inset available \begin_inset LatexCommand \index{available} \end_inset type: \layout Code chsh --list-shells \layout Standard Simply type \emph on chsh \begin_inset LatexCommand \index{chsh} \end_inset \emph default then [Enter], then type the name of the shell you would like to use every time \begin_inset LatexCommand \index{time} \end_inset you login. \begin_inset LatexCommand \index{login} \end_inset \end_deeper \layout Description chfn \begin_inset LatexCommand \index{chfn} \end_inset Change \begin_inset LatexCommand \index{Change} \end_inset finger \begin_inset LatexCommand \index{finger} \end_inset information. \begin_deeper \layout Standard The information \begin_inset LatexCommand \index{information} \end_inset this command changes is reflected \begin_inset LatexCommand \index{reflected} \end_inset in the /etc/passwd file, use this utility \begin_inset LatexCommand \index{utility} \end_inset to update \begin_inset LatexCommand \index{update} \end_inset your real name, office \begin_inset LatexCommand \index{office} \end_inset and home \begin_inset LatexCommand \index{home} \end_inset phone numbers \begin_inset LatexCommand \index{numbers} \end_inset (if they exist). \layout Standard Use the \emph on -f \emph default option to change a users full name. Use this tool as either \emph on chfn \emph default or \emph on chfn user_name \emph default (usable by root only). \layout Standard Command syntax: \layout Code chfn user_name \end_deeper \layout Description \noindent passwd \begin_inset LatexCommand \index{passwd} \end_inset Changes the password of a user. You will need to be root if you want to change \begin_inset LatexCommand \index{change} \end_inset other users passwords. \begin_inset LatexCommand \index{passwords} \end_inset \begin_deeper \layout Standard \noindent Simply type \emph on passwd \begin_inset LatexCommand \index{passwd} \end_inset \emph default to change \begin_inset LatexCommand \index{change} \end_inset your own password or to change \begin_inset LatexCommand \index{change} \end_inset another users password \begin_inset LatexCommand \index{password} \end_inset type: \layout Code passwd username \end_deeper \layout Chapter Text Related Tools \begin_inset LatexCommand \label{Text-related-tools} \end_inset \layout Standard The text \begin_inset LatexCommand \index{text} \end_inset related tools chapter is the largest in this guide, \begin_inset LatexCommand \index{guide} \end_inset most of the time on a GNU/Linux machine \begin_inset LatexCommand \index{machine} \end_inset you will spend \begin_inset LatexCommand \index{spend} \end_inset time interacting with text. This chapter briefly covers text editors \begin_inset LatexCommand \index{editors} \end_inset and goes into more \begin_inset LatexCommand \index{more} \end_inset depth \begin_inset LatexCommand \index{depth} \end_inset on viewing \begin_inset LatexCommand \index{viewing} \end_inset text, using tools to manipulate \begin_inset LatexCommand \index{manipulate} \end_inset text, finding text within files and changing text formats \begin_inset LatexCommand \index{formats} \end_inset between windows \begin_inset LatexCommand \index{windows} \end_inset based systems and GNU/Linux based systems. \layout Section Text Editors \begin_inset LatexCommand \label{text-editors} \end_inset \layout Description vi \begin_inset LatexCommand \index{vi} \end_inset A traditional \begin_inset LatexCommand \index{traditional} \end_inset UNIX \begin_inset LatexCommand \index{UNIX} \end_inset system text editor, \begin_inset LatexCommand \index{editor} \end_inset should be on any UNIX system. It requires learning \begin_inset LatexCommand \index{learning} \end_inset a few key \begin_inset LatexCommand \index{key} \end_inset combinations, but is very powerful, \begin_inset LatexCommand \index{powerful} \end_inset and it is also quite \begin_inset LatexCommand \index{quite} \end_inset small. vi \begin_inset LatexCommand \index{vi} \end_inset is well known for its minimal \begin_inset LatexCommand \index{minimal} \end_inset use of resources. \begin_inset LatexCommand \index{resources} \end_inset \begin_deeper \layout SGML \layout SGML vim \layout SGML \emph on vim \emph default - vi improved. A newer version of the vulnerable \emph on vi \emph default editor. Many systems use \emph on vim \emph default rather than \emph on vi \emph default . \layout SGML \layout SGML \end_deeper \layout Description emacs \begin_inset LatexCommand \index{emacs} \end_inset More than just a text editor. \begin_inset LatexCommand \index{editor} \end_inset This text editor \begin_inset LatexCommand \index{editor} \end_inset has a steep \begin_inset LatexCommand \index{steep} \end_inset learning \begin_inset LatexCommand \index{learning} \end_inset curve but is also very powerful, \begin_inset LatexCommand \index{powerful} \end_inset it is both advanced \begin_inset LatexCommand \index{advanced} \end_inset and quite \begin_inset LatexCommand \index{quite} \end_inset large. \emph on emacs \emph default \begin_inset LatexCommand \index{Emacs} \end_inset can do anything, surf \begin_inset LatexCommand \index{surf} \end_inset the internet, \begin_inset LatexCommand \index{internet} \end_inset chat, \begin_inset LatexCommand \index{chat} \end_inset play \begin_inset LatexCommand \index{play} \end_inset games and many other tasks. \begin_inset LatexCommand \index{tasks} \end_inset \layout Description Others There are too many different text editors \begin_inset LatexCommand \index{editors} \end_inset to list here. Have a look on the internet, \begin_inset LatexCommand \index{internet} \end_inset either search \begin_inset LatexCommand \index{search} \end_inset for them using any search engine or you will find many of them at \begin_inset LatexCommand \url[Sourceforge]{http://sourceforge.net/} \end_inset \begin_inset LatexCommand \index{Sourceforge} \end_inset or \begin_inset LatexCommand \url[Freshmeat.]{http://freshmeat.net/} \end_inset \begin_inset LatexCommand \index{Freshmeat} \end_inset \layout Section Text Viewing Tools \begin_inset LatexCommand \label{text-viewing-tools} \end_inset \layout Description head \begin_inset LatexCommand \index{head} \end_inset With no options it shows \begin_inset LatexCommand \index{shows} \end_inset the first ten lines of a text file. \begin_deeper \layout Standard \noindent Use \emph on head -n \begin_inset LatexCommand \index{-n} \end_inset x \emph default (where \begin_inset Quotes eld \end_inset x \begin_inset Quotes erd \end_inset is a number) to display \begin_inset LatexCommand \index{display} \end_inset the first x \emph on \emph default lines. \layout Standard \noindent Try \emph on head -F \begin_inset LatexCommand \index{-F} \end_inset \emph default to use a continually updated \begin_inset LatexCommand \index{updated} \end_inset version \begin_inset LatexCommand \index{version} \end_inset of \emph on head \emph default (if the file changes it will be reloaded \begin_inset LatexCommand \index{reloaded} \end_inset and displayed), please note that using this option \begin_inset LatexCommand \index{option} \end_inset will run \begin_inset LatexCommand \index{run} \end_inset \emph on head \emph default is a continuous \begin_inset LatexCommand \index{continuous} \end_inset loop so you'll need to use CTRL-C to exit. \begin_inset LatexCommand \index{exit} \end_inset \layout Standard \noindent For example: \layout Code head -n 20 somelog.txt \layout Standard Will display the top 20 entries \begin_inset LatexCommand \index{entries} \end_inset of the file \begin_inset Quotes eld \end_inset somelog.txt \begin_inset Quotes erd \end_inset . \end_deeper \layout Description \noindent tail \begin_inset LatexCommand \index{tail} \end_inset With no options it shows \begin_inset LatexCommand \index{shows} \end_inset the last \begin_inset LatexCommand \index{last} \end_inset ten lines of a file. \begin_deeper \layout Standard \noindent Use \emph on tail -n \begin_inset LatexCommand \index{-n} \end_inset x \emph default (where \begin_inset Quotes eld \end_inset x \begin_inset Quotes erd \end_inset is a number) to display the last \emph on x \emph default lines. \layout Standard \noindent Try \emph on tail -F \begin_inset LatexCommand \index{-F} \end_inset \emph default to use a continually updated \begin_inset LatexCommand \index{updated} \end_inset version \begin_inset LatexCommand \index{version} \end_inset of \emph on tail \emph default (if the file changes it will be reloaded \begin_inset LatexCommand \index{reloaded} \end_inset and displayed), please note that using this option will run \emph on tail \emph default is a continuous \begin_inset LatexCommand \index{continuous} \end_inset loop so you'll need to use CTRL-C to exit. \begin_inset LatexCommand \index{exit} \end_inset \layout Standard \noindent For example: \layout Code tail -n 20 somelog.txt \layout Standard Will display \begin_inset LatexCommand \index{display} \end_inset the last 20 entries \begin_inset LatexCommand \index{entries} \end_inset of the file \begin_inset Quotes eld \end_inset somelog.txt \begin_inset Quotes erd \end_inset . \end_deeper \layout Description \noindent less \begin_inset LatexCommand \index{less} \end_inset Views text, can scroll \begin_inset LatexCommand \index{scroll} \end_inset backwards and forwards. \begin_inset LatexCommand \index{forwards} \end_inset Has many different options which are all described \begin_inset LatexCommand \index{described} \end_inset in the manual \begin_inset LatexCommand \index{manual} \end_inset page. \begin_inset LatexCommand \index{page} \end_inset \begin_deeper \layout Standard \noindent When \emph on less \emph default is already running, \begin_inset LatexCommand \index{running} \end_inset use :n \begin_inset LatexCommand \index{:n} \end_inset and :p \begin_inset LatexCommand \index{:p} \end_inset (type a colon \begin_inset LatexCommand \index{colon} \end_inset then the character) to move \begin_inset LatexCommand \index{move} \end_inset to the next \begin_inset LatexCommand \index{next} \end_inset and previous \begin_inset LatexCommand \index{previous} \end_inset files (when there are multiple \begin_inset LatexCommand \index{multiple} \end_inset open \begin_inset LatexCommand \index{open} \end_inset files). \layout Standard \noindent Command syntax: \layout Code less filename.txt \layout Standard Or using a tool (in this example \emph on cat \emph default ): \layout Code cat file.txt | less \end_deeper \layout Description \noindent more Displays text, one page full at a time, \begin_inset LatexCommand \index{time} \end_inset more limited than \emph on less \emph default . In this case \emph on less \emph default is better than \emph on more \emph default . \begin_deeper \layout Code more filename.txt \layout Standard Or using a tool (is this example cat): \layout Code cat file.txt | more \end_deeper \layout Description \noindent cat \begin_inset LatexCommand \label{cat} \end_inset Combines \begin_inset LatexCommand \index{Combines} \end_inset (concatenates) multiple \begin_inset LatexCommand \index{multiple} \end_inset documents \begin_inset LatexCommand \index{documents} \end_inset into one document. \begin_inset LatexCommand \index{document} \end_inset Can be used on individual \begin_inset LatexCommand \index{individual} \end_inset files as well. \begin_deeper \layout Standard \noindent Some useful options: \begin_inset LatexCommand \index{options} \end_inset \layout Itemize \noindent \emph on -b \emph default \begin_inset LatexCommand \index{-b} \end_inset --- number \begin_inset LatexCommand \index{number} \end_inset all non-blank \begin_inset LatexCommand \index{non-blank} \end_inset lines \layout Itemize \noindent \emph on -n \begin_inset LatexCommand \index{-n} \end_inset \emph default --- number all lines. \layout Standard \noindent Also try using \emph on nl \emph default to number lines (it can do more complex \begin_inset LatexCommand \index{complex} \end_inset numbering), you will find it under under this section, \begin_inset LatexCommand \index{section} \end_inset \begin_inset LatexCommand \ref{text-manipulation-tools} \end_inset \layout Standard \noindent Example: \layout Code cat filepart1 filepart2 filepart3 > wholefile.txt \layout Standard This will combine \begin_inset LatexCommand \index{combine} \end_inset (concatenate) filepart1, \begin_inset LatexCommand \index{filepart1} \end_inset filepart2 \begin_inset LatexCommand \index{filepart2} \end_inset and filepart3 \begin_inset LatexCommand \index{filepart3} \end_inset into the single file \begin_inset Quotes eld \end_inset wholefile.txt \begin_inset Quotes erd \end_inset . \end_deeper \layout Description \noindent tac \begin_inset LatexCommand \index{tac} \end_inset Combines (concatenates) multiple \begin_inset LatexCommand \index{multiple} \end_inset documents \begin_inset LatexCommand \index{documents} \end_inset into one document \begin_inset LatexCommand \index{document} \end_inset and outputs \begin_inset LatexCommand \index{outputs} \end_inset them in reverse order. \begin_inset LatexCommand \index{reverse} \end_inset Can also be used on individual \begin_inset LatexCommand \index{individual} \end_inset files. Notice that \emph on tac \emph default is \emph on cat \emph default written backwards. \begin_deeper \layout Standard \noindent Example: \layout Code tac filepart1 filepart2 filepart3 > wholefile.txt \layout Standard This will combine \begin_inset LatexCommand \index{combine} \end_inset (concatenate) filepart1, \begin_inset LatexCommand \index{filepart1} \end_inset filepart2 \begin_inset LatexCommand \index{filepart2} \end_inset and filepart3 \begin_inset LatexCommand \index{filepart3} \end_inset into the single file but have each of the files written in reverse. \begin_inset LatexCommand \index{reverse} \end_inset \end_deeper \layout Description z*\SpecialChar ~ commands \begin_inset LatexCommand \index{z* commands} \end_inset Many commands can be prefixed \begin_inset LatexCommand \index{prefixed} \end_inset with a \begin_inset Quotes eld \end_inset z \begin_inset Quotes erd \end_inset to read/work within a gzip \begin_inset LatexCommand \index{gzip} \end_inset compressed \begin_inset LatexCommand \index{compressed} \end_inset file. \begin_deeper \layout Standard Some examples \begin_inset LatexCommand \index{examples} \end_inset are \emph on zcat, zless, \begin_inset LatexCommand \index{zless} \end_inset zmore, \begin_inset LatexCommand \index{zmore} \end_inset zgrep, \begin_inset LatexCommand \index{zgrep} \end_inset zcmp, \begin_inset LatexCommand \index{zcmp} \end_inset zdiff \begin_inset LatexCommand \index{zdiff} \end_inset \emph default . \layout Standard There are many utilities \begin_inset LatexCommand \index{utilities} \end_inset for working with text within compressed files without trying to manually de-compress them somewhere first\SpecialChar \ldots{} most begin with a \begin_inset Quotes eld \end_inset z \begin_inset Quotes erd \end_inset . You will find some of them mentioned over here, \begin_inset LatexCommand \ref{compression} \end_inset . \end_deeper \layout Description bz*\SpecialChar ~ commands \begin_inset LatexCommand \index{bz* commands} \end_inset There are also a few commands that prefixed \begin_inset LatexCommand \index{prefixed} \end_inset with a \begin_inset Quotes eld \end_inset bz \begin_inset Quotes erd \end_inset to read/work within a file compressed \begin_inset LatexCommand \index{compressed} \end_inset with bzip2. \begin_inset LatexCommand \index{bzip2} \end_inset \begin_deeper \layout Standard The tools are \emph on bzcat, bzless, \begin_inset LatexCommand \index{bzless} \end_inset bzgrep \begin_inset LatexCommand \index{bzgrep} \end_inset . \emph default You will find some of them mentioned over here, \begin_inset LatexCommand \ref{compression} \end_inset . \end_deeper \layout Section Text Information Tools \begin_inset LatexCommand \label{text-information-tools} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard aim is to provide some kind of information on text, not view or format them as such\SpecialChar \ldots{} \end_inset \layout Description wc \begin_inset LatexCommand \index{wc} \end_inset Word count, count how many words you have in a text \begin_inset LatexCommand \index{text} \end_inset document. Can also be used to count \begin_inset LatexCommand \index{count} \end_inset the lines or bytes \begin_inset LatexCommand \index{bytes} \end_inset within the file. \begin_deeper \layout Standard \noindent Use the options \emph on -w \begin_inset LatexCommand \index{-w} \end_inset \emph default for words, \emph on -l \begin_inset LatexCommand \index{-l} \end_inset \emph default for lines \begin_inset LatexCommand \index{lines} \end_inset and \emph on -c \begin_inset LatexCommand \index{-c} \end_inset \emph default for bytes. \begin_inset LatexCommand \index{bytes} \end_inset Or simply run \emph on wc \emph default with no options to get all three. \layout Standard \noindent Command syntax: \layout Code wc -option file.txt \end_deeper \layout Description style \begin_inset LatexCommand \index{style} \end_inset To run various readability \begin_inset LatexCommand \index{readability} \end_inset tests on a particular \begin_inset LatexCommand \index{particular} \end_inset text file. Will output \begin_inset LatexCommand \index{output} \end_inset scores \begin_inset LatexCommand \index{scores} \end_inset on a number of different \begin_inset LatexCommand \index{different} \end_inset readability \begin_inset LatexCommand \index{readability} \end_inset tests (with no options). \begin_deeper \layout Standard Command syntax: \layout Code style -options text_file \layout SGML \layout SGML Find style in the diction package \layout SGML This command is part of the diction package and does not appear to be used too often these days \layout SGML \end_deeper \layout Description cmp \begin_inset LatexCommand \index{cmp} \end_inset Determines whether or not two files differ, works on any type of file. Very similar to \emph on diff \emph default only it compares \begin_inset LatexCommand \index{compares} \end_inset on the binary \begin_inset LatexCommand \index{binary} \end_inset level instead of just the text. \layout Description \noindent diff \begin_inset LatexCommand \index{diff} \end_inset Compares two text files and output a difference \begin_inset LatexCommand \index{difference} \end_inset report (sometimes called a "diff" \begin_inset LatexCommand \index{diff} \end_inset ) containing the text that differs between two files. \begin_deeper \layout Standard \noindent Can be used to create a 'patch' file (which can be used by \emph on patch \emph default ). \layout Standard \noindent Example: \layout Code diff file1.txt file2.txt \layout Standard \emph on diff \emph default will output \begin_inset LatexCommand \index{output} \end_inset a '>' (followed by the line) for each line \begin_inset LatexCommand \index{line} \end_inset that isn't in the first file but is in the second file, and it will output a '<' (followed by the line) for each line that is in the first file but not in the second file. \end_deeper \layout Description \noindent sdiff \begin_inset LatexCommand \index{sdiff} \end_inset Instead of giving a difference \begin_inset LatexCommand \index{difference} \end_inset report, it outputs \begin_inset LatexCommand \index{outputs} \end_inset the files in two columns, \begin_inset LatexCommand \index{columns} \end_inset side by side, separated \begin_inset LatexCommand \index{separated} \end_inset by spaces. \begin_inset LatexCommand \index{spaces} \end_inset \begin_inset Note collapsed false \layout Standard need more info on this \end_inset \layout Description diff3 \begin_inset LatexCommand \index{diff3} \end_inset Same as \emph on diff \emph default except for three files. \layout Description \begin_inset Note collapsed false \layout Standard \SpecialChar \ldots{} also need more info \end_inset \layout Description comm \begin_inset LatexCommand \index{comm} \end_inset Compares two files, line-by-line \begin_inset LatexCommand \index{line-by-line} \end_inset and prints \begin_inset LatexCommand \index{prints} \end_inset lines that are unique \begin_inset LatexCommand \index{unique} \end_inset to file1 \begin_inset LatexCommand \index{file1} \end_inset (1st column), unique to file2 \begin_inset LatexCommand \index{file2} \end_inset (2nd column) and common \begin_inset LatexCommand \index{common} \end_inset to both files (3rd column). \begin_deeper \layout Standard Use \emph on comm \emph default with the -1, -2, or -3 to suppress \begin_inset LatexCommand \index{suppress} \end_inset the printing \begin_inset LatexCommand \index{printing} \end_inset of those particular lines. Simply run \begin_inset LatexCommand \index{run} \end_inset \emph on comm \emph default to have all three listed \begin_inset LatexCommand \index{listed} \end_inset (ie. unique \begin_inset LatexCommand \index{unique} \end_inset to files 1 and 2 and common \begin_inset LatexCommand \index{common} \end_inset to both). \layout Standard Command syntax: \layout Code comm file1 file2 \end_deeper \layout Description look \begin_inset LatexCommand \index{look} \end_inset To output a list of words in the system dictionary that begin with a given string \begin_inset LatexCommand \index{string} \end_inset -- this is useful for finding \begin_inset LatexCommand \index{finding} \end_inset words that begin with a particular phrase \begin_inset LatexCommand \index{phrase} \end_inset or prefix. \begin_inset LatexCommand \index{prefix} \end_inset \begin_deeper \layout Standard Give the string as an argument; \begin_inset LatexCommand \index{argument} \end_inset it is not case sensitive. \begin_inset LatexCommand \index{sensitive} \end_inset \layout Standard Command syntax: \layout Code look string \end_deeper \layout Section Text manipulation tools \begin_inset LatexCommand \label{text-manipulation-tools} \end_inset \layout SGML \layout SGML Also see \layout SGML Also see \emph on tac \emph default , and \emph on cat \emph default over in this section, \begin_inset LatexCommand \ref{text-viewing-tools} \end_inset , as they can perform text manipulation too \layout SGML \layout Description \noindent sort \begin_inset LatexCommand \index{sort} \end_inset Sorting \begin_inset LatexCommand \index{Sorting} \end_inset text with no options \begin_inset LatexCommand \index{options} \end_inset the sort is alphabetical. \begin_inset LatexCommand \index{alphabetical} \end_inset Can be run on text files to sort \begin_inset LatexCommand \index{sort} \end_inset them alphabetically \begin_inset LatexCommand \index{alphabetically} \end_inset (note it also concatenates \begin_inset LatexCommand \index{concatenates} \end_inset files), can also be used with a pipe \begin_inset LatexCommand \index{pipe} \end_inset '|' to sort \begin_inset LatexCommand \index{sort} \end_inset the output of a command. \begin_deeper \layout Standard \noindent Use \emph on sort -r \begin_inset LatexCommand \index{-r} \end_inset \emph default to reverse \begin_inset LatexCommand \index{reverse} \end_inset the sort \begin_inset LatexCommand \index{sort} \end_inset output, use the \emph on -g \begin_inset LatexCommand \index{-g} \end_inset \emph default option \begin_inset LatexCommand \index{option} \end_inset to sort \begin_inset LatexCommand \index{sort} \end_inset 'numerically' (ie read the entire number, \begin_inset LatexCommand \index{number} \end_inset not just the first digit). \begin_inset Note collapsed false \layout Standard tsort doesn't make sense, it's some kind of logical sorting\SpecialChar \ldots{} topological sorting.......IBM developerworks describes it but it doesn't make sense. \end_inset \layout Standard \noindent Examples: \layout Code cat shoppinglist.txt | sort \layout Standard The above command would run \emph on cat \emph default on the shopping \begin_inset LatexCommand \index{shopping} \end_inset list \begin_inset LatexCommand \index{list} \end_inset then sort the results \begin_inset LatexCommand \index{results} \end_inset and display them in alphabetical order. \begin_inset LatexCommand \index{order} \end_inset \layout Code sort -r shoppinglist.txt \layout Standard The above command would run \emph on sort \emph default on a file and \emph on sort \emph default the file in reverse \begin_inset LatexCommand \index{reverse} \end_inset alphabetical \begin_inset LatexCommand \index{alphabetical} \end_inset order. \layout Standard \added_space_top medskip \noindent \series bold Advanced sort commands: \layout Standard \noindent \emph on sort \emph default is a powerful \begin_inset LatexCommand \index{powerful} \end_inset utility, \begin_inset LatexCommand \index{utility} \end_inset here are some of the more \begin_inset LatexCommand \index{more} \end_inset hard to learn \begin_inset LatexCommand \index{learn} \end_inset (and lesser \begin_inset LatexCommand \index{lesser} \end_inset used) commands. Use the \emph on -t \begin_inset LatexCommand \index{-t} \end_inset \emph default option to use a particular symbol \begin_inset LatexCommand \index{symbol} \end_inset as the separator \begin_inset LatexCommand \index{separator} \end_inset then use the \emph on -k \emph default option to specify \begin_inset LatexCommand \index{specify} \end_inset which column \begin_inset LatexCommand \index{column} \end_inset you would like to sort by, where column 1 is the first column \begin_inset LatexCommand \index{column} \end_inset \emph on before \emph default the separator. \begin_inset LatexCommand \index{separator} \end_inset Also use the \emph on -g \begin_inset LatexCommand \index{-g} \end_inset \emph default option if numeric \begin_inset LatexCommand \index{numeric} \end_inset sorting is not working correctly (without the -g \begin_inset LatexCommand \index{-g} \end_inset option sort just looks \begin_inset LatexCommand \index{looks} \end_inset at the first digit \begin_inset LatexCommand \index{digit} \end_inset of the number). Here is a complex \begin_inset LatexCommand \index{complex} \end_inset example: \layout Code sort -t : -k 4 -k 1 -g /etc/passwd | more \begin_inset LatexCommand \index{-k} \end_inset \layout Standard This will sort the \begin_inset Quotes eld \end_inset /etc/passwd \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{/etc/passwd} \end_inset file, using the colon \begin_inset LatexCommand \index{colon} \end_inset ':' as the separator. \begin_inset LatexCommand \index{separator} \end_inset It will sort via the 4th column \begin_inset LatexCommand \index{column} \end_inset (GID section, in the file) and then sort within that sort using the first (name) to resolve any ties. \begin_inset LatexCommand \index{ties} \end_inset The \emph on -g \emph default is there so it sorts via full \begin_inset LatexCommand \index{full} \end_inset numbers, otherwise it will have 4000 before 50 (it will just look at the first digit\SpecialChar \ldots{} ). \layout Standard \begin_inset Note collapsed false \layout Standard from info page but changed\SpecialChar \ldots{} AUTHOR Written by Mike Haertel and Paul Eggert. \layout Standard not referenced. it's just too small (1-2 lines!), document doesn't need to be littered with references. \end_inset \end_deeper \layout Description join \begin_inset LatexCommand \index{join} \end_inset Will put two lines together assuming they share at least \begin_inset LatexCommand \index{least} \end_inset one common \begin_inset LatexCommand \index{common} \end_inset value \begin_inset LatexCommand \index{value} \end_inset on the relevant \begin_inset LatexCommand \index{relevant} \end_inset line. It won't print \begin_inset LatexCommand \index{print} \end_inset lines if they don't have a common value. \begin_deeper \layout Standard Command syntax: \layout Code join file1 file2 \end_deeper \layout Description cut \begin_inset LatexCommand \index{cut} \end_inset Prints \begin_inset LatexCommand \index{Prints} \end_inset selected \begin_inset LatexCommand \index{selected} \end_inset parts of lines (of a text file), or, in other words, removes \begin_inset LatexCommand \index{removes} \end_inset certain sections \begin_inset LatexCommand \index{sections} \end_inset of a line. You may wish to remove \begin_inset LatexCommand \index{remove} \end_inset things according to tabs \begin_inset LatexCommand \index{tabs} \end_inset or commas, \begin_inset LatexCommand \index{commas} \end_inset or anything else you can think of\SpecialChar \ldots{} \begin_deeper \layout Standard Options for \emph on cut: \layout Itemize -d \begin_inset LatexCommand \index{-d} \end_inset --- allows \begin_inset LatexCommand \index{allows} \end_inset you to specify another delimiter, \begin_inset LatexCommand \index{delimiter} \end_inset for example ':' is often used with /etc/passwd: \begin_deeper \layout Code cut -d ':' (and probably some more options here) /etc/passwd \end_deeper \layout Itemize \emph on -f \begin_inset LatexCommand \index{-f} \end_inset \emph default --- this option works with the text by columns, \begin_inset LatexCommand \index{columns} \end_inset separated \begin_inset LatexCommand \index{separated} \end_inset according to the delimiter. \begin_inset LatexCommand \index{delimiter} \end_inset For example if your file had lines \begin_inset LatexCommand \index{lines} \end_inset like \begin_inset Quotes eld \end_inset result,somethingelse,somethingelse \begin_inset Quotes erd \end_inset and you only wanted result \begin_inset LatexCommand \index{result} \end_inset you would use: \begin_deeper \layout Code cut -d ',' -f 1 /etc/passwd \layout Standard This would get you only the usernames \begin_inset LatexCommand \index{usernames} \end_inset in /etc/passwd \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset , \begin_inset Quotes erd \end_inset (commas) --- used to separate \begin_inset LatexCommand \index{separate} \end_inset numbers, these allow \begin_inset LatexCommand \index{allow} \end_inset you to cut \begin_inset LatexCommand \index{cut} \end_inset particular \begin_inset LatexCommand \index{particular} \end_inset columns. \begin_inset LatexCommand \index{columns} \end_inset For example: \begin_deeper \layout Code cut -d ':' -f 1,7 /etc/passwd \layout Standard This would only show \begin_inset LatexCommand \index{show} \end_inset the username \begin_inset LatexCommand \index{username} \end_inset and the shell \begin_inset LatexCommand \index{shell} \end_inset that each person \begin_inset LatexCommand \index{person} \end_inset is setup \begin_inset LatexCommand \index{setup} \end_inset for in /etc/passwd. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset - \begin_inset Quotes erd \end_inset (hyphen) --- used to show \begin_inset LatexCommand \index{show} \end_inset from line x to line y, for example 1-4, (would be from lines 1 to line \begin_inset LatexCommand \index{line} \end_inset 4). \begin_deeper \layout Code cut -c 1-50 file1.txt \layout Standard This would cut (display) characters \begin_inset LatexCommand \index{characters} \end_inset (columns) 1 to 50 of each line (and anything else on that line \begin_inset LatexCommand \index{line} \end_inset is ignored) \end_deeper \layout Itemize -x \begin_inset LatexCommand \index{-x} \end_inset --- where x is a number, to cut \begin_inset LatexCommand \index{cut} \end_inset from line 1 to \begin_inset Quotes eld \end_inset x \begin_inset Quotes erd \end_inset \layout Itemize x- --- where x is a number, to cut \begin_inset LatexCommand \index{cut} \end_inset from \begin_inset Quotes eld \end_inset x \begin_inset Quotes erd \end_inset to the end. \begin_inset LatexCommand \index{end} \end_inset \begin_deeper \layout Code cut -5, 20-, 8 file2.txt \layout Standard This would display ( \begin_inset Quotes eld \end_inset cut \begin_inset Quotes erd \end_inset ) characters \begin_inset LatexCommand \index{characters} \end_inset (columns) 1 to 5, 8 and from 20 to the end. \end_deeper \end_deeper \layout Description \noindent ispell/aspell \begin_inset LatexCommand \index{aspell} \end_inset \begin_inset LatexCommand \index{ispell} \end_inset To spell \begin_inset LatexCommand \index{spell} \end_inset check a file interactively, prompts \begin_inset LatexCommand \index{prompts} \end_inset for you to replace \begin_inset LatexCommand \index{replace} \end_inset word or continue. \emph on aspell \emph default is said to be better at suggesting \begin_inset LatexCommand \index{suggesting} \end_inset replacement words, but its probably \begin_inset LatexCommand \index{probably} \end_inset best to find \begin_inset LatexCommand \index{find} \end_inset out for yourself. \begin_inset Note collapsed false \layout Standard anyone agree or disagree with this? \end_inset \begin_deeper \layout Standard \emph on aspell \emph default example: \layout Code aspell -c FILE.txt \layout Standard This will run \emph on aspell \emph default on a particular file called \begin_inset Quotes eld \end_inset FILE.txt \begin_inset Quotes erd \end_inset , \emph on aspell \emph default will run interactively and prompt \begin_inset LatexCommand \index{prompt} \end_inset for user input. \layout Standard \emph on ispell \emph default example: \layout Code ispell FILE.txt \layout Standard This will run \emph on ispell \emph default on a particular file called \begin_inset Quotes eld \end_inset FILE.txt \begin_inset Quotes erd \end_inset \emph on ispell \emph default will run interactively and prompt \begin_inset LatexCommand \index{prompt} \end_inset for user input. \end_deeper \layout Description \noindent chcase \begin_inset LatexCommand \index{chcase} \end_inset Is used to change the uppercase \begin_inset LatexCommand \index{uppercase} \end_inset letters in a file name to lowercase \begin_inset LatexCommand \index{lowercase} \end_inset (or vice versa). \begin_deeper \layout Standard \noindent You could also use \emph on tr \begin_inset LatexCommand \index{tr} \end_inset \emph default to do the same thing\SpecialChar \ldots{} \layout Code \noindent cat fileName.txt | tr '[A-Z]' '[a-z]' > newFileName.txt \layout Standard The above would convert \begin_inset LatexCommand \index{convert} \end_inset uppercase to lowercase using the the file \begin_inset Quotes eld \end_inset fileName.txt \begin_inset Quotes erd \end_inset as input \begin_inset LatexCommand \index{input} \end_inset and outputting the results \begin_inset LatexCommand \index{results} \end_inset to \begin_inset Quotes eld \end_inset newFileName.txt \begin_inset Quotes erd \end_inset . \layout Code \noindent cat fileName.txt | tr '[a-z]' '[A-Z]' > newFileName.txt \layout Standard \noindent The above would convert lowercase to uppercase using the the file \begin_inset Quotes eld \end_inset fileName.txt \begin_inset Quotes erd \end_inset as input \begin_inset LatexCommand \index{input} \end_inset and outputting the results \begin_inset LatexCommand \index{results} \end_inset to \begin_inset Quotes eld \end_inset newFileName.txt \begin_inset Quotes erd \end_inset . \layout Standard \noindent \emph on chcase \emph default (a perl \begin_inset LatexCommand \index{perl} \end_inset script) can be found \begin_inset LatexCommand \index{found} \end_inset at the \begin_inset LatexCommand \url[chcase homepage.]{http://www.blemished.net/chcase.html} \end_inset \begin_inset LatexCommand \index{chcase homepage} \end_inset \layout Standard \noindent \begin_inset Note collapsed false \layout Standard don't have any info on how to use this tool\SpecialChar \ldots{} can also use other tools to do the same thing. \end_inset \end_deeper \layout Description \noindent fmt \begin_inset LatexCommand \index{fmt} \end_inset (format) a simple text formatter. Use \emph on fmt \begin_inset LatexCommand \index{fmt} \end_inset \emph default with the \emph on -u \begin_inset LatexCommand \index{-u} \end_inset \emph default option to output text with "uniform spacing", where the space \begin_inset LatexCommand \index{space} \end_inset between words is reduced to one space character \begin_inset LatexCommand \index{character} \end_inset and the space between sentences \begin_inset LatexCommand \index{sentences} \end_inset is reduced to two space characters. \begin_deeper \layout Standard \noindent Example: \layout Code fmt -u myessay.txt \layout Standard Will make sure the amount \begin_inset LatexCommand \index{amount} \end_inset of space between sentences \begin_inset LatexCommand \index{sentences} \end_inset is two spaces and the amount \begin_inset LatexCommand \index{amount} \end_inset of space between words is one space. \end_deeper \layout Description paste \begin_inset LatexCommand \index{paste} \end_inset Puts lines from two files together, either lines of each file side by side (normally separated \begin_inset LatexCommand \index{separated} \end_inset by a tab-stop \begin_inset LatexCommand \index{tab-stop} \end_inset but you can have any symbols(s) you like\SpecialChar \ldots{} ) or it can have words from each file (the first file then the second file) side by side. \begin_deeper \layout Standard To obtain a list \begin_inset LatexCommand \index{list} \end_inset of lines side by side, the first lines from the first file on the left side separated \begin_inset LatexCommand \index{separated} \end_inset by a tab-stop \begin_inset LatexCommand \index{tab-stop} \end_inset then the first lines from the second file. You would type: \layout Code paste file1.txt file2.txt \layout Standard To have the list displayed in serial, \begin_inset LatexCommand \index{serial} \end_inset first line from first file, [Tab], second line from first file, then third and fourth until the end of the first file type: \layout Code paste --serial file1.txt file2.txt \layout SGML \layout SGML This command is very simple to understand if you make yourself an example \layout SGML Its much easier if you create an example for yourself. With just a couple of lines, I used "first line first file" and "first line second file" et cetera for a quick example. \layout SGML \end_deeper \layout Description \noindent expand \begin_inset LatexCommand \index{expand} \end_inset Will convert tabs to spaces \begin_inset LatexCommand \index{spaces} \end_inset and output it. Use the option \emph on -t \begin_inset LatexCommand \index{-t} \end_inset num \emph default to specify \begin_inset LatexCommand \index{specify} \end_inset the size \begin_inset LatexCommand \index{size} \end_inset of a \begin_inset Quotes eld \end_inset tapstop \begin_inset Quotes erd \end_inset , the number of characters \begin_inset LatexCommand \index{characters} \end_inset between each tab. \begin_inset LatexCommand \index{tab} \end_inset \begin_deeper \layout Standard \noindent Command syntax: \layout Code expand file_name.txt \end_deeper \layout Standard \begin_inset Note collapsed false \layout Standard expand/unexpand kept for completeness but are candidates for removal, I can see they would likely be useful for programmers though\SpecialChar \ldots{} \end_inset \layout Description \noindent unexpand \begin_inset LatexCommand \index{unexpand} \end_inset Will convert spaces to tabs \begin_inset LatexCommand \index{tabs} \end_inset and output it. \begin_deeper \layout Standard \noindent Command syntax: \layout Code unexpand file_name.txt \end_deeper \layout Description \noindent uniq \begin_inset LatexCommand \index{uniq} \end_inset Eliminates duplicate \begin_inset LatexCommand \index{duplicate} \end_inset entries from a file and it sometimes greatly \begin_inset LatexCommand \index{greatly} \end_inset simplifies the display. \begin_deeper \layout Standard \noindent \emph on uniq \emph default options: \layout Itemize \noindent \emph on -c \begin_inset LatexCommand \index{-c} \end_inset \emph default --- count \begin_inset LatexCommand \index{count} \end_inset the number of occurances \begin_inset LatexCommand \index{occurances} \end_inset of each duplicate \emph on \layout Itemize \noindent \emph on -u \begin_inset LatexCommand \index{-u} \end_inset \emph default --- list only unique \begin_inset LatexCommand \index{unique} \end_inset entries \layout Itemize \noindent \emph on -d \begin_inset LatexCommand \index{-d} \end_inset \emph default --- list only duplicate entries \layout Standard \noindent For example: \layout Code uniq -cd phone_list.txt \layout Standard This would display \begin_inset LatexCommand \index{display} \end_inset any duplicate entries only and a count \begin_inset LatexCommand \index{count} \end_inset of the number of times \begin_inset LatexCommand \index{times} \end_inset that entry \begin_inset LatexCommand \index{entry} \end_inset has appeared. \end_deeper \layout Description \noindent tr \begin_inset LatexCommand \index{tr} \end_inset (translation). A filter \begin_inset LatexCommand \index{filter} \end_inset useful to replace all instances \begin_inset LatexCommand \index{instances} \end_inset of characters \begin_inset LatexCommand \index{characters} \end_inset in a text file or "squeeze" \begin_inset LatexCommand \index{squeeze} \end_inset the whitespace \begin_inset LatexCommand \index{whitespace} \end_inset . \begin_deeper \layout Standard \noindent Example: \layout Code \noindent cat some_file | tr '3' '5' > new_file \layout Standard \noindent This will run the \emph on cat \emph default program \begin_inset LatexCommand \index{program} \end_inset on some file, the output of this command will be sent to the \emph on tr \emph default command, \emph on tr \emph default will replace all the instances \begin_inset LatexCommand \index{instances} \end_inset of 3 with 5, like a search \begin_inset LatexCommand \index{search} \end_inset and replace. You can also do other things such as: \layout Code cat some_file | tr '[A-Z]' '[a-z]' > new_file \layout Standard This will run \emph on cat \emph default on some_file \begin_inset LatexCommand \index{some_file} \end_inset and convert any capital \begin_inset LatexCommand \index{capital} \end_inset letters to lowercase letters (you could use this to change the case of file names too\SpecialChar \ldots{} ). \layout SGML \layout SGML Alternatives \layout SGML \layout SGML You can also do a search and replace with a one line Perl command, read about it at the end of this section. \layout SGML \layout SGML \end_deeper \layout Description nl \begin_inset LatexCommand \index{nl} \end_inset The number lines \begin_inset LatexCommand \index{number lines} \end_inset tool, it's default \begin_inset LatexCommand \index{default} \end_inset action is to write \begin_inset LatexCommand \index{write} \end_inset it's input (either the file names given as an argument, \begin_inset LatexCommand \index{argument} \end_inset or the standard \begin_inset LatexCommand \index{standard} \end_inset input) to the standard output. \begin_deeper \layout Standard Line \begin_inset LatexCommand \index{Line} \end_inset numbers are added to every line and the text is indented. \begin_inset LatexCommand \index{indented} \end_inset \layout Standard This command can do take some more \begin_inset LatexCommand \index{more} \end_inset advanced \begin_inset LatexCommand \index{advanced} \end_inset numbering \begin_inset LatexCommand \index{numbering} \end_inset options, simply read the info \begin_inset LatexCommand \index{info} \end_inset page \begin_inset LatexCommand \index{page} \end_inset on it. \layout Standard These advanced \begin_inset LatexCommand \index{advanced} \end_inset options mainly relate to customisation \begin_inset LatexCommand \index{customisation} \end_inset of the numbering, \begin_inset LatexCommand \index{numbering} \end_inset including \begin_inset LatexCommand \index{including} \end_inset different forms \begin_inset LatexCommand \index{forms} \end_inset of separation \begin_inset LatexCommand \index{separation} \end_inset for sections/pages/footers etc. \layout Standard Also try \emph on cat -n \begin_inset LatexCommand \index{cat} \end_inset \begin_inset LatexCommand \index{-n} \end_inset \emph default (number all lines) or \emph on cat -b \begin_inset LatexCommand \index{-b} \end_inset \emph default (number all non-blank \begin_inset LatexCommand \index{non-blank} \end_inset lines). For more \begin_inset LatexCommand \index{more} \end_inset info \begin_inset LatexCommand \index{info} \end_inset on \emph on cat \emph default check \begin_inset LatexCommand \index{check} \end_inset under this section: \begin_inset LatexCommand \index{section} \end_inset \begin_inset LatexCommand \ref{text-viewing-tools} \end_inset \layout Standard There are two ways you can use \emph on nl \emph default : \layout Code nl some_text_file.txt \layout Standard The above command would add \begin_inset LatexCommand \index{add} \end_inset numbers to each line of some_text_file. \begin_inset LatexCommand \index{some_text_file} \end_inset You could use \emph on nl \emph default to number the output of something as shown \begin_inset LatexCommand \index{shown} \end_inset in the example below; \layout Code grep some_string some_file | nl \end_deeper \layout Description \noindent Perl\SpecialChar ~ search\SpecialChar ~ and\SpecialChar ~ replace\SpecialChar ~ text \begin_inset LatexCommand \index{search and replace text} \end_inset To search and replace text in a file is to use the following \begin_inset LatexCommand \index{following} \end_inset one-line \begin_inset LatexCommand \index{one-line} \end_inset Perl \begin_inset LatexCommand \index{perl} \end_inset command \begin_inset Foot collapsed true \layout Standard This information has been taken from the Linux Cookbook (without editing). See [3] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset : \begin_deeper \layout Code \noindent $ perl -pi -e "s/oldstring/newstring/g;" filespec [RET] \layout Standard \noindent \family roman In this example, \family default \begin_inset Quotes eld \end_inset oldstring \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{oldstring} \end_inset \emph on \family roman \emph default is the string \begin_inset LatexCommand \index{string} \end_inset to search, \family default \begin_inset Quotes eld \end_inset newstring \emph on \begin_inset Quotes erd \end_inset \family roman \begin_inset LatexCommand \index{newstring} \end_inset \emph default is the string to replace it with, and \family default \begin_inset Quotes eld \end_inset filespe \emph on c \emph default \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{filespec} \end_inset \family roman is the name of the file or files to work on. You can use this for more than one file. \layout Standard Example: \family roman To replace \begin_inset LatexCommand \index{replace} \end_inset the string \family default \begin_inset Quotes eld \end_inset \family roman helpless \family default \begin_inset Quotes erd \end_inset \family roman with the string \family default \begin_inset Quotes eld \end_inset \family roman helpful \family default \begin_inset Quotes erd \end_inset \family roman in all files in the current \begin_inset LatexCommand \index{current} \end_inset directory, \begin_inset LatexCommand \index{directory} \end_inset type: \layout Code $ perl -pi -e "s/helpless/helpful/g;" * [RET] \layout Standard \family roman Also try using \emph on tr \family default \begin_inset LatexCommand \index{tr} \end_inset \family roman \emph default to do the same thing (see further above in this section). \end_deeper \layout SGML \layout SGML If these tools are too primitive \layout SGML If these text tools are too simple for your purposes then you are probably looking at doing some programming or scripting. \layout SGML If you would like more information on bash scripting then please see the \begin_inset LatexCommand \url[advanced bash scripting guide]{http://www.tldp.org/LDP/abs/html/} \end_inset \begin_inset LatexCommand \index{advanced bash scripting guide} \end_inset , authored by Mendel Cooper \begin_inset LatexCommand \index{Mendel Cooper} \end_inset . \layout SGML sed and awk are traditional UNIX system tools for working with text, this guide does not provide an explanation of them. sed works on a line-by-line basis performing substitution and awk can perform a similar task or assist by working on a file and printing out certain information (its a programming language). \layout SGML You will normally find them installed on your GNU/Linux system and will find many tutorials all over the internet, feel free to look them up if you ever have to perform many similar operations on a text file. \layout SGML \layout Section Text Conversion/Filter Tools \begin_inset LatexCommand \label{text-filter-tools} \end_inset \layout Description Filters\SpecialChar ~ \series bold (UNIX \series default \SpecialChar ~ \series bold System/dos \series default \SpecialChar ~ \series bold formats) \series default \begin_inset LatexCommand \label{text-filters-unix-dos} \end_inset The following \begin_inset LatexCommand \index{following} \end_inset filters \begin_inset LatexCommand \index{filters} \end_inset allow you to change \begin_inset LatexCommand \index{change} \end_inset text from Dos-style \begin_inset LatexCommand \index{Dos-style} \end_inset to UNIX \begin_inset LatexCommand \index{UNIX} \end_inset system style \begin_inset LatexCommand \index{style} \end_inset and vice-versa, \begin_inset LatexCommand \index{vice-versa} \end_inset or convert a file to other formats. \begin_inset LatexCommand \index{formats} \end_inset Also note that many modern text editors can do this for you\SpecialChar \ldots{} \begin_deeper \layout Description Why\SpecialChar ~ use\SpecialChar ~ filters? Because UNIX \begin_inset LatexCommand \index{UNIX} \end_inset systems and Microsoft \begin_inset LatexCommand \index{Microsoft} \end_inset use two different standards \begin_inset LatexCommand \index{standards} \end_inset to represent \begin_inset LatexCommand \index{represent} \end_inset the end-of-line \begin_inset LatexCommand \index{end-of-line} \end_inset in an ASCII \begin_inset LatexCommand \index{ASCII} \end_inset text file. \begin_deeper \layout Standard This can sometimes causes \begin_inset LatexCommand \index{causes} \end_inset problems \begin_inset LatexCommand \index{problems} \end_inset in editors \begin_inset LatexCommand \index{editors} \end_inset or viewers \begin_inset LatexCommand \index{viewers} \end_inset which aren't familiar \begin_inset LatexCommand \index{familiar} \end_inset with the other operating \begin_inset LatexCommand \index{operating} \end_inset systems end-of-line style. The following \begin_inset LatexCommand \index{following} \end_inset tools allow you to get around this difference. \begin_inset LatexCommand \index{difference} \end_inset \end_deeper \layout Description Whats\SpecialChar ~ the\SpecialChar ~ difference? The difference \begin_inset LatexCommand \index{difference} \end_inset is very simple, on a Windows \begin_inset LatexCommand \index{Windows} \end_inset text file, a newline \begin_inset LatexCommand \index{newline} \end_inset is signalled \begin_inset LatexCommand \index{signalled} \end_inset by a carriage \begin_inset LatexCommand \index{carriage} \end_inset return \begin_inset LatexCommand \index{return} \end_inset followed by a newline, ' \backslash r \backslash n' in ASCII. \begin_inset LatexCommand \index{ASCII} \end_inset \begin_deeper \layout Standard On a UNIX system a newline \begin_inset LatexCommand \index{newline} \end_inset is simply a newline, ' \backslash n' in ASCII. \begin_inset LatexCommand \index{ASCII} \end_inset \end_deeper \end_deeper \layout Description dos2unix \begin_inset LatexCommand \index{dos2unix} \end_inset This converts \begin_inset LatexCommand \index{converts} \end_inset Microsoft-style end-of-line \begin_inset LatexCommand \index{end-of-line} \end_inset characters to UNIX system style end-of-line characters. \begin_deeper \layout Standard Simply type: \layout Code dos2unix file.txt \end_deeper \layout Description fromdos \begin_inset LatexCommand \index{fromdos} \end_inset This does the same as \emph on dos2unix \begin_inset LatexCommand \index{dos2unix} \end_inset \emph default (above). \begin_deeper \layout Standard Simply type: \layout Code fromdos file.txt \layout Standard \emph on fromdos \emph default can be obtained from \begin_inset LatexCommand \url[the from/to dos website.]{http://www.thefreecountry.com/tofrodos/} \end_inset \begin_inset LatexCommand \index{from/to dos website} \end_inset \end_deeper \layout Description unix2dos \begin_inset LatexCommand \index{unix2dos} \end_inset This converts UNIX system style end-of-line characters to Microsoft-style end-of-line \begin_inset LatexCommand \index{end-of-line} \end_inset characters. \begin_deeper \layout Standard Simply type: \layout Code unix2dos file.txt \end_deeper \layout Description todos \begin_inset LatexCommand \index{todos} \end_inset This does the same as \emph on unix2dos \emph default (above). \begin_deeper \layout Standard Simply type: \layout Code todos file.txt \layout Standard \emph on todos \emph default can be obtained from \begin_inset LatexCommand \url[the from/to dos website.]{http://www.thefreecountry.com/tofrodos/} \end_inset \begin_inset LatexCommand \index{from/to dos website} \end_inset \end_deeper \layout Description antiword \begin_inset LatexCommand \index{antiword} \end_inset This filter \begin_inset LatexCommand \index{filter} \end_inset converts \begin_inset LatexCommand \index{converts} \end_inset Microsoft word documents into plain \begin_inset LatexCommand \index{plain} \end_inset ASCII text \begin_inset LatexCommand \index{text} \end_inset documents. \begin_inset LatexCommand \index{documents} \end_inset \begin_deeper \layout Standard Simply type: \layout Code antiword file.doc \layout Standard You can get \emph on antiword \emph default from \begin_inset LatexCommand \url[the antiword homepage.]{http://www.winfield.demon.nl/} \end_inset \begin_inset LatexCommand \index{antiword homepage} \end_inset \end_deeper \layout Description recode \begin_inset LatexCommand \index{recode} \end_inset Converts text files between various formats \begin_inset LatexCommand \index{formats} \end_inset including HTML \begin_inset LatexCommand \index{HTML} \end_inset and dozens of different \begin_inset LatexCommand \index{different} \end_inset forms of text encodings. \begin_inset LatexCommand \index{encodings} \end_inset \begin_deeper \layout Standard Use \emph on recode -l \begin_inset LatexCommand \index{-l} \end_inset \emph default for a full \begin_inset LatexCommand \index{full} \end_inset listing. \begin_inset LatexCommand \index{listing} \end_inset It can also be used to convert text to and from Windows \begin_inset LatexCommand \index{Windows} \end_inset and UNIX \begin_inset LatexCommand \index{UNIX} \end_inset system formats \begin_inset LatexCommand \index{formats} \end_inset (so you don't get the weird symbols). \layout SGML \noindent \layout SGML \noindent Warning \layout SGML \noindent \layout SGML \noindent By default recode overwrites the input file, use '<' to use recode as a filter only (and to not overwrite the file). \layout SGML \noindent \layout SGML \noindent \layout Description \noindent \series medium Examples: \layout Standard UNIX system text to Windows text: \layout Code \noindent recode ..pc file_name \layout Standard Windows text to UNIX system text: \layout Code recode ..pc/ file_name \layout Standard UNIX system text to Windows text without overwriting \begin_inset LatexCommand \index{overwriting} \end_inset the original \begin_inset LatexCommand \index{original} \end_inset file (and creating a new \begin_inset LatexCommand \index{new} \end_inset output file): \layout Code \noindent recode ..pc < file_name > recoded_file \end_deeper \layout Description tr \begin_inset LatexCommand \index{tr} \end_inset (Windows to UNIX \begin_inset LatexCommand \index{UNIX} \end_inset system style conversion \begin_inset LatexCommand \index{conversion} \end_inset only). While \emph on tr \emph default is not specifically \begin_inset LatexCommand \index{specifically} \end_inset designed to convert files from Windows-format \begin_inset LatexCommand \index{Windows-format} \end_inset to UNIX \begin_inset LatexCommand \index{UNIX} \end_inset system format \begin_inset LatexCommand \index{format} \end_inset by doing: \begin_deeper \layout Code tr -d ' \backslash r' < inputFile.txt > outputFile.txt \layout Standard The -d \begin_inset LatexCommand \index{-d} \end_inset switch means to simply delete \begin_inset LatexCommand \index{delete} \end_inset any occurances \begin_inset LatexCommand \index{occurances} \end_inset of the string. Since we are looking \begin_inset LatexCommand \index{looking} \end_inset for ' \backslash r' \begin_inset LatexCommand \index{\r} \end_inset , carriage returns \begin_inset LatexCommand \index{carriage returns} \end_inset it will remove \begin_inset LatexCommand \index{remove} \end_inset any it finds, \begin_inset LatexCommand \index{finds} \end_inset making the file a UNIX \begin_inset LatexCommand \index{UNIX} \end_inset system text file. You can read more about \emph on tr \emph default over here, \begin_inset LatexCommand \ref{text-manipulation-tools} \end_inset . \end_deeper \layout Subsection Conversion tools \begin_inset LatexCommand \label{text-conversion-tools} \end_inset \layout Description enscript \begin_inset LatexCommand \index{enscript} \end_inset Converts text files to postscript, \begin_inset LatexCommand \index{postscript} \end_inset rtf, \begin_inset LatexCommand \index{rtf} \end_inset HTML \begin_inset LatexCommand \index{HTML} \end_inset (use \emph on ghostview \emph default to view \begin_inset LatexCommand \index{view} \end_inset the postscript \begin_inset LatexCommand \index{postscript} \end_inset file). \emph on enscript \emph default has a large number of options \begin_inset LatexCommand \index{options} \end_inset which can be used to customise \begin_inset LatexCommand \index{customise} \end_inset the output. \begin_deeper \layout Standard Examples: \begin_inset Foot collapsed false \layout Standard These examples are based off information from the enscript manual page, see [12] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset \layout Code enscript --language=html input_file.txt -o output_file.html \layout Standard This will take some file and output it as a html \begin_inset LatexCommand \index{html} \end_inset file. \layout Code enscript --help-highlight \layout Standard Display help on using the highlight \begin_inset LatexCommand \index{highlight} \end_inset feature (list all different types \begin_inset LatexCommand \index{types} \end_inset of highlighting \begin_inset LatexCommand \index{highlighting} \end_inset available) \layout Code enscript --help-highlight \layout Standard Highlight \begin_inset LatexCommand \index{lang} \end_inset (pretty print), example: \layout Code enscript -E --color --language=html --toc --output=foo.html *.h *.c \layout Standard Add \begin_inset LatexCommand \index{Add} \end_inset all the files with a .h \begin_inset LatexCommand \index{.h} \end_inset and a .c (C source \begin_inset LatexCommand \index{source} \end_inset and header \begin_inset LatexCommand \index{header} \end_inset files) into a file called foo.html, use colour \begin_inset LatexCommand \index{colour} \end_inset and add \begin_inset LatexCommand \index{add} \end_inset a table \begin_inset LatexCommand \index{table} \end_inset of contents \begin_inset LatexCommand \index{contents} \end_inset \layout Standard For further options refer to the well written manual page \begin_inset LatexCommand \index{page} \end_inset of enscript. \begin_inset LatexCommand \index{enscript} \end_inset \end_deeper \layout Description \noindent figlet \begin_inset LatexCommand \index{figlet} \end_inset Used to create ASCII \begin_inset LatexCommand \index{ASCII} \end_inset \begin_inset Quotes eld \end_inset art \begin_inset Quotes erd \end_inset . Figlet can create several \begin_inset LatexCommand \index{several} \end_inset different forms (fonts) of ASCII \begin_inset LatexCommand \index{ASCII} \end_inset art, \begin_inset LatexCommand \index{art} \end_inset its one of the more \begin_inset LatexCommand \index{more} \end_inset unusual \begin_inset LatexCommand \index{unusual} \end_inset programs \begin_inset LatexCommand \index{programs} \end_inset around. \layout Section Finding Text Within Files \begin_inset LatexCommand \label{finding-text-within-files} \end_inset \layout Description grep \begin_inset LatexCommand \index{grep} \end_inset Looks for text within files. For example: \begin_deeper \layout Code \emph on grep this_word this_file.txt \emph default \layout Standard Example options: \layout Itemize \emph on -v \begin_inset LatexCommand \index{-v} \end_inset \emph default --- this option is used to display lines \begin_inset LatexCommand \index{lines} \end_inset which do not contain the string. \layout Itemize \emph on -n \begin_inset LatexCommand \index{-n} \end_inset \emph default --- this option displays the line \begin_inset LatexCommand \index{line} \end_inset numbers \layout Itemize \emph on -w \begin_inset LatexCommand \index{-w} \end_inset \emph default --- this option makes grep \begin_inset LatexCommand \index{grep} \end_inset match the whole word \layout Itemize \emph on -A x \emph default or \emph on -B \emph default x \begin_inset LatexCommand \index{-A} \end_inset \begin_inset LatexCommand \index{-B} \end_inset (where x is a number) --- display \begin_inset LatexCommand \index{display} \end_inset \begin_inset Quotes eld \end_inset x \begin_inset Quotes erd \end_inset lines \series bold A \series default fter or \series bold B \series default efore the section \begin_inset LatexCommand \index{section} \end_inset where the particular \begin_inset LatexCommand \index{particular} \end_inset word is found. \begin_inset LatexCommand \index{found} \end_inset \layout Itemize \emph on -r \begin_inset LatexCommand \index{-r} \end_inset \emph default or \emph on rgrep \emph default --- search for text \begin_inset LatexCommand \index{text} \end_inset within files recursively. \layout Standard This command uses regular expressions \begin_inset LatexCommand \index{regular expressions} \end_inset , for more information \begin_inset LatexCommand \index{information} \end_inset please see, \begin_inset LatexCommand \ref{regular-expressions} \end_inset . \layout Standard For example, this command would look \begin_inset LatexCommand \index{look} \end_inset in the file \begin_inset Quotes eld \end_inset rpmlist.txt \begin_inset Quotes erd \end_inset for anything starting \begin_inset LatexCommand \index{starting} \end_inset with \begin_inset Quotes eld \end_inset rpm \begin_inset Quotes erd \end_inset : \layout Code grep rpm rpmlist.txt \layout Standard Or you could use it like this, to search through the output \begin_inset LatexCommand \index{output} \end_inset of another file: \layout Code rpm -qa | grep ogg \begin_inset LatexCommand \index{-q} \end_inset \begin_inset LatexCommand \index{-a} \end_inset \layout Standard The first command lists \begin_inset LatexCommand \index{lists} \end_inset all RPM's installed \begin_inset LatexCommand \index{installed} \end_inset on your system, the second finds \begin_inset LatexCommand \index{finds} \end_inset any containing the string \begin_inset Quotes eld \end_inset ogg \begin_inset Quotes erd \end_inset and outputs \begin_inset LatexCommand \index{outputs} \end_inset them. \end_deeper \layout Description \noindent rgrep \begin_inset LatexCommand \index{rgrep} \end_inset A "recursive" \begin_inset LatexCommand \index{recursive} \end_inset version \begin_inset LatexCommand \index{version} \end_inset of \emph on grep \emph default (this is a different \begin_inset LatexCommand \index{different} \end_inset program to \emph on grep \emph default ). This will search all the files in the current directory \begin_inset LatexCommand \index{directory} \end_inset and all it's subdirectories and print \begin_inset LatexCommand \index{print} \end_inset the names of the files and the matching \begin_inset LatexCommand \index{matching} \end_inset line. Follows \begin_inset LatexCommand \index{Follows} \end_inset similar syntax \begin_inset LatexCommand \index{syntax} \end_inset to \emph on grep \emph default (see above). You could also use \emph on grep \emph default with the \emph on -r \emph default option \begin_inset LatexCommand \index{option} \end_inset to achieve the same affect. \begin_inset LatexCommand \index{affect} \end_inset \layout Description fgrep \begin_inset LatexCommand \index{fgrep} \end_inset This version \begin_inset LatexCommand \index{version} \end_inset of \emph on grep \emph default calls \begin_inset LatexCommand \index{calls} \end_inset \emph on grep \emph default with the \emph on -F \emph default option. This will look for literal \begin_inset LatexCommand \index{literal} \end_inset strings only, it won't use or expand \begin_inset LatexCommand \index{expand} \end_inset any kind of regular \begin_inset LatexCommand \index{regular} \end_inset expression. \begin_deeper \layout Standard For example you could type: \layout Code fgrep 'a$*b?' file.txt \layout Standard And \emph on fgrep \emph default would look for the string \begin_inset Quotes eld \end_inset a$*b? \begin_inset Quotes erd \end_inset in the file \begin_inset Quotes eld \end_inset file.txt \begin_inset Quotes erd \end_inset . \end_deeper \layout SGML \layout SGML Other Versions \layout SGML \layout SGML There are various versions of grep which are designed to do different things try searching for them on the internet or within your distribution. \layout SGML \layout SGML \layout Chapter Mathematical tools \begin_inset LatexCommand \label{Mathematical-tools} \end_inset \layout Standard \begin_inset Note collapsed false \layout Description factor Calculates and outputs the prime factors of numbers passed as arguments. \begin_deeper \layout Standard Command syntax: \layout Code factor number1 number2 number3 \layout Standard This will output factors of the first, second and third numbers (you can do just one number or several numbers\SpecialChar \ldots{} ) with one number's factor(s) per line. \layout SGML \layout SGML Note: \layout SGML \layout SGML Please note that this tool is part of the num-utils package. \layout SGML \layout SGML \end_deeper \layout Standard seq Print a list of numbers (line-by-line). This is usually more useful in programming than in normal usage\SpecialChar \ldots{} \layout Standard Command syntax: \layout Code seq starting_number ending_number \begin_deeper \layout Standard This will print numbers from the \begin_inset Quotes eld \end_inset starting_number \begin_inset Quotes erd \end_inset till the \begin_inset Quotes eld \end_inset ending_number \begin_inset Quotes erd \end_inset with one number on each line. \end_deeper \layout Description range Similar to \emph on seq \emph default . The basic syntax is the same as \emph on seq \emph default (above). \begin_deeper \layout SGML \layout SGML Note: \layout SGML \layout SGML Please note that this tool is part of the num-utils package. \layout SGML \layout SGML \end_deeper \layout Description average Find the median, mode, or average of a set of numbers. The numbers can come from standard input or from a file. \begin_deeper \layout Standard For example, to input from standard input you could simply type: \layout Code average \layout Standard To input from a file you would type: \layout Code average file_name \layout SGML \layout SGML Note: \layout SGML \layout SGML Please note that this tool is part of the num-utils package. \layout SGML \layout SGML \end_deeper \layout Description bound Find the minimum and/or maximum of a set of numbers. The numbers can come from standard input or from a file. \begin_deeper \layout Standard For example, to input from standard input you could simply type: \layout Code bound \layout Standard To input from a file you would type: \layout Code bound file_name \layout SGML \layout SGML Note: \layout SGML \layout SGML Please note that this tool is part of the num-utils package. \layout SGML \layout SGML \end_deeper \layout Description interval Find the difference between numbers (by default it will show the difference between each line). \begin_deeper \layout Standard For example, to input from standard input you could simply type: \layout Code interval \layout Standard To input from a file you would type: \layout Code interval file_name \layout SGML \layout SGML Note: \layout SGML \layout SGML Please note that this tool is part of the num-utils package. \layout SGML \layout SGML \end_deeper \layout Description numsum Find the result of adding all the numbers either on standard input or in a file. \begin_deeper \layout Standard For example, to input from standard input you could simply type: \layout Code numsum \layout Standard To input from a file you would type: \layout Code numsum file_name \layout SGML \layout SGML Note: \layout SGML \layout SGML Please note that this tool is part of the num-utils package. \layout SGML \layout SGML \end_deeper \layout Description numprocess \emph on numprocess \emph default is used to perform some kind of batch operation on everything in a file or on standard input. \begin_deeper \layout Standard Use '/' (forward-slashes) to enclose expressions. \layout Standard Any expression will be applied to every number in the file or on standard inputs \layout Standard For example, to input from standard input you could simply type: \layout Code numsum \layout Standard To input from a file and multiply every number by 1024 you would type: \layout Code numsum /*1024/ file_name \layout SGML \layout SGML Note: \layout SGML \layout SGML Please note that this tool is part of the num-utils package. \layout SGML \layout SGML \end_inset \layout SGML \layout SGML num-utils homepage \layout SGML \layout SGML The \begin_inset Quotes eld \end_inset num-utils \begin_inset Quotes erd \end_inset homepage, \begin_inset LatexCommand \url[Num Utils,]{http://suso.suso.org/programs/num-utils/} \end_inset contains a variety of command line programs that could be useful when performin g maths on your GNU/Linux machine. \layout SGML \layout SGML \layout Description \noindent units \begin_inset LatexCommand \index{units} \end_inset Convert \begin_inset LatexCommand \index{Convert} \end_inset units of measurement \begin_inset LatexCommand \index{measurement} \end_inset between different scales. \begin_inset LatexCommand \index{scales} \end_inset For example, centimeters \begin_inset LatexCommand \index{centimeters} \end_inset to inches, \begin_inset LatexCommand \index{inches} \end_inset litres \begin_inset LatexCommand \index{litres} \end_inset to gallons. \begin_inset LatexCommand \index{gallons} \end_inset \begin_deeper \layout Standard \noindent Simply run \begin_inset LatexCommand \index{run} \end_inset the program, \begin_inset LatexCommand \index{program} \end_inset I recommend \begin_inset LatexCommand \index{recommend} \end_inset running \begin_inset LatexCommand \index{running} \end_inset it as follows: \begin_inset LatexCommand \index{follows} \end_inset \layout Code units --verbose \begin_inset LatexCommand \index{--verbose} \end_inset \layout Standard This will run the program and it will tell \begin_inset LatexCommand \index{tell} \end_inset you exactly \begin_inset LatexCommand \index{exactly} \end_inset what it is doing. \layout Standard Example: you enter \begin_inset LatexCommand \index{enter} \end_inset \begin_inset Quotes eld \end_inset 60 meters \begin_inset LatexCommand \index{meters} \end_inset \begin_inset Quotes erd \end_inset then you want it worked out in \begin_inset Quotes eld \end_inset kilometers \begin_inset Quotes erd \end_inset . The first line will tell \begin_inset LatexCommand \index{tell} \end_inset you what this evaluates \begin_inset LatexCommand \index{evaluates} \end_inset to. \layout Standard If you wanted the conversion \begin_inset LatexCommand \index{conversion} \end_inset rate for \begin_inset Quotes eld \end_inset meters \begin_inset Quotes erd \end_inset to \begin_inset Quotes eld \end_inset kilometers \begin_inset Quotes erd \end_inset read the second line of the output \begin_inset LatexCommand \index{output} \end_inset (which will tell \begin_inset LatexCommand \index{tell} \end_inset you meters/1000). \layout SGML \layout SGML To exit \layout SGML Press \begin_inset LatexCommand \index{press} \end_inset CTRL-D (end-of-file key) when you are finished \begin_inset LatexCommand \index{finished} \end_inset using \emph on units \emph default . \layout SGML \end_deeper \layout Description python \begin_inset LatexCommand \index{python} \end_inset Python \begin_inset LatexCommand \index{Python} \end_inset is a very powerful, \begin_inset LatexCommand \index{powerful} \end_inset easy to learn, \begin_inset LatexCommand \index{learn} \end_inset general \begin_inset LatexCommand \index{general} \end_inset purpose, interpreted \begin_inset LatexCommand \index{interpreted} \end_inset programming \begin_inset LatexCommand \index{programming} \end_inset language. And it makes a great \begin_inset LatexCommand \index{great} \end_inset calculator! If you don't have a calculator \begin_inset LatexCommand \index{calculator} \end_inset installed \begin_inset LatexCommand \index{installed} \end_inset then simply type \emph on python \emph default , then hit \begin_inset LatexCommand \index{hit} \end_inset [Enter]. \begin_deeper \layout Standard This will execute \begin_inset LatexCommand \index{execute} \end_inset the Python \begin_inset LatexCommand \index{Python} \end_inset interpreter in interactive \begin_inset LatexCommand \index{interactive} \end_inset mode. Type your sums \begin_inset LatexCommand \index{sums} \end_inset just like you would use a calculator. \begin_inset LatexCommand \index{calculator} \end_inset Note that if you want to work out fractions \begin_inset LatexCommand \index{fractions} \end_inset make sure you use a decimal \begin_inset LatexCommand \index{decimal} \end_inset point and a zero \begin_inset LatexCommand \index{zero} \end_inset to obtain the correct \begin_inset LatexCommand \index{correct} \end_inset answer (otherwise it will use integer \begin_inset LatexCommand \index{integer} \end_inset division). \begin_inset Note collapsed false \layout Standard should add some real calculators\SpecialChar \ldots{} bc is a very advanced calc, but its seems complicated to use\SpecialChar \ldots{} closer to C programming. I find python much easier. \layout Standard don't know how to use dc either. \end_inset \layout Standard To start \begin_inset LatexCommand \index{start} \end_inset python in interactive \begin_inset LatexCommand \index{interactive} \end_inset mode, simply type: \layout Code python \layout Standard Once python \begin_inset LatexCommand \index{python} \end_inset is started \begin_inset LatexCommand \index{started} \end_inset you can use it to add \begin_inset LatexCommand \index{add} \end_inset up sums \begin_inset LatexCommand \index{sums} \end_inset or maybe do some python programming. \begin_inset LatexCommand \index{programming} \end_inset \layout Standard Use CTRL-D (end-of-file key) to exit \begin_inset LatexCommand \index{exit} \end_inset the Python \begin_inset LatexCommand \index{Python} \end_inset interpreter. \end_deeper \layout Description numgrep \begin_inset LatexCommand \index{numgrep} \end_inset A little bit \begin_inset LatexCommand \index{bit} \end_inset like grep \begin_inset LatexCommand \index{grep} \end_inset only this is designed \begin_inset LatexCommand \index{designed} \end_inset for numbers \begin_inset LatexCommand \index{numbers} \end_inset only. \begin_deeper \layout Standard Use '/' (forward slashes) to contain each expression. \begin_inset LatexCommand \index{expression} \end_inset \layout Standard Use m to find \begin_inset LatexCommand \index{find} \end_inset multiples of the number \begin_inset LatexCommand \index{number} \end_inset n and use f to find factors \begin_inset LatexCommand \index{factors} \end_inset of the number n. \layout Standard Use commas \begin_inset LatexCommand \index{commas} \end_inset to seperate expressions \begin_inset LatexCommand \index{expressions} \end_inset and .. (two dots) to represent \begin_inset LatexCommand \index{represent} \end_inset a range. \begin_inset LatexCommand \index{range} \end_inset \layout Standard For example, to input \begin_inset LatexCommand \index{input} \end_inset from standard \begin_inset LatexCommand \index{standard} \end_inset input \begin_inset LatexCommand \index{input} \end_inset \begin_inset LatexCommand \index{standard input} \end_inset you could simply type: \layout Code numgrep \layout Standard To input from a file and look \begin_inset LatexCommand \index{look} \end_inset for numbers \begin_inset LatexCommand \index{numbers} \end_inset between 1 and 1000 you could type: \layout Code numgrep /1..1000/ file_name \layout SGML \layout SGML This tool comes from the num-utils package \layout SGML \layout SGML Please note that this tool is part of the num-utils package. \layout SGML \layout SGML \end_deeper \layout Standard \begin_inset Note collapsed false \layout Standard so outdated I think its useless now\SpecialChar \ldots{} \layout Description write (send) a message to the terminal of another user. CTRL-D (end-of-file) ends the message. You may need to use \emph on mesg y \emph default to turn write permission on. \begin_deeper \layout Standard Command syntax: \layout Code write user_name \layout Standard This should write to the particular user, it appears to work only in console mode (at least in Mandrake Linux 9.0). \end_deeper \layout Description talk To interactively chat in real-time with another user. Also try, \emph on ytalk \emph default , which allows you to connect to multiple users, and \emph on xchat \emph default . \layout Description scrapped the section because I don't know it well enough \layout Description wall Send a broadcast message to all users who have write permission turned on (users will normally have write permission off\SpecialChar \ldots{} use \emph on mesg \emph default to change this). \layout Chapter Communication (within the network) \begin_inset LatexCommand \label{Communication} \end_inset \layout Description mesg A very simple utility that turns write permission on or off (to send messages). \begin_deeper \layout Standard Simply type: \layout Code mesg y \layout Standard To turn write permission on, or \layout Code mesg n \layout Standard To turn write permission off \end_deeper \layout Standard \begin_inset Note collapsed true \layout Standard what other tools are there for in network communication? \layout Standard write user seems to work only is console mode, you can do writevt, or write user \SpecialChar \ldots{} \end_inset \end_inset \layout Chapter Network Commands \begin_inset LatexCommand \label{Network-commands} \end_inset \begin_inset Note collapsed false \layout Description the author is not very familiar with networking commands\SpecialChar \ldots{} \layout Standard I'm sort of following what information I find online\SpecialChar \ldots{} I don't currently know much about this\SpecialChar \ldots{} contributions are welcome (to somecsstudent@gmail.com) \layout Standard notes: \layout Standard nstat removed \layout Description usernetctl Sometimes users are granted the ability to bring certain interfaces up or down on their own; this is the command they use. It is like an emasculated version of \emph on ifconfig \emph default , that can only turn the interface on or off. \begin_deeper \layout Standard \noindent The syntax is normally: \layout Code \noindent usernetctl device-name option \end_deeper \layout Code \layout Standard not sure if usernetctl is worth having\SpecialChar \ldots{} how many ppl allow users to control interfaces? although it would be useful for wireless networking. \layout Standard in wireless you have the iwconfig could be useful! \end_inset \layout Standard The network \begin_inset LatexCommand \index{network} \end_inset commands chapter explains \begin_inset LatexCommand \index{explains} \end_inset various tools which can be useful when networking \begin_inset LatexCommand \index{networking} \end_inset with other computers \begin_inset LatexCommand \index{computers} \end_inset both within the network \begin_inset LatexCommand \index{network} \end_inset and accross the internet, \begin_inset LatexCommand \index{internet} \end_inset obtaining more \begin_inset LatexCommand \index{more} \end_inset information \begin_inset LatexCommand \index{information} \end_inset about other computers. This chapter also includes \begin_inset LatexCommand \index{includes} \end_inset information on tools for network \begin_inset LatexCommand \index{network} \end_inset configuration, file transfer \begin_inset LatexCommand \index{transfer} \end_inset and working with remote machines. \begin_inset LatexCommand \index{remote machines} \end_inset \layout Description \noindent netstat \begin_inset LatexCommand \index{netstat} \end_inset Displays contents \begin_inset LatexCommand \index{contents} \end_inset of /proc/net files. \begin_inset LatexCommand \index{/proc/net} \end_inset It works with the Linux Network Subsystem, \begin_inset LatexCommand \index{Subsystem} \end_inset it will tell \begin_inset LatexCommand \index{tell} \end_inset you what the status \begin_inset LatexCommand \index{status} \end_inset of ports \begin_inset LatexCommand \index{ports} \end_inset are ie. open, \begin_inset LatexCommand \index{open} \end_inset closed, \begin_inset LatexCommand \index{closed} \end_inset waiting, \begin_inset LatexCommand \index{waiting} \end_inset masquerade \begin_inset LatexCommand \index{masquerade} \end_inset connections. It will also display various other things. It has many different options. \begin_inset LatexCommand \index{options} \end_inset \layout Description \noindent tcpdump \begin_inset LatexCommand \index{tcpdump} \end_inset This is a sniffer, \begin_inset LatexCommand \index{sniffer} \end_inset a program that captures \begin_inset LatexCommand \index{captures} \end_inset packets off \begin_inset LatexCommand \index{off} \end_inset a network \begin_inset LatexCommand \index{network} \end_inset interface \begin_inset LatexCommand \index{interface} \end_inset and interprets \begin_inset LatexCommand \index{interprets} \end_inset them for you. It understands all basic \begin_inset LatexCommand \index{basic} \end_inset internet \begin_inset LatexCommand \index{Internet} \end_inset protocols, \begin_inset LatexCommand \index{protocols} \end_inset and can be used to save \begin_inset LatexCommand \index{save} \end_inset entire packets \begin_inset LatexCommand \index{packets} \end_inset for later inspection. \begin_inset LatexCommand \index{inspection} \end_inset \layout Description \noindent ping The ping \begin_inset LatexCommand \index{ping} \end_inset command (named after the sound \begin_inset LatexCommand \index{sound} \end_inset of an active sonar system) sends \begin_inset LatexCommand \index{sends} \end_inset echo requests \begin_inset LatexCommand \index{requests} \end_inset to the host \begin_inset LatexCommand \index{host} \end_inset you specify \begin_inset LatexCommand \index{specify} \end_inset on the command line, and lists \begin_inset LatexCommand \index{lists} \end_inset the responses \begin_inset LatexCommand \index{responses} \end_inset received their round \begin_inset LatexCommand \index{round} \end_inset trip time. \begin_deeper \layout Standard \noindent You simply use ping as: \layout Code ping ip_or_host_name \layout Standard Note to stop \begin_inset LatexCommand \index{stop} \end_inset ping (otherwise it goes forever) use CTRL-C (break). \layout SGML \layout SGML Please note \layout SGML Using ping/smbmount/ssh or other UNIX system programs with a computer name rather than IP address will only work if you have the computer listed \begin_inset LatexCommand \index{listed} \end_inset in your /etc/hosts \begin_inset LatexCommand \index{/etc/hosts} \end_inset file. Here is an example: \layout SGML \layout SGML 192.168.1.100 new \layout SGML This line says that their is a computer called \begin_inset Quotes eld \end_inset new \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{new} \end_inset with IP address 192.168.1.100 \begin_inset LatexCommand \index{192.168.1.100} \end_inset . Now that it exists in the /etc/hosts file I don't have to type the IP address anymore, just the name \begin_inset Quotes eld \end_inset new \begin_inset Quotes erd \end_inset . \layout SGML \layout SGML \end_deeper \layout Description \noindent hostname \begin_inset LatexCommand \index{hostname} \end_inset Tells the user the host \begin_inset LatexCommand \index{host} \end_inset name of the computer they are logged \begin_inset LatexCommand \index{logged} \end_inset into. Note: may be called \emph on host. \begin_inset LatexCommand \index{host} \end_inset \layout Description \noindent traceroute \begin_inset LatexCommand \index{traceroute} \end_inset \emph on traceroute \emph default will show \begin_inset LatexCommand \index{show} \end_inset the route \begin_inset LatexCommand \index{route} \end_inset of a packet. \begin_inset LatexCommand \index{packet} \end_inset It attempts \begin_inset LatexCommand \index{attempts} \end_inset to list \begin_inset LatexCommand \index{list} \end_inset the series \begin_inset LatexCommand \index{series} \end_inset of hosts \begin_inset LatexCommand \index{hosts} \end_inset through which \begin_inset LatexCommand \index{which} \end_inset your packets \begin_inset LatexCommand \index{packets} \end_inset travel \begin_inset LatexCommand \index{travel} \end_inset on their way to a given destination. \begin_inset LatexCommand \index{destination} \end_inset Also have a look at \emph on xtraceroute \emph default (one of several \begin_inset LatexCommand \index{several} \end_inset graphical \begin_inset LatexCommand \index{graphical} \end_inset equivalents of this program). \begin_deeper \layout Standard \noindent Command syntax: \layout Code traceroute machine_name_or_ip \end_deeper \layout Description tracepath \begin_inset LatexCommand \index{tracepath} \end_inset \emph on tracepath \emph default performs \begin_inset LatexCommand \index{performs} \end_inset a very simlar function \begin_inset LatexCommand \index{function} \end_inset to \emph on traceroute \emph default the main difference \begin_inset LatexCommand \index{difference} \end_inset is that \emph on tracepath \emph default doesn't take complicated \begin_inset LatexCommand \index{complicated} \end_inset options. \begin_inset Note collapsed false \layout Standard and can be executed by non-root users.--and I think that traceroute can be too although their both in /usr/sbin \end_inset \begin_deeper \layout Standard Command syntax: \layout Code tracepath machine_name_or_ip \end_deeper \layout Description findsmb \begin_inset LatexCommand \index{findsmb} \end_inset \emph on findsmb \emph default is used to list info \begin_inset LatexCommand \index{info} \end_inset about machines \begin_inset LatexCommand \index{machines} \end_inset that respond \begin_inset LatexCommand \index{respond} \end_inset to SMB \begin_inset LatexCommand \index{SMB} \end_inset name queries \begin_inset LatexCommand \index{queries} \end_inset (for example windows \begin_inset LatexCommand \index{windows} \end_inset based machines \begin_inset LatexCommand \index{machines} \end_inset sharing \begin_inset LatexCommand \index{sharing} \end_inset their hard disk's). \begin_deeper \layout Standard Command syntax: \layout Code findsmb \layout Standard This would find all machines \begin_inset LatexCommand \index{machines} \end_inset possible, \begin_inset LatexCommand \index{possible} \end_inset you may need to specify a particular \begin_inset LatexCommand \index{particular} \end_inset subnet to query those machines only\SpecialChar \ldots{} \end_deeper \layout Description nmap \begin_inset LatexCommand \index{nmap} \end_inset \begin_inset Quotes eld \end_inset network \begin_inset LatexCommand \index{network} \end_inset exploration tool and security \begin_inset LatexCommand \index{security} \end_inset scanner \begin_inset LatexCommand \index{scanner} \end_inset \begin_inset Quotes erd \end_inset . \emph on nmap \emph default is a very advanced \begin_inset LatexCommand \index{advanced} \end_inset network tool used to query \begin_inset LatexCommand \index{query} \end_inset machines (local or remote) as to whether they are up and what ports \begin_inset LatexCommand \index{ports} \end_inset are open \begin_inset LatexCommand \index{open} \end_inset on these machines. \begin_inset LatexCommand \index{machines} \end_inset \begin_deeper \layout Standard A simple usage example: \layout Code nmap machine_name \layout Standard This would query your own machine \begin_inset LatexCommand \index{machine} \end_inset as to what ports \begin_inset LatexCommand \index{ports} \end_inset it keeps open. \begin_inset LatexCommand \index{open} \end_inset \emph on nmap \emph default is a very powerful \begin_inset LatexCommand \index{powerful} \end_inset tool, documentation \begin_inset LatexCommand \index{documentation} \end_inset is available \begin_inset LatexCommand \index{available} \end_inset on the \begin_inset LatexCommand \url[nmap site]{http://www.insecure.org/nmap/} \end_inset \begin_inset LatexCommand \index{nmap site} \end_inset as well as the information in the manual \begin_inset LatexCommand \index{manual} \end_inset page. \begin_inset LatexCommand \index{page} \end_inset \end_deeper \layout Section \noindent Network Configuration \begin_inset LatexCommand \label{network-configuration} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard ifport if some of your network cards are fancy and support multiple transceiver types, then you start configuration by using this command to specify which transceiver type you will use. ? useful? \end_inset \layout Description \noindent ifconfig \begin_inset LatexCommand \index{ifconfig} \end_inset This command is used to configure \begin_inset LatexCommand \index{configure} \end_inset network \begin_inset LatexCommand \index{network} \end_inset interfaces \begin_inset LatexCommand \index{interfaces} \end_inset , or to display their current configuration. \begin_inset LatexCommand \index{configuration} \end_inset In addition \begin_inset LatexCommand \index{addition} \end_inset to activating and deactivating \begin_inset LatexCommand \index{deactivating} \end_inset interfaces \begin_inset LatexCommand \index{interfaces} \end_inset with the \begin_inset Quotes eld \end_inset up \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset down \begin_inset Quotes erd \end_inset settings, \begin_inset LatexCommand \index{settings} \end_inset this command is necessary for setting \begin_inset LatexCommand \index{setting} \end_inset an interface's address \begin_inset LatexCommand \index{address} \end_inset information \begin_inset LatexCommand \index{information} \end_inset if you don't have the \emph on ifcfg \emph default script. \begin_inset LatexCommand \index{script} \end_inset \begin_deeper \layout Standard \noindent Use \emph on ifconfig \emph default as either: \layout Code ifconfig \layout Standard This will simply list all information on all network \begin_inset LatexCommand \index{network} \end_inset devices currently up. \layout Code ifconfig eth0 down \layout Standard This will take eth0 (assuming the device \begin_inset LatexCommand \index{device} \end_inset exists) down, it won't be able \begin_inset LatexCommand \index{able} \end_inset to receive \begin_inset LatexCommand \index{receive} \end_inset or send \begin_inset LatexCommand \index{send} \end_inset anything until you put the device back \begin_inset Quotes eld \end_inset up \begin_inset Quotes erd \end_inset again. \layout Standard Clearly there are a lot more options for this tool, you will need to read the manual/info page to learn \begin_inset LatexCommand \index{learn} \end_inset more \begin_inset LatexCommand \index{more} \end_inset about them. \layout Standard \begin_inset Note collapsed true \layout Standard because I really don't know anything about them :) \end_inset \end_deeper \layout Description ifup \begin_inset LatexCommand \index{ifup} \end_inset Use \emph on ifup device-name \emph default to bring an interface \begin_inset LatexCommand \index{interface} \end_inset up by following a script (which will contain your default networking \begin_inset LatexCommand \index{networking} \end_inset settings). Simply type \emph on ifup \begin_inset LatexCommand \index{ifup} \end_inset \emph default and you will get help on using the script. \begin_deeper \layout Standard For example typing: \layout Code ifup eth0 \layout Standard Will bring eth0 \begin_inset LatexCommand \index{eth0} \end_inset up if it is currently down. \end_deeper \layout Description ifdown \begin_inset LatexCommand \index{ifdown} \end_inset Use \emph on ifdown device-name \emph default to bring an interface \begin_inset LatexCommand \index{interface} \end_inset down using a script (which will contain your default network settings). Simply type \emph on ifdown \begin_inset LatexCommand \index{ifdown} \end_inset \emph default and you will get help \begin_inset LatexCommand \index{help} \end_inset on using the script. \begin_deeper \layout Standard For example typing: \layout Code ifdown eth0 \layout Standard Will bring eth0 \begin_inset LatexCommand \index{eth0} \end_inset down if it is currently up. \end_deeper \layout Description ifcfg \begin_inset LatexCommand \index{ifcfg} \end_inset Use \emph on ifcfg \emph default to configure \begin_inset LatexCommand \index{configure} \end_inset a particular interface. \begin_inset LatexCommand \index{interface} \end_inset Simply type ifcfg \begin_inset LatexCommand \index{ifcfg} \end_inset to get help \begin_inset LatexCommand \index{help} \end_inset on using this script. \begin_deeper \layout Standard For example, to change \begin_inset LatexCommand \index{change} \end_inset eth0 \begin_inset LatexCommand \index{eth0} \end_inset from 192.168.0.1 \begin_inset LatexCommand \index{192.168.0.1} \end_inset to 192.168.0.2 \begin_inset LatexCommand \index{192.168.0.2} \end_inset you could do: \layout Code ifcfg eth0 del 192.168.0.1 \layout Code ifcfg eth0 add 192.168.0.2 \layout Standard The first command takes eth0 \begin_inset LatexCommand \index{eth0} \end_inset down and removes \begin_inset LatexCommand \index{removes} \end_inset that stored \begin_inset LatexCommand \index{stored} \end_inset IP address \begin_inset LatexCommand \index{IP address} \end_inset and the second one brings it back up with the new \begin_inset LatexCommand \index{new} \end_inset address. \end_deeper \layout Description \noindent route \begin_inset LatexCommand \index{route} \end_inset The \emph on route \emph default command is the tool used to display \begin_inset LatexCommand \index{display} \end_inset or modify \begin_inset LatexCommand \index{modify} \end_inset the routing \begin_inset LatexCommand \index{routing} \end_inset table. \begin_inset LatexCommand \index{table} \end_inset To add \begin_inset LatexCommand \index{add} \end_inset a gateway \begin_inset LatexCommand \index{gateway} \end_inset as the default \begin_inset LatexCommand \index{default} \end_inset you would type: \begin_deeper \layout Code route add default gw some_computer \end_deeper \layout Section \noindent Internet Specific Commands \begin_inset LatexCommand \label{internet-specific-commands} \end_inset \layout Standard Note that should DNS \begin_inset LatexCommand \index{DNS} \end_inset not be configured correctly \begin_inset LatexCommand \index{correctly} \end_inset on your machine, \begin_inset LatexCommand \index{machine} \end_inset you need to edit \begin_inset LatexCommand \index{edit} \end_inset \begin_inset Quotes eld \end_inset /etc/resolv.conf \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{/etc/resolv.conf} \end_inset to make things work\SpecialChar \ldots{} \layout Description host \begin_inset LatexCommand \index{host} \end_inset Performs a simple lookup \begin_inset LatexCommand \index{lookup} \end_inset of an internet \begin_inset LatexCommand \index{internet} \end_inset address (using the Domain Name System, DNS). Simply type: \begin_deeper \layout Code host ip_address \layout Standard or \layout Code host domain_name \end_deeper \layout Description \noindent dig \begin_inset LatexCommand \index{dig} \end_inset The "domain information groper" \begin_inset LatexCommand \index{domain information groper} \end_inset tool. More advanced \begin_inset LatexCommand \index{advanced} \end_inset then \emph on host \emph default \SpecialChar \ldots{} If you give a hostname \begin_inset LatexCommand \index{hostname} \end_inset as an argument \begin_inset LatexCommand \index{argument} \end_inset to output \begin_inset LatexCommand \index{output} \end_inset information about that host, \begin_inset LatexCommand \index{host} \end_inset including \begin_inset LatexCommand \index{including} \end_inset it's IP address, hostname and various other information. \begin_deeper \layout Standard \noindent For example, to look up information about \begin_inset Quotes eld \end_inset www.amazon.com \begin_inset Quotes erd \end_inset type: \layout Code \noindent dig www.amazon.com \layout Standard \noindent To find the host name for a given IP address (ie a reverse \begin_inset LatexCommand \index{reverse} \end_inset lookup), use \emph on dig \emph default with the \emph on `-x' \begin_inset LatexCommand \index{-x} \end_inset \emph default option. \begin_inset LatexCommand \index{option} \end_inset \layout Code \noindent dig -x 100.42.30.95 \layout Standard \noindent This will look up the address \begin_inset LatexCommand \index{address} \end_inset (which may or may not exist) and returns \begin_inset LatexCommand \index{returns} \end_inset the address of the host, \begin_inset LatexCommand \index{host} \end_inset for example if that was the address of \begin_inset Quotes eld \end_inset http://slashdot.org \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{http://slashdot.org} \end_inset then it would return \begin_inset LatexCommand \index{return} \end_inset \begin_inset Quotes eld \end_inset http://slashdot.org \begin_inset Quotes erd \end_inset . \layout Standard \noindent \emph on dig \emph default takes a huge \begin_inset LatexCommand \index{huge} \end_inset number \begin_inset LatexCommand \index{number} \end_inset of options \begin_inset LatexCommand \index{options} \end_inset (at the point of being too many), refer \begin_inset LatexCommand \index{refer} \end_inset to the manual page for more information. \begin_inset LatexCommand \index{information} \end_inset \layout Standard \noindent \begin_inset Note collapsed false \layout Standard this command replaces nslookup\SpecialChar \ldots{} nslookup is now redundant\SpecialChar \ldots{} \end_inset \end_deeper \layout Description \noindent whois \begin_inset LatexCommand \index{whois} \end_inset (now BW whois) is used to look up the contact \begin_inset LatexCommand \index{contact} \end_inset information from the \begin_inset Quotes eld \end_inset whois \begin_inset Quotes erd \end_inset databases, \begin_inset LatexCommand \index{databases} \end_inset the servers \begin_inset LatexCommand \index{servers} \end_inset are only likely to hold major \begin_inset LatexCommand \index{major} \end_inset sites. Note that contact information is likely to be hidden \begin_inset LatexCommand \index{hidden} \end_inset or restricted \begin_inset LatexCommand \index{restricted} \end_inset as it is often abused by crackers \begin_inset LatexCommand \index{crackers} \end_inset and others looking \begin_inset LatexCommand \index{looking} \end_inset for a way to cause \begin_inset LatexCommand \index{cause} \end_inset malicious damage \begin_inset LatexCommand \index{damage} \end_inset to organisation's. \layout Description \noindent wget \begin_inset LatexCommand \index{wget} \end_inset (GNU Web get) used to download \begin_inset LatexCommand \index{download} \end_inset files from the World Wide Web. \begin_deeper \layout Standard \noindent To archive \begin_inset LatexCommand \index{archive} \end_inset a single web-site, use the \emph on -m \begin_inset LatexCommand \index{-m} \end_inset \emph default or \emph on --mirror \begin_inset LatexCommand \index{--mirror} \end_inset \emph default (mirror) option. \layout Standard \noindent Use \emph on \emph default the \emph on -nc \begin_inset LatexCommand \index{-n} \end_inset \emph default (no clobber) option to stop \begin_inset LatexCommand \index{stop} \end_inset \emph on wget \emph default from overwriting \begin_inset LatexCommand \index{overwriting} \end_inset a file if you already have it. \layout Standard \noindent Use the \emph on -c \begin_inset LatexCommand \index{-c} \end_inset \emph default or \emph on --continue \emph default option to continue a file that was unfinished \begin_inset LatexCommand \index{unfinished} \end_inset by wget or another program. \begin_inset LatexCommand \index{program} \end_inset \layout Standard \noindent Simple usage \begin_inset LatexCommand \index{usage} \end_inset example: \layout Code wget url_for_file \layout Standard This would simply get a file from a site. \begin_inset LatexCommand \index{site} \end_inset \layout Standard \emph on wget \emph default can also retrieve \begin_inset LatexCommand \index{retrieve} \end_inset multiple files using standard wildcards, \begin_inset LatexCommand \index{standard wildcards} \end_inset the same as the type used in bash, \begin_inset LatexCommand \index{bash} \end_inset like *, [ ], ?. Simply use \emph on wget \emph default as per normal \begin_inset LatexCommand \index{normal} \end_inset but use single quotation \begin_inset LatexCommand \index{quotation} \end_inset marks (' ') on the URL \begin_inset LatexCommand \index{URL} \end_inset to prevent \begin_inset LatexCommand \index{prevent} \end_inset bash \begin_inset LatexCommand \index{bash} \end_inset from expanding \begin_inset LatexCommand \index{expanding} \end_inset the wildcards. \begin_inset LatexCommand \index{wildcards} \end_inset There are complications if you are retrieving from a http site (see below\SpecialChar \ldots{} ). \layout Standard Advanced usage \begin_inset LatexCommand \index{usage} \end_inset example, (used from \emph on wget \emph default manual page): \begin_inset Note collapsed false \layout Standard reference this correctly? from manual page. \end_inset \layout Code wget --spider --force-html -i bookmarks.html \layout Standard This will parse \begin_inset LatexCommand \index{parse} \end_inset the file bookmarks.html \begin_inset LatexCommand \index{bookmarks.html} \end_inset and check \begin_inset LatexCommand \index{check} \end_inset that all the links \begin_inset LatexCommand \index{links} \end_inset exist. \begin_inset LatexCommand \index{exist} \end_inset \layout Standard Advanced usage: \begin_inset LatexCommand \index{usage} \end_inset this is how you can download \begin_inset LatexCommand \index{download} \end_inset multiple files using http \begin_inset LatexCommand \index{http} \end_inset (using a wildcard\SpecialChar \ldots{} ). \layout Standard Notes: http \begin_inset LatexCommand \index{http} \end_inset doesn't support \begin_inset LatexCommand \index{support} \end_inset downloading \begin_inset LatexCommand \index{downloading} \end_inset using standard wildcards, \begin_inset LatexCommand \index{standard wildcards} \end_inset ftp \begin_inset LatexCommand \index{ftp} \end_inset does so you may use wildcards with ftp and it will work fine. A work-around \begin_inset LatexCommand \index{work-around} \end_inset for this http limitation is shown \begin_inset LatexCommand \index{shown} \end_inset below: \layout Code wget -r -l1 --no-parent -A.gif http://www.website.com \begin_inset Foot collapsed false \layout Standard This way around the wildcard limitation has been adopted (with a tiny amount of editing) from \begin_inset LatexCommand \url[wget manual page]{http://www.lns.cornell.edu/public/COMP/info/wget/wget_7.html} \end_inset , see [9] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset \layout Standard This will download (recursively), to a depth \begin_inset LatexCommand \index{depth} \end_inset of one, in other words in the current \begin_inset LatexCommand \index{current} \end_inset directory \begin_inset LatexCommand \index{directory} \end_inset and not below that. This command will ignore references \begin_inset LatexCommand \index{references} \end_inset to the parent \begin_inset LatexCommand \index{parent} \end_inset directory, \begin_inset LatexCommand \index{directory} \end_inset and downloads \begin_inset LatexCommand \index{downloads} \end_inset anything that ends in \begin_inset Quotes eld \end_inset .gif \begin_inset Quotes erd \end_inset . If you wanted to download say, anything that ends \begin_inset LatexCommand \index{ends} \end_inset with \begin_inset Quotes eld \end_inset .pdf \begin_inset Quotes erd \end_inset as well than add \begin_inset LatexCommand \index{add} \end_inset a \emph on -A.pdf \emph default \begin_inset LatexCommand \index{-A} \end_inset before the website \begin_inset LatexCommand \index{website} \end_inset address. Simply change \begin_inset LatexCommand \index{change} \end_inset the website \begin_inset LatexCommand \index{website} \end_inset address and the type of file being downloaded \begin_inset LatexCommand \index{downloaded} \end_inset to download something else. Note that doing \emph on -A.gif \emph default is the same as doing \emph on -A \begin_inset Quotes eld \end_inset *.gif \emph default \begin_inset Quotes erd \end_inset (double quotes \begin_inset LatexCommand \index{quotes} \end_inset only, single quotes \begin_inset LatexCommand \index{quotes} \end_inset will not work). \layout Standard \emph on wget \emph default has many more options refer to the examples section of the manual page, \begin_inset LatexCommand \index{page} \end_inset this tool is very well documented. \layout SGML \layout SGML Alternative website downloaders \layout SGML You may like to try alternatives like httrack \begin_inset LatexCommand \index{httrack} \end_inset . A full GUI website downloader written in python and available for GNU/Linux \layout SGML \end_deeper \layout Description curl \begin_inset LatexCommand \index{curl} \end_inset \emph on curl \emph default is another remote \begin_inset LatexCommand \index{remote} \end_inset downloader. \begin_inset LatexCommand \index{downloader} \end_inset This remote \begin_inset LatexCommand \index{remote} \end_inset downloader \begin_inset LatexCommand \index{downloader} \end_inset is designed \begin_inset LatexCommand \index{designed} \end_inset to work without user interaction and supports \begin_inset LatexCommand \index{supports} \end_inset a variety \begin_inset LatexCommand \index{variety} \end_inset of protocols, \begin_inset LatexCommand \index{protocols} \end_inset can upload/download and has a large number of tricks/work-arounds for various things. It can access \begin_inset LatexCommand \index{access} \end_inset dictionary \begin_inset LatexCommand \index{dictionary} \end_inset servers \begin_inset LatexCommand \index{servers} \end_inset (dict), ldap \begin_inset LatexCommand \index{ldap} \end_inset servers, ftp, http, \begin_inset LatexCommand \index{http} \end_inset gopher, \begin_inset LatexCommand \index{gopher} \end_inset see the manual \begin_inset LatexCommand \index{manual} \end_inset page for full \begin_inset LatexCommand \index{full} \end_inset details. \begin_inset LatexCommand \index{details} \end_inset \begin_deeper \layout Standard To access \begin_inset LatexCommand \index{access} \end_inset the full \begin_inset LatexCommand \index{full} \end_inset manual (which is huge) for this command type: \layout Code curl -M \begin_inset LatexCommand \index{-M} \end_inset \layout Standard For general \begin_inset LatexCommand \index{general} \end_inset usage you can use it like \emph on wget \emph default . You can also login \begin_inset LatexCommand \index{login} \end_inset using a user name by using the \emph on -u \begin_inset LatexCommand \index{-u} \end_inset \emph default option and typing your username \begin_inset LatexCommand \index{username} \end_inset and password like this: \layout Code curl -u username:password http://www.placetodownload/file \layout Standard To upload \begin_inset LatexCommand \index{upload} \end_inset using ftp \begin_inset LatexCommand \index{ftp} \end_inset you the \emph on -T \begin_inset LatexCommand \index{-T} \end_inset \emph default option: \begin_inset LatexCommand \index{option} \end_inset \layout Code curl -T file_name ftp://ftp.uploadsite.com \layout Standard To continue a file use the \emph on -C \begin_inset LatexCommand \index{-C} \end_inset \emph default option: \layout Code curl -C - -o file http://www.site.com \end_deeper \layout Section Remote Administration Related \begin_inset LatexCommand \label{remote-administration} \end_inset \layout Description ssh \begin_inset LatexCommand \index{ssh} \end_inset Secure shell, \begin_inset LatexCommand \index{secure shell} \end_inset remotely \begin_inset LatexCommand \index{remotely} \end_inset login \begin_inset LatexCommand \index{login} \end_inset on a machine running \begin_inset LatexCommand \index{running} \end_inset the \emph on sshd \emph default daemon. \begin_inset LatexCommand \index{daemon} \end_inset Once you are logged \begin_inset LatexCommand \index{logged} \end_inset in you have a secure shell and are able \begin_inset LatexCommand \index{able} \end_inset to execute \begin_inset LatexCommand \index{execute} \end_inset various commands on that computer \begin_inset LatexCommand \index{computer} \end_inset such as copy \begin_inset LatexCommand \index{copy} \end_inset files, reboot the computer, just like it was your own GNU/Linux PC. \begin_inset LatexCommand \index{PC} \end_inset \begin_deeper \layout Standard Or you can use \emph on ssh \emph default with a full hostname \begin_inset LatexCommand \index{hostname} \end_inset to connect \begin_inset LatexCommand \index{connect} \end_inset to a remote \begin_inset LatexCommand \index{remote} \end_inset machine (as in across the internet). \layout Standard Examples: \layout Code ssh hostname \layout Standard Connect to a remote \begin_inset LatexCommand \index{remote} \end_inset system with your current username, you will obviously need the password of the user on the other machine. \layout Code ssh username@hostname \layout Standard Connect to a remote \begin_inset LatexCommand \index{remote} \end_inset system with your a different \begin_inset LatexCommand \index{different} \end_inset username, you will obviously need the password \begin_inset LatexCommand \index{password} \end_inset of the user on the other machine. \end_deeper \layout Description scp \begin_inset LatexCommand \index{scp} \end_inset Secure copy, \begin_inset LatexCommand \index{secure copy} \end_inset part \begin_inset LatexCommand \index{part} \end_inset of the ssh \begin_inset LatexCommand \index{ssh} \end_inset package. \begin_inset LatexCommand \index{package} \end_inset Allows you to copy files from one computer to another computer, use \emph on -r \begin_inset LatexCommand \index{-r} \end_inset \emph default to copy recursively (copy entire directories \begin_inset LatexCommand \index{directories} \end_inset and subdirectories). \begin_deeper \layout Standard \emph on scp \emph default 's syntax \begin_inset LatexCommand \index{syntax} \end_inset is always \layout Code scp machineToBeCopiedFrom machineToBeCopiedTo \layout Standard Where either machine can be a local \begin_inset LatexCommand \index{local} \end_inset directory (on the current filesystem \begin_inset LatexCommand \index{filesystem} \end_inset /) or a remote \begin_inset LatexCommand \index{remote} \end_inset machine. Remote machines are usually \emph on machinesFullName:/directory \emph default (if you omit \begin_inset LatexCommand \index{omit} \end_inset the directory part it will just assume the home \begin_inset LatexCommand \index{home} \end_inset directory of the username you are logging \begin_inset LatexCommand \index{logging} \end_inset in with). \layout Standard The example below copies \begin_inset LatexCommand \index{copies} \end_inset all files from the current directory (not including \begin_inset LatexCommand \index{including} \end_inset any directories), the command will login \begin_inset LatexCommand \index{login} \end_inset to \begin_inset Quotes eld \end_inset new \begin_inset Quotes erd \end_inset using the username of the person \begin_inset LatexCommand \index{person} \end_inset currently logged in on the local \begin_inset LatexCommand \index{local} \end_inset computer, the files will be copied to the root \begin_inset LatexCommand \index{root} \end_inset directory of the remote \begin_inset LatexCommand \index{remote} \end_inset computer called \begin_inset Quotes eld \end_inset new \begin_inset Quotes erd \end_inset (which is probably \begin_inset LatexCommand \index{probably} \end_inset on the LAN): \layout Code scp * new:/ \layout Standard You could also copy files from another computer to another computer. Let's say you are on a computer called \begin_inset Quotes eld \end_inset p100 \begin_inset Quotes erd \end_inset . And you want to copy files (and directories) from \begin_inset Quotes eld \end_inset hp166 \begin_inset Quotes erd \end_inset (in the /tmp directory and anything below that) to \begin_inset Quotes eld \end_inset new \begin_inset Quotes erd \end_inset and put the files in new's temporary \begin_inset LatexCommand \index{temporary} \end_inset directory. You could do: \layout Code scp -r hp166:/tmp new:/tmp \layout Standard Assuming you were logged in as \begin_inset Quotes eld \end_inset fred \begin_inset Quotes erd \end_inset you would need passwords \begin_inset LatexCommand \index{passwords} \end_inset for user \begin_inset Quotes eld \end_inset fred \begin_inset Quotes erd \end_inset on the computers hp166 and new. \begin_inset LatexCommand \index{new} \end_inset Add \begin_inset LatexCommand \index{Add} \end_inset an \emph on user_name@ \emph default before the computer name to login \begin_inset LatexCommand \index{login} \end_inset under a different user name. \layout Standard For example to perform \begin_inset LatexCommand \index{perform} \end_inset the above command with user \begin_inset Quotes eld \end_inset root \begin_inset Quotes erd \end_inset on hp166 \begin_inset LatexCommand \index{hp166} \end_inset and \begin_inset Quotes eld \end_inset anon \begin_inset Quotes erd \end_inset on new \begin_inset LatexCommand \index{new} \end_inset you would type: \layout Code scp -r root@hp166:/tmp anon@new:/tmp \layout Standard To copy from a remote \begin_inset LatexCommand \index{remote} \end_inset machine to a local \begin_inset LatexCommand \index{local} \end_inset computer \begin_inset LatexCommand \index{computer} \end_inset you simply do things in reverse: \begin_inset LatexCommand \index{reverse} \end_inset \layout Code scp remoteMachine:/mystuff/* . \layout Standard This will copy files on the remote \begin_inset LatexCommand \index{remote} \end_inset machine in the directory \begin_inset Quotes eld \end_inset mystuff \begin_inset Quotes erd \end_inset to your local \begin_inset LatexCommand \index{local} \end_inset computer. \layout SGML \layout SGML Remote Machines \layout SGML Please note that when working with a remote machine you need to have a : (colon) after the machine name even if you want the files in their home directory. Otherwise the command will fail. \layout SGML \layout Standard \begin_inset Note collapsed false \layout Standard I really only know the s* commands from open-ssh, does anyone have other suggestions? (sftp added) rync added. \layout Standard scp under this section or backup section? if its moved then its not with the other s* commands. \end_inset \end_deeper \layout Description sftp \begin_inset LatexCommand \index{sftp} \end_inset Secure ftp, \begin_inset LatexCommand \index{secure ftp} \end_inset another part \begin_inset LatexCommand \index{part} \end_inset of the ssh \begin_inset LatexCommand \index{ssh} \end_inset package. \begin_inset LatexCommand \index{package} \end_inset This command is similar to ftp but uses an encrypted \begin_inset LatexCommand \index{encrypted} \end_inset tunnel \begin_inset LatexCommand \index{tunnel} \end_inset to connect to an ftp server \begin_inset LatexCommand \index{server} \end_inset and is therefore more \begin_inset LatexCommand \index{more} \end_inset secure \begin_inset LatexCommand \index{secure} \end_inset than just plain \begin_inset LatexCommand \index{plain} \end_inset \emph on ftp \emph default . \begin_deeper \layout Standard The command usage is very similar to \emph on ftp \emph default (the command-line tool), \emph on sftp \emph default (once running) uses commands such as \emph on help \begin_inset LatexCommand \index{help} \end_inset \emph default (for help), \emph on put \emph default (send files to the server), \emph on get \emph default (download files from the server) and various others, refer \begin_inset LatexCommand \index{refer} \end_inset to the manual page and internal \begin_inset LatexCommand \index{internal} \end_inset documentation \begin_inset LatexCommand \index{documentation} \end_inset for further details. \layout SGML \layout SGML Graphical programs \layout SGML Sometimes its easier to manage files with a GUI, many of these programs do have good GUI equivalents, try searching the internet or sites like \begin_inset LatexCommand \url[Sourceforge]{http://sourceforge.net} \end_inset \begin_inset LatexCommand \index{Sourceforge} \end_inset or \begin_inset LatexCommand \url[Freshmeat.]{http://freshmeat.net} \end_inset \begin_inset LatexCommand \index{Freshmeat.} \end_inset \layout SGML \end_deeper \layout Chapter Security \begin_inset LatexCommand \label{Security} \end_inset \layout Standard The security \begin_inset LatexCommand \index{security} \end_inset chapter is designed \begin_inset LatexCommand \index{designed} \end_inset to give the user a very basic \begin_inset LatexCommand \index{basic} \end_inset level \begin_inset LatexCommand \index{level} \end_inset of understanding of security \begin_inset LatexCommand \index{security} \end_inset within the GNU/Linux operating \begin_inset LatexCommand \index{operating} \end_inset system. This chapter also has information \begin_inset LatexCommand \index{information} \end_inset on the UNIX \begin_inset LatexCommand \index{UNIX} \end_inset system style file permissions \begin_inset LatexCommand \index{permissions} \end_inset used on most GNU/Linux machines. \begin_inset LatexCommand \index{machines} \end_inset \layout Standard More comprehensive \begin_inset LatexCommand \index{comprehensive} \end_inset guides can be found \begin_inset LatexCommand \index{found} \end_inset at the \begin_inset LatexCommand \url[Linux Documentation Project]{http://www.tldp.org} \end_inset \begin_inset LatexCommand \index{Linux Documentation Project} \end_inset , such as the \begin_inset LatexCommand \url[Linux Security howto]{http://www.tldp.org/HOWTO/Security-HOWTO/} \end_inset \begin_inset LatexCommand \index{Linux Security howto} \end_inset authored \begin_inset LatexCommand \index{authored} \end_inset by Kevin Fenzi \begin_inset LatexCommand \index{Kevin Fenzi} \end_inset and Dave Wreski. \begin_inset LatexCommand \index{Dave Wreski} \end_inset \layout Standard \added_space_bottom medskip There are also sites \begin_inset LatexCommand \index{sites} \end_inset such as \begin_inset LatexCommand \url[Linux Security]{http://www.linuxsecurity.com} \end_inset . \begin_inset LatexCommand \index{Linux Security} \end_inset If your looking \begin_inset LatexCommand \index{looking} \end_inset for a program \begin_inset LatexCommand \index{program} \end_inset to assist \begin_inset LatexCommand \index{assist} \end_inset in locking \begin_inset LatexCommand \index{locking} \end_inset down your operating system you may want to check \begin_inset LatexCommand \index{check} \end_inset \begin_inset LatexCommand \url[Bastille Linux]{http://www.bastille-linux.org} \end_inset \begin_inset LatexCommand \index{Bastille Linux} \end_inset that runs on RPM \begin_inset LatexCommand \index{RPM} \end_inset based distributions \begin_inset LatexCommand \index{distributions} \end_inset (Redhat/Mandriva/SuSE). \layout Description \noindent Changing\SpecialChar ~ root's\SpecialChar ~ password \begin_inset LatexCommand \index{root's password} \end_inset This trick \begin_inset LatexCommand \index{trick} \end_inset works well if you have forgotten \begin_inset LatexCommand \index{forgotten} \end_inset your superuser \begin_inset LatexCommand \index{superuser} \end_inset password, type \emph on linux single \emph default at a LILO/Grub prompt. \begin_inset LatexCommand \index{prompt} \end_inset Then \emph on passwd \emph default once the system has started \begin_inset LatexCommand \index{started} \end_inset and you are at a console. \begin_inset LatexCommand \index{console} \end_inset \begin_deeper \layout Description \noindent Grub: If you are using grub \begin_inset LatexCommand \index{grub} \end_inset go to the relevant \begin_inset LatexCommand \index{relevant} \end_inset line (the one with the kernel \begin_inset LatexCommand \index{kernel} \end_inset and various options) then press \begin_inset LatexCommand \index{press} \end_inset 'e' for edit \begin_inset LatexCommand \index{edit} \end_inset and add \begin_inset LatexCommand \index{add} \end_inset \begin_inset Quotes eld \end_inset single \begin_inset Quotes erd \end_inset on to the end \begin_inset LatexCommand \index{end} \end_inset of the lines \begin_inset LatexCommand \index{section} \end_inset that boot \begin_inset LatexCommand \index{boots} \end_inset the kernel. \begin_inset LatexCommand \index{kernel} \end_inset Then hit \begin_inset LatexCommand \index{hit} \end_inset [Enter] and press \begin_inset LatexCommand \index{press} \end_inset 'b' (to boot). \layout Description \noindent Lilo: If you are using lilo \begin_inset LatexCommand \index{lilo} \end_inset press escape \begin_inset LatexCommand \index{escape} \end_inset and type \begin_inset Quotes eld \end_inset linux \begin_inset LatexCommand \index{linux} \end_inset single \begin_inset Quotes erd \end_inset and then hit \begin_inset LatexCommand \index{hit} \end_inset [Enter] to boot. \begin_inset LatexCommand \index{boot} \end_inset \layout SGML \noindent \layout SGML \noindent Security Warning \layout SGML \noindent \layout SGML \noindent This is also a basic security hazard if you have others using your computer and security is a concern, you may like to add a password to your LILO or Grub prompt to stop this from being done. \layout SGML \noindent \layout SGML \noindent \end_deeper \layout Standard \noindent \begin_inset Note collapsed false \layout Standard maybe I should work out how\SpecialChar \ldots{} --doesn't seem to be easy though! \end_inset \layout Description \noindent umask The umask \begin_inset LatexCommand \index{umask} \end_inset is a value \begin_inset LatexCommand \index{value} \end_inset set \begin_inset LatexCommand \index{set} \end_inset by the shell. \begin_inset LatexCommand \index{shell} \end_inset It controls \begin_inset LatexCommand \index{controls} \end_inset the default \begin_inset LatexCommand \index{default} \end_inset permissions of any file created during that shell \begin_inset LatexCommand \index{shell} \end_inset session. \begin_inset LatexCommand \index{session} \end_inset This information is inherited from the shell's parent \begin_inset LatexCommand \index{parent} \end_inset and is normally set in some configuration \begin_inset LatexCommand \index{configuration} \end_inset file by the root user (in my case /etc/profile \begin_inset LatexCommand \index{/etc/profile} \end_inset ). \begin_deeper \layout Standard \noindent umask has an unusual way of doing things \SpecialChar \ldots{} to set the umask you must describe \begin_inset LatexCommand \index{describe} \end_inset file permissions \begin_inset LatexCommand \index{file permissions} \end_inset by saying what will be disabled. \begin_inset LatexCommand \index{disabled} \end_inset \layout Standard \noindent You can do this by doing 777 minus \begin_inset LatexCommand \index{minus} \end_inset the file permissions you want. Note that \emph on umask \emph default works with numbers \begin_inset LatexCommand \index{numbers} \end_inset only, for an explanation \begin_inset LatexCommand \index{explanation} \end_inset please see, \begin_inset LatexCommand \ref{file-permissions} \end_inset \layout Standard \noindent For example: \layout Standard \noindent You want the default during a particular shell session \begin_inset LatexCommand \index{default} \end_inset to be equivalent \begin_inset LatexCommand \index{equivalent} \end_inset to \emph on chmod \begin_inset LatexCommand \index{chmod} \end_inset 750 \emph default (user has r/w/x, group \begin_inset LatexCommand \index{group} \end_inset has r/x and other has no permissions), then the command you would use would be: \layout Code \noindent umask 027 \end_deeper \layout Section \noindent Some basic Security Tools \begin_inset LatexCommand \label{some-basic-security-tools} \end_inset \layout Standard \noindent \begin_inset Note collapsed false \layout Standard is cksum superseeded by md5sum? --possibly remove this \layout Description cksum Compute the CRC ( \begin_inset Quotes eld \end_inset cyclic redundancy check \begin_inset Quotes erd \end_inset ) for file \emph on \shape italic \begin_inset Quotes eld \end_inset file_name \begin_inset Quotes erd \end_inset \shape default \emph default to verify it's integrity, used as both a security check (if it doesn't match the file's being tampered with) or can be used to check if the file is corrupted or not. \begin_deeper \layout Standard Command syntax: \layout Code cksum file_name \end_inset \layout Description \noindent md5sum \begin_inset LatexCommand \index{md5sum} \end_inset Compute an md5 \begin_inset LatexCommand \index{md5} \end_inset checksum (128-bit) for file \begin_inset Quotes eld \end_inset file_name \begin_inset Quotes erd \end_inset to verify \begin_inset LatexCommand \index{verify} \end_inset it's integrity. \begin_inset LatexCommand \index{integrity} \end_inset You normally use the \begin_inset Quotes eld \end_inset md5sum -c \begin_inset Quotes erd \end_inset \begin_inset LatexCommand \index{-c} \end_inset option \begin_inset LatexCommand \index{option} \end_inset to check \begin_inset LatexCommand \index{check} \end_inset against a given file (often with a \begin_inset Quotes eld \end_inset .asc \begin_inset Quotes erd \end_inset extention) to check \begin_inset LatexCommand \index{check} \end_inset whether the various files are correct, \begin_inset LatexCommand \index{correct} \end_inset this comes in handy \begin_inset LatexCommand \index{handy} \end_inset when downloading \begin_inset LatexCommand \index{downloading} \end_inset isos as the checking \begin_inset LatexCommand \index{checking} \end_inset is automated \begin_inset LatexCommand \index{automated} \end_inset for you. \begin_deeper \layout Standard \noindent Command syntax: \layout Code md5sum file_name \end_deeper \layout Description \noindent mkpasswd\SpecialChar ~ -l\SpecialChar ~ 10 This command will make a random \begin_inset LatexCommand \index{random} \end_inset password of length \begin_inset LatexCommand \index{length} \end_inset ten characters. \begin_inset LatexCommand \index{characters} \end_inset This password \begin_inset LatexCommand \index{password} \end_inset generator \begin_inset LatexCommand \index{generator} \end_inset creates passwords \begin_inset LatexCommand \index{passwords} \end_inset that are designed \begin_inset LatexCommand \index{designed} \end_inset to be hard to guess. There are similar alternatives \begin_inset LatexCommand \index{alternatives} \end_inset to this program scattered \begin_inset LatexCommand \index{scattered} \end_inset around the internet. \begin_inset LatexCommand \index{internet} \end_inset \layout Section File Permissions \begin_inset LatexCommand \label{file-permissions} \end_inset \layout Standard \noindent Use \emph on ls \begin_inset LatexCommand \index{ls} \end_inset -l \emph default \begin_inset LatexCommand \index{-l} \end_inset to see the permissions of files (list-long). They will appear like this, note that I have added spaces \begin_inset LatexCommand \index{spaces} \end_inset between permissions to make it easier to read: \layout Standard Where: r \begin_inset LatexCommand \index{r} \end_inset = read, w \begin_inset LatexCommand \index{w} \end_inset = write, \begin_inset LatexCommand \index{write} \end_inset x = execute \begin_inset LatexCommand \index{execute} \end_inset \layout SGML \layout SGML - rwx rw- r-- 1 newuser newuser \layout SGML \noindent typeownergroupothers \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML This number is the number of hard links (pointers) to this file. You can use \emph on ln \emph default to create another hard-link to the file. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML This is the type of file. '-' means a regular file, 'd' would mean a directory, 'l' would mean a link. There are also other types such as 'c' for character device and 'b' for block device (found in the /dev/ directory). \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML These are the permissions for the owner of the file (the user who created the file). \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML These are the permissions for the group, any users who belong is the same group as the user who created the file will have these permissions. \layout SGML \layout SGML \layout SGML \layout SGML \layout SGML These are the permissions for everyone else. Any user who is outside the group will have these permissions to the file. \layout SGML \layout SGML \layout SGML \layout Standard \noindent The two names at the end are the username \begin_inset LatexCommand \index{username} \end_inset and group \begin_inset LatexCommand \index{group} \end_inset respectively. \begin_inset LatexCommand \index{respectively} \end_inset \layout Description \noindent chmod \begin_inset LatexCommand \index{chmod} \end_inset Change \begin_inset LatexCommand \index{Change} \end_inset file access \begin_inset LatexCommand \index{file access} \end_inset permissions for a file(s). \begin_deeper \layout Standard \noindent There are two methods \begin_inset LatexCommand \index{methods} \end_inset to change \begin_inset LatexCommand \index{change} \end_inset permissions using \emph on chmod \emph default ; letters \begin_inset LatexCommand \index{letters} \end_inset or numbers. \begin_inset LatexCommand \index{numbers} \end_inset \layout Description Letters\SpecialChar ~ Method: use a + or - (plus or minus \begin_inset LatexCommand \index{minus} \end_inset sign) to add \begin_inset LatexCommand \index{add} \end_inset or remove \begin_inset LatexCommand \index{remove} \end_inset permissions for a file respectively. Use an equals \begin_inset LatexCommand \index{equals} \end_inset sign =, to specify \begin_inset LatexCommand \index{specify} \end_inset new \begin_inset LatexCommand \index{new} \end_inset permissions and remove \begin_inset LatexCommand \index{remove} \end_inset the old \begin_inset LatexCommand \index{old} \end_inset ones for the particular \begin_inset LatexCommand \index{particular} \end_inset type of user(s). \begin_deeper \layout Standard You can use \emph on chmod \begin_inset LatexCommand \index{chmod} \end_inset letter \emph default where the letters \begin_inset LatexCommand \index{letters} \end_inset are: \layout Standard \emph on a \emph default (all (everyone)) \emph on , u \emph default (user) \emph on , \emph default \emph on g \emph default (group) and \emph on o \emph default (other). \end_deeper \layout Standard Examples: \layout Code chmod u+rw somefile \layout Standard This would give the user read and write \begin_inset LatexCommand \index{write} \end_inset permission. \layout Code chmod o-rwx somefile \layout Standard This will remove \begin_inset LatexCommand \index{remove} \end_inset read/write/execute permissions from other users (doesn't include \begin_inset LatexCommand \index{include} \end_inset users within your group). \layout Code chmod a+r \emph on \emph default somefile \layout Standard This will give everyone \begin_inset LatexCommand \index{everyone} \end_inset read permission \begin_inset LatexCommand \index{permission} \end_inset for the file. \layout Code chmod a=rx somefile \layout Standard This would give everyone execute and read permission to the file, if anyone had write \begin_inset LatexCommand \index{write} \end_inset permission it would be removed. \layout Description Numbers\SpecialChar ~ Method: you can also use numbers \begin_inset LatexCommand \index{numbers} \end_inset (instead of letters) to change \begin_inset LatexCommand \index{change} \end_inset file permissions. Where: \begin_deeper \layout Standard r \begin_inset LatexCommand \index{r} \end_inset (read) = 4 \hfill w \begin_inset LatexCommand \index{w} \end_inset (write) = 2 \hfill x (execute) = 1 \end_deeper \layout Standard \noindent Numbers \begin_inset LatexCommand \index{Numbers} \end_inset can be added together so you can specify read/write/execute permissions; read+write = 6, read+execute = 5, read+write+execute = 7 \layout Standard \noindent Examples: \layout Code \noindent chmod 777 somefile \layout Standard \noindent This would give everyone read/write/execute permission on \begin_inset Quotes eld \end_inset this_file \begin_inset Quotes erd \end_inset . The first number \begin_inset LatexCommand \index{number} \end_inset is user, second is group \begin_inset LatexCommand \index{group} \end_inset and third is everyone else (other). \layout Code chmod 521 somefile \layout Standard This would give the user read and execute \begin_inset LatexCommand \index{execute} \end_inset permission, and the group \begin_inset LatexCommand \index{group} \end_inset write \begin_inset LatexCommand \index{write} \end_inset permission \begin_inset LatexCommand \index{permission} \end_inset (but not read permission!) and everyone else execute \begin_inset LatexCommand \index{execute} \end_inset permission. (Note that it's just an example, settings like that don't really make sense\SpecialChar \ldots{} ). \end_deeper \layout Description \noindent chown \begin_inset LatexCommand \index{chown} \end_inset Changes the ownership \begin_inset LatexCommand \index{ownership} \end_inset rights \begin_inset LatexCommand \index{rights} \end_inset of a file (hence the name 'chown' - change owner \begin_inset LatexCommand \index{change owner} \end_inset ). This program can only be used by root. \begin_deeper \layout Standard \noindent Use the \emph on -R \begin_inset LatexCommand \index{-R} \end_inset \emph default option to change \begin_inset LatexCommand \index{change} \end_inset things recursively, \begin_inset LatexCommand \index{recursively} \end_inset in other words, all matching \begin_inset LatexCommand \index{matching} \end_inset files including \begin_inset LatexCommand \index{including} \end_inset those in subdirectories. \begin_inset LatexCommand \index{subdirectories} \end_inset \layout Standard \noindent Command syntax: \layout Code \noindent chown owner:group the_file_name \end_deeper \layout Description \noindent sticky\SpecialChar ~ bit \begin_inset LatexCommand \index{bit} \end_inset Only the person \begin_inset LatexCommand \index{person} \end_inset who \begin_inset LatexCommand \index{who} \end_inset created the file within a directory may delete \begin_inset LatexCommand \index{delete} \end_inset it, even if other people \begin_inset LatexCommand \index{people} \end_inset have write \begin_inset LatexCommand \index{write} \end_inset permission. You can turn \begin_inset LatexCommand \index{turn} \end_inset it on by typing: \begin_deeper \layout Code chmod 1700 \emph on \emph default somedirectory \family roman (where 1 = sticky bit) \layout Standard or (where \emph on t \emph default represents \begin_inset LatexCommand \index{represents} \end_inset the sticky \begin_inset LatexCommand \index{sticky} \end_inset bit) \layout Code chmod +t somedirectory \layout Standard To turn \begin_inset LatexCommand \index{turn} \end_inset it off \begin_inset LatexCommand \index{off} \end_inset you would need to type: \layout Code chmod 0700 somefile \family roman (where the zero would mean no sticky bit) \layout Standard or (where \emph on t \emph default represents \begin_inset LatexCommand \index{represents} \end_inset the sticky \begin_inset LatexCommand \index{sticky} \end_inset bit) \layout Code chmod -t somefile \begin_inset LatexCommand \index{-t} \end_inset \layout Standard Note that the permissions \begin_inset LatexCommand \index{permissions} \end_inset aren't relevant \begin_inset LatexCommand \index{relevant} \end_inset in the numbers \begin_inset LatexCommand \index{numbers} \end_inset example, only the first number (1 = on, 0 = off). \layout Standard An example of a sticky \begin_inset LatexCommand \index{sticky} \end_inset directory is usually /tmp \end_deeper \layout Description \noindent \series bold suid \series default Allow SUID/SGID (switch user ID/switch group \begin_inset LatexCommand \index{group} \end_inset ID) access. \begin_inset LatexCommand \index{access} \end_inset You would normally use \emph on chmod \emph default to turn \begin_inset LatexCommand \index{turn} \end_inset this on or off \begin_inset LatexCommand \index{off} \end_inset for a particular file, suid \begin_inset LatexCommand \index{suid} \end_inset is generally considered a security \begin_inset LatexCommand \index{security} \end_inset hazard so be careful \begin_inset LatexCommand \index{careful} \end_inset when using this. \begin_deeper \layout Standard \noindent Example: \layout Code chmod u+s file_name \layout Standard This will give everyone permission to execute \begin_inset LatexCommand \index{execute} \end_inset the file with the permissions of the user who set the +s switch. \begin_inset LatexCommand \index{switch} \end_inset \layout SGML \layout SGML \layout SGML Security Hazard \layout SGML \layout SGML \layout SGML This is obviously a security hazard. You should avoid using the suid flag unless necessary. \layout SGML \layout SGML \end_deeper \layout Standard \begin_inset Note collapsed false \layout Standard this can all be done with numbers, the first number 0777 (the 0 is the number which controls this, there are numbers 0-7 which do stuff. See the ibm developerworks tutorial, I think its the third one on LPI 101 certification. \end_inset \layout Description \noindent chattr \emph on \begin_inset LatexCommand \index{chattr} \end_inset \emph default Change file system attributes (works on ext2fs and possibly others\SpecialChar \ldots{} ). Use the \emph on -R \emph default option to change \begin_inset LatexCommand \index{change} \end_inset files recursively, \emph on chattr \emph default has a large number \begin_inset LatexCommand \index{number} \end_inset of attributes \begin_inset LatexCommand \index{attributes} \end_inset which can be set \begin_inset LatexCommand \index{set} \end_inset on a file, read the manual \begin_inset LatexCommand \index{manual} \end_inset page \begin_inset LatexCommand \index{page} \end_inset for further information. \begin_deeper \layout Standard \noindent Example: \layout Code \noindent chattr +i /sbin/lilo.conf \begin_inset Foot collapsed false \layout Standard This example and tiny parts of the explanation have been taken from the Linux Online Classroom, see [4] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset \layout Standard \noindent This sets \begin_inset LatexCommand \index{sets} \end_inset the 'immutable' flag \begin_inset LatexCommand \index{flag} \end_inset on a file. Use a '+' to add \begin_inset LatexCommand \index{add} \end_inset attributes \begin_inset LatexCommand \index{attributes} \end_inset and a '-' to take them away. The +i will prevent \begin_inset LatexCommand \index{prevent} \end_inset any changes (accidental or otherwise) to the \begin_inset Quotes eld \end_inset lilo.conf \begin_inset Quotes erd \end_inset file. If you wish to modify \begin_inset LatexCommand \index{modify} \end_inset the lilo.conf file you will need to unset \begin_inset LatexCommand \index{unset} \end_inset the immutable \begin_inset LatexCommand \index{immutable} \end_inset flag: \begin_inset LatexCommand \index{flag} \end_inset \emph on chattr -i \emph default . \begin_inset LatexCommand \index{-i} \end_inset Note some flags \begin_inset LatexCommand \index{flags} \end_inset can only be used by root; \begin_inset LatexCommand \index{root} \end_inset \emph on -i \emph default , \emph on -a \emph default and probably \begin_inset LatexCommand \index{probably} \end_inset many others. \layout Standard \noindent Note there are many different \begin_inset LatexCommand \index{different} \end_inset attributes \begin_inset LatexCommand \index{attributes} \end_inset that chattr can change, \begin_inset LatexCommand \index{change} \end_inset here are a few more which may be useful: \layout Itemize \series bold A \begin_inset LatexCommand \index{A} \end_inset \series default (no Access time) --- if a file or directory has this attribute set, whenever it is accessed, \begin_inset LatexCommand \index{accessed} \end_inset either for reading \begin_inset LatexCommand \index{reading} \end_inset of for writing, \begin_inset LatexCommand \index{writing} \end_inset it's last \begin_inset LatexCommand \index{last} \end_inset access time \begin_inset LatexCommand \index{access time} \end_inset will not be updated. \begin_inset LatexCommand \index{updated} \end_inset This can be useful, for example, on files or directories \begin_inset LatexCommand \index{directories} \end_inset which are very often accessed \begin_inset LatexCommand \index{accessed} \end_inset for reading, especially since this parameter is the only one which changes on an inode \begin_inset LatexCommand \index{inode} \end_inset when it's opened. \begin_inset LatexCommand \index{opened} \end_inset \layout Itemize \series bold a \begin_inset LatexCommand \index{a} \end_inset \series default (append only) --- if a file has this attribute \begin_inset LatexCommand \index{attribute} \end_inset set and is open for writing, the only operation possible will be to append \begin_inset LatexCommand \index{append} \end_inset data \begin_inset LatexCommand \index{data} \end_inset to it's previous contents. For a directory, this means that you can only add \begin_inset LatexCommand \index{add} \end_inset files to it, but not rename \begin_inset LatexCommand \index{rename} \end_inset or delete any existing \begin_inset LatexCommand \index{existing} \end_inset file. Only root can set or clear this attribute. \layout Itemize \series bold s \begin_inset LatexCommand \index{s} \end_inset \series default (secure deletion) --- when such a file or directory with this attribute \begin_inset LatexCommand \index{attribute} \end_inset set is deleted, \begin_inset LatexCommand \index{deleted} \end_inset the blocks \begin_inset LatexCommand \index{blocks} \end_inset it was occupying \begin_inset LatexCommand \index{occupying} \end_inset on disk \begin_inset LatexCommand \index{disk} \end_inset are written back with zeroes \begin_inset LatexCommand \index{zeroes} \end_inset (similar to using \emph on shred \emph default ). Note that this does work on the ext2, \begin_inset LatexCommand \index{ext2} \end_inset and ext3 \begin_inset LatexCommand \index{ext3} \end_inset filesystems but is unlikely to work on others (please see the documentation \begin_inset LatexCommand \index{documentation} \end_inset for the filesystem \begin_inset LatexCommand \index{filesystem} \end_inset you are using). You may also like to see \emph on shred \emph default \begin_inset LatexCommand \index{shred} \end_inset , please see \begin_inset LatexCommand \ref{Working-with-the-file-system} \end_inset \end_deeper \layout Description lsattr \begin_inset LatexCommand \index{lsattr} \end_inset (list attributes). This will list \begin_inset LatexCommand \index{list} \end_inset if whether a file has any special \begin_inset LatexCommand \index{special} \end_inset attributes (as set by chattr). Use the \emph on -R \emph default option to list recursively \begin_inset LatexCommand \index{recursively} \end_inset and try using the \emph on -d \begin_inset LatexCommand \index{-d} \end_inset \emph default option \begin_inset LatexCommand \index{option} \end_inset to list directories \begin_inset LatexCommand \index{directories} \end_inset like other files rather than listing \begin_inset LatexCommand \index{listing} \end_inset their contents. \begin_inset LatexCommand \index{contents} \end_inset \begin_deeper \layout Standard Command syntax: \layout Code lsattr \layout Standard This will list files in the current \begin_inset LatexCommand \index{current} \end_inset directory, you may also like to specify \begin_inset LatexCommand \index{specify} \end_inset a directory or a file: \layout Code lsattr /directory/or/file \end_deeper \layout Chapter Archiving Files \begin_inset LatexCommand \label{Backing-up-files} \end_inset \layout Standard The archiving \begin_inset LatexCommand \index{archiving} \end_inset files chapter provides \begin_inset LatexCommand \index{provides} \end_inset some basic \begin_inset LatexCommand \index{basic} \end_inset information \begin_inset LatexCommand \index{information} \end_inset on the simple programs \begin_inset LatexCommand \index{programs} \end_inset that you can use to archive \begin_inset LatexCommand \index{archive} \end_inset files. You will often see these programs \begin_inset LatexCommand \index{programs} \end_inset used when you try to install \begin_inset LatexCommand \index{install} \end_inset programs without using a package management \begin_inset LatexCommand \index{package management} \end_inset tool. \layout SGML \layout SGML This is not a backup guide \layout SGML Please note that while \emph on tar \emph default is useful for regular purposes, and possibly combined with bash sciprting or similar it can become useful, it is not a great program for performing real backups of data. \layout SGML You should try searching the internet if you are looking for backup programs on GNU/Linux or try \begin_inset LatexCommand \url[Sourceforge]{http://sourceforge.net} \end_inset \begin_inset LatexCommand \index{Sourceforge} \end_inset or \begin_inset LatexCommand \url[Freshmeat]{http://freshmeat.net} \end_inset \begin_inset LatexCommand \index{Freshmeat} \end_inset for programs that you can use. You may also like to see rsync \begin_inset LatexCommand \index{rsync} \end_inset , \begin_inset LatexCommand \ref{rsync} \end_inset . \layout SGML \layout Section tar (tape archiver) \begin_inset LatexCommand \label{tar} \end_inset \layout Standard Type \emph on tar \emph default then \emph on -option(s) \layout Standard Options list: \begin_inset LatexCommand \index{list} \end_inset \layout Itemize \noindent \shape italic -c \begin_inset LatexCommand \index{-c} \end_inset \shape default --- create. \layout Itemize \noindent \shape italic -v \begin_inset LatexCommand \index{-v} \end_inset \shape default --- verbose, \begin_inset LatexCommand \index{verbose} \end_inset give more output, \begin_inset LatexCommand \index{output} \end_inset show \begin_inset LatexCommand \index{show} \end_inset what files are being worked with (extracted or added). \layout Itemize \noindent \shape italic -f \begin_inset LatexCommand \index{-f} \end_inset \series bold \series default \shape default --- file (create or extract \begin_inset LatexCommand \index{extract} \end_inset from file) - should always be the last option otherwise the command will not work. \layout Itemize \noindent \shape italic -z \begin_inset LatexCommand \index{-z} \end_inset \shape default --- put the file though gzip \begin_inset LatexCommand \index{gzip} \end_inset or use gunzip \begin_inset LatexCommand \index{gunzip} \end_inset on the file first. \layout Itemize \noindent \shape italic -x \begin_inset LatexCommand \index{-x} \end_inset \shape default --- extract the files from the tarball. \begin_inset LatexCommand \index{tarball} \end_inset \layout Itemize \noindent \shape italic -p \begin_inset LatexCommand \index{-p} \end_inset \shape default --- preserves \begin_inset LatexCommand \index{preserves} \end_inset dates, \begin_inset LatexCommand \index{dates} \end_inset permissions of the original \begin_inset LatexCommand \index{original} \end_inset files. \layout Itemize \noindent \shape italic -j \begin_inset LatexCommand \index{-jj} \end_inset \shape default --- send \begin_inset LatexCommand \index{send} \end_inset archive through bzip2. \begin_inset LatexCommand \index{bzip2} \end_inset \layout Itemize \noindent --exclude=pattern \begin_inset LatexCommand \index{exclude=pattern} \end_inset --- this will stop \begin_inset LatexCommand \index{stop} \end_inset certain files from being archived \begin_inset LatexCommand \index{archived} \end_inset (using a standard wild-card \begin_inset LatexCommand \index{standard wild-card} \end_inset pattern) or a single file name. \layout Description \noindent tar\SpecialChar ~ examples \begin_deeper \layout Code tar -cvpf name_of_file.tar files_to_be_backed_up \layout Standard This would create a tape \begin_inset LatexCommand \index{tape} \end_inset archive (no compressing). \layout Code tar -zxvpf my_tar_file.tar.gz \layout Standard This would extract files (verbosely) from a gzipped \begin_inset LatexCommand \index{gzipped} \end_inset tape \begin_inset LatexCommand \index{tape} \end_inset archive. \end_deeper \layout Section rsync \begin_inset LatexCommand \label{rsync} \end_inset \layout Standard \begin_inset Note collapsed false \layout Standard rsync has good documentation no point recreating it :P \end_inset \layout Description rsync \begin_inset LatexCommand \index{rsync} \end_inset \emph on rsync \emph default is a replacement \begin_inset LatexCommand \index{replacement} \end_inset for the old \begin_inset LatexCommand \index{old} \end_inset \emph on rcp \begin_inset LatexCommand \index{rcp} \end_inset \emph default (remote-copy) command. It can use \emph on ssh \emph default for encryption \begin_inset LatexCommand \index{encryption} \end_inset and is a very flexible \begin_inset LatexCommand \index{flexible} \end_inset tool, it can copy from local \begin_inset LatexCommand \index{local} \end_inset machine \begin_inset LatexCommand \index{machine} \end_inset to local machine, from local to remote \begin_inset LatexCommand \index{remote} \end_inset (and vice-versa), and to and from rsync \begin_inset LatexCommand \index{rsync} \end_inset servers. \begin_inset LatexCommand \index{servers} \end_inset \begin_deeper \layout Standard \emph on rsync \emph default uses an advanced \begin_inset LatexCommand \index{advanced} \end_inset differencing algorithm, \begin_inset LatexCommand \index{algorithm} \end_inset so when to copies \begin_inset LatexCommand \index{copies} \end_inset or syncs \begin_inset LatexCommand \index{syncs} \end_inset something it will (a) only copy new/changed files and (b) if the files have being changed it will copy the differences \begin_inset LatexCommand \index{differences} \end_inset between the files (not the entire file). Using this method \begin_inset LatexCommand \index{method} \end_inset \emph on rsync \emph default saves \begin_inset LatexCommand \index{saves} \end_inset time \begin_inset LatexCommand \index{time} \end_inset and bandwidth. \begin_inset LatexCommand \index{bandwidth} \end_inset \layout Standard \emph on rsync \emph default also has advanced \begin_inset LatexCommand \index{advanced} \end_inset exclusion options \begin_inset LatexCommand \index{options} \end_inset similar to GNU tar. \begin_inset LatexCommand \index{tar} \end_inset \emph on rsync \emph default has a well written manual page, \begin_inset LatexCommand \index{page} \end_inset for further information \begin_inset LatexCommand \index{information} \end_inset read the \emph on rsync \emph default documentation \begin_inset LatexCommand \index{documentation} \end_inset online or type: \layout Code man rsync \layout Standard If you wish to visit \begin_inset LatexCommand \index{visit} \end_inset the rsync \begin_inset LatexCommand \index{rsync} \end_inset site you will find \begin_inset LatexCommand \index{find} \end_inset it over \begin_inset LatexCommand \url[here]{http://www.samba.org/rsync/} \end_inset \begin_inset LatexCommand \index{rsync site} \end_inset \end_deeper \layout Section Compression \begin_inset LatexCommand \label{compression} \end_inset \layout Standard There are two main compression \begin_inset LatexCommand \index{compression} \end_inset utilities \begin_inset LatexCommand \index{utilities} \end_inset used in GNU/Linux. It's normal \begin_inset LatexCommand \index{normal} \end_inset to first \begin_inset Quotes eld \end_inset tar \begin_inset Quotes erd \end_inset a bunch \begin_inset LatexCommand \index{bunch} \end_inset of files (using the \emph on tar \emph default program of course) and then compress \begin_inset LatexCommand \index{compress} \end_inset them with either \emph on bzip2 \emph default or \emph on gzip \emph default . Of course either of these tools could be used without tar, \begin_inset LatexCommand \index{tar} \end_inset although they are not designed \begin_inset LatexCommand \index{designed} \end_inset to work on more \begin_inset LatexCommand \index{more} \end_inset than one file (they use the UNIX \begin_inset LatexCommand \index{UNIX} \end_inset tools philosophy, \begin_inset LatexCommand \index{philosophy} \end_inset let \begin_inset LatexCommand \index{let} \end_inset \emph on tar \emph default group the files, they will do the compression\SpecialChar \ldots{} this simplifies their program). It's normal \begin_inset LatexCommand \index{normal} \end_inset to use \emph on tar \emph default and then use these tools on them, or use \emph on tar \emph default with the correct \begin_inset LatexCommand \index{correct} \end_inset options to use these compression \begin_inset LatexCommand \index{compression} \end_inset programs. \begin_inset LatexCommand \index{programs} \end_inset \layout Description GNU\SpecialChar ~ \series bold zip \series default \SpecialChar ~ \series bold (gzip) \series default gzip \begin_inset LatexCommand \index{gzip} \end_inset is the GNU \begin_inset LatexCommand \index{GNU} \end_inset zip \begin_inset LatexCommand \index{zip} \end_inset compression program \begin_inset LatexCommand \index{program} \end_inset and probably \begin_inset LatexCommand \index{probably} \end_inset the most common \begin_inset LatexCommand \index{common} \end_inset compression format \begin_inset LatexCommand \index{format} \end_inset on UNIX-like \begin_inset LatexCommand \index{UNIX-like} \end_inset operating systems. \begin_deeper \layout Code gzip your_tar_file.tar \layout Standard This will compress \begin_inset LatexCommand \index{compress} \end_inset a tar \begin_inset LatexCommand \index{tar} \end_inset archive \begin_inset LatexCommand \index{archive} \end_inset with GNU \begin_inset LatexCommand \index{GNU} \end_inset zip, \begin_inset LatexCommand \index{zip} \end_inset usually with a .gz \begin_inset LatexCommand \index{.gz} \end_inset extension. Gzip \begin_inset LatexCommand \index{Gzip} \end_inset can compress \begin_inset LatexCommand \index{compress} \end_inset any type of file, it doesn't have to be a tar \begin_inset LatexCommand \index{tar} \end_inset archive. \layout Code \series medium gunzip your_file.gz \series default \layout Standard This will decompress \begin_inset LatexCommand \index{decompress} \end_inset a gzipped \begin_inset LatexCommand \index{gzipped} \end_inset file, and leave the contents \begin_inset LatexCommand \index{contents} \end_inset in the current \begin_inset LatexCommand \index{current} \end_inset directory. \begin_inset LatexCommand \index{directory} \end_inset \end_deeper \layout Description bzip2 bzip2 \begin_inset LatexCommand \index{bzip2} \end_inset is a newer \begin_inset LatexCommand \index{newer} \end_inset compression program taht offers superior \begin_inset LatexCommand \index{superior} \end_inset compression to gzip \begin_inset LatexCommand \index{gzip} \end_inset at the cost \begin_inset LatexCommand \index{cost} \end_inset of more processor \begin_inset LatexCommand \index{processor} \end_inset time. \begin_inset Note collapsed true \layout Standard I guess that could change though\SpecialChar \ldots{} \end_inset \begin_deeper \layout Code \series medium bzip2 your_tar_file.tar \layout Standard This will compress \begin_inset LatexCommand \index{compress} \end_inset a tar \begin_inset LatexCommand \index{tar} \end_inset archive with the bzip2 \begin_inset LatexCommand \index{bzip2} \end_inset compression program, usually with a .bz \begin_inset LatexCommand \index{.bz} \end_inset extension. bzip2 \begin_inset LatexCommand \index{bzip2} \end_inset can compress \begin_inset LatexCommand \index{compress} \end_inset any type of file, it doesn't have to be a tar \begin_inset LatexCommand \index{tar} \end_inset archive. \layout Code \series medium bunzip2 your_file.tar.bz2 \layout Standard This will decompress \begin_inset LatexCommand \index{decompress} \end_inset a file compressed \begin_inset LatexCommand \index{compressed} \end_inset by bzip2, \begin_inset LatexCommand \index{bzip2} \end_inset and leave the contents \begin_inset LatexCommand \index{contents} \end_inset in the current directory. \series bold \end_deeper \layout Description zipinfo \begin_inset LatexCommand \index{zipinfo} \end_inset Use \emph on zipinfo \emph default to find detailed \begin_inset LatexCommand \index{detailed} \end_inset information about a zip \begin_inset LatexCommand \index{zip} \end_inset archive (the ones usually generally used by ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset and windows, \begin_inset LatexCommand \index{windows} \end_inset for example winzip). \begin_deeper \layout Standard Command syntax: \layout Code zipinfo zip_file.zip \end_deeper \layout Description zipgrep \begin_inset LatexCommand \index{zipgrep} \end_inset Will run \begin_inset LatexCommand \index{run} \end_inset \emph on grep \emph default to look \begin_inset LatexCommand \index{look} \end_inset for files within a zip \begin_inset LatexCommand \index{zip} \end_inset file (ms-dos style, \begin_inset LatexCommand \index{style} \end_inset for example winzip) without manually \begin_inset LatexCommand \index{manually} \end_inset decompressing the file first. \begin_deeper \layout Standard Command syntax: \layout Code zipgrep pattern zip_file.zip \end_deeper \layout Description bzip2recover \begin_inset LatexCommand \index{bzip2recover} \end_inset Used to recover \begin_inset LatexCommand \index{recover} \end_inset files from a damaged \begin_inset LatexCommand \index{damaged} \end_inset bzip2 archive. \begin_inset LatexCommand \index{archive} \end_inset It simply extracts out all the working blocks \begin_inset LatexCommand \index{blocks} \end_inset as there own bzip2 \begin_inset LatexCommand \index{bzip2} \end_inset archives, \begin_inset LatexCommand \index{archives} \end_inset you can than use \emph on bzip2 -t \emph default \begin_inset LatexCommand \index{-t} \end_inset on each file to test \begin_inset LatexCommand \index{test} \end_inset the integrity \begin_inset LatexCommand \index{integrity} \end_inset of them and extract \begin_inset LatexCommand \index{extract} \end_inset the working files. \layout Description bzme \begin_inset LatexCommand \index{bzme} \end_inset Will convert \begin_inset LatexCommand \index{convert} \end_inset a file that is zipped \begin_inset LatexCommand \index{zipped} \end_inset or gzipped \begin_inset LatexCommand \index{gzipped} \end_inset to a file compressed \begin_inset LatexCommand \index{compressed} \end_inset using \emph on bzip2 \emph default . \begin_deeper \layout Standard Command syntax: \layout Code bzme filename \end_deeper \layout SGML \layout SGML Tip \layout SGML \layout SGML Both gzip and bzip2 supply tools to work within compressed files for example listing the files within the archive, running \emph on less \emph default on them, using \emph on grep \emph default to find files within the archive et cetera. \layout SGML \layout SGML \layout SGML For gzip the commands are prefixed with z, \emph on zcat, zless, zgrep \emph default . \layout SGML \layout SGML \layout SGML For bzip2 the commands are prefixed with bz, \emph on bzcat, bzless, bzgrep \emph default . \layout SGML \layout SGML \layout Chapter Graphics tools (command line based) \begin_inset LatexCommand \label{Graphics-tools} \end_inset \layout Standard The graphics \begin_inset LatexCommand \index{graphics} \end_inset tools chapter explains \begin_inset LatexCommand \index{explains} \end_inset some image \begin_inset LatexCommand \index{image} \end_inset programs \begin_inset LatexCommand \index{programs} \end_inset that can be called from the command-line. \begin_inset LatexCommand \index{command-line} \end_inset While I have found \begin_inset LatexCommand \index{found} \end_inset image programs \begin_inset LatexCommand \index{programs} \end_inset that can be used from the command-line, \begin_inset LatexCommand \index{command-line} \end_inset zgv \begin_inset LatexCommand \index{zgv} \end_inset is the only one I've ever heard of, I did not find them very useful. All the tools listed \begin_inset LatexCommand \index{listed} \end_inset use the X windowing \begin_inset LatexCommand \index{windowing} \end_inset system to work and simply run \begin_inset LatexCommand \index{run} \end_inset from the command line (so they can be scripted/automated if necessary). \layout Description \noindent montage \begin_inset LatexCommand \index{montage} \end_inset Creates a 'montage', an image created of many other images, \begin_inset LatexCommand \index{images} \end_inset arranged \begin_inset LatexCommand \index{arranged} \end_inset in a random \begin_inset LatexCommand \index{random} \end_inset fashion. \begin_deeper \layout Standard \noindent Command syntax: \layout Code montage r34.jpg r32.jpg skylines* skyline_images.miff \layout Standard The above would create a \begin_inset Quotes eld \end_inset montage \begin_inset Quotes erd \end_inset of images (it would tile \begin_inset LatexCommand \index{tile} \end_inset a certain number \begin_inset LatexCommand \index{number} \end_inset of images) into a composite \begin_inset LatexCommand \index{composite} \end_inset image called \begin_inset Quotes eld \end_inset skyline_images.miff \begin_inset Quotes erd \end_inset , you could always use \emph on display \begin_inset LatexCommand \index{display} \end_inset \emph default to view \begin_inset LatexCommand \index{view} \end_inset the image. \layout SGML \layout SGML Note \layout SGML \layout SGML Note that the images are converted to the same size (scaled) so they can be tiled together. \layout SGML \layout SGML \end_deeper \layout Description \noindent convert To convert the file format \begin_inset LatexCommand \index{format} \end_inset of an image to another image format. \emph on convert \emph default is used to change \begin_inset LatexCommand \index{change} \end_inset a files format, \begin_inset LatexCommand \index{format} \end_inset for example from a jpeg \begin_inset LatexCommand \index{jpeg} \end_inset to a bitmap \begin_inset LatexCommand \index{bitmap} \end_inset or one of many other formats. \begin_inset LatexCommand \index{formats} \end_inset \emph on convert \emph default can also manipulate \begin_inset LatexCommand \index{manipulate} \end_inset the images as well (see the man \begin_inset LatexCommand \index{man} \end_inset page \begin_inset LatexCommand \index{page} \end_inset or the ImageMagick \begin_inset LatexCommand \index{ImageMagick} \end_inset site). \begin_deeper \layout Standard \noindent Example from Jpeg \begin_inset LatexCommand \index{Jpeg} \end_inset to PNG \begin_inset LatexCommand \index{PNG} \end_inset format: \layout Code \noindent convert JPEG: thisfile.jpg PNG: thisfile.png \end_deeper \layout Description \noindent import \begin_inset LatexCommand \index{import} \end_inset Captures screen-shots \begin_inset LatexCommand \index{screen-shots} \end_inset from the X server \begin_inset LatexCommand \index{server} \end_inset and saves \begin_inset LatexCommand \index{saves} \end_inset them to a file. A screen-dump \begin_inset LatexCommand \index{screen-dump} \end_inset of what X is doing. \begin_deeper \layout Standard \noindent Command syntax: \layout Code import file_name \end_deeper \layout Description display \emph on display \emph default is used to display (output) images on the screen. \begin_inset LatexCommand \index{screen} \end_inset Once open \begin_inset LatexCommand \index{open} \end_inset you are can also perform \begin_inset LatexCommand \index{perform} \end_inset editing \begin_inset LatexCommand \index{editing} \end_inset functions and are able \begin_inset LatexCommand \index{able} \end_inset to read/write images. \begin_inset LatexCommand \index{images} \end_inset It has various interesting options \begin_inset LatexCommand \index{options} \end_inset such as the ability \begin_inset LatexCommand \index{ability} \end_inset to display \begin_inset LatexCommand \index{display} \end_inset images as a slide \begin_inset LatexCommand \index{slide} \end_inset show \begin_inset LatexCommand \index{show} \end_inset and the ability \begin_inset LatexCommand \index{ability} \end_inset to capture \begin_inset LatexCommand \index{capture} \end_inset screenshots of a single window \begin_inset LatexCommand \index{window} \end_inset on-screen. \begin_inset LatexCommand \index{on-screen} \end_inset \begin_deeper \layout Standard Command syntax (for displaying an image): \layout Code display image_name \layout Standard To display a slide \begin_inset LatexCommand \index{slide} \end_inset show \begin_inset LatexCommand \index{show} \end_inset of images, open \begin_inset LatexCommand \index{open} \end_inset the images you want possibly \begin_inset LatexCommand \index{possibly} \end_inset using a wildcard, for example: \layout Code display *.jpg \layout Standard And then click \begin_inset LatexCommand \index{click} \end_inset on the image to bring up the menu \begin_inset LatexCommand \index{menu} \end_inset and then look under the miscellaneous \begin_inset LatexCommand \index{miscellaneous} \end_inset menu \begin_inset LatexCommand \index{menu} \end_inset for the slide \begin_inset LatexCommand \index{slide} \end_inset show \begin_inset LatexCommand \index{show} \end_inset option. \layout SGML \layout SGML Speed Warning \layout SGML \layout SGML Be careful when opening multiple large sized images (especially on a slow machine) and putting the slide show on a small delay between image changes. Your processor will be overloaded and it will take a significant amount of time to be able to close ImageMagick. \layout SGML \layout SGML \end_deeper \layout Description identify Will identify \begin_inset LatexCommand \index{identify} \end_inset the type of image \begin_inset LatexCommand \index{image} \end_inset as well as it's size, \begin_inset LatexCommand \index{size} \end_inset colour \begin_inset LatexCommand \index{colour} \end_inset depth and various other information. Use the \emph on -verbose \begin_inset LatexCommand \index{-verbose} \end_inset \emph default option \begin_inset LatexCommand \index{option} \end_inset to show \begin_inset LatexCommand \index{show} \end_inset detailed \begin_inset LatexCommand \index{detailed} \end_inset information on the particular \begin_inset LatexCommand \index{particular} \end_inset file(s). \begin_deeper \layout Standard Command syntax: \layout Code identify image_name \end_deeper \layout Description mogrify \begin_inset LatexCommand \index{mogrify} \end_inset \emph on mogrify \emph default is another ImageMagick \begin_inset LatexCommand \index{ImageMagick} \end_inset command which is used to transform \begin_inset LatexCommand \index{transform} \end_inset images in a number of different ways, including \begin_inset LatexCommand \index{including} \end_inset scaling, \begin_inset LatexCommand \index{scaling} \end_inset rotation \begin_inset LatexCommand \index{rotation} \end_inset and various other effects. \begin_inset LatexCommand \index{effects} \end_inset This command can work on a single file or in batch. \begin_inset LatexCommand \index{batch} \end_inset \begin_deeper \layout Standard For example, to convert a large number \begin_inset LatexCommand \index{number} \end_inset of tiff \begin_inset LatexCommand \index{tiff} \end_inset files to jpeg \begin_inset LatexCommand \index{jpeg} \end_inset files you could type: \layout Code mogrify -format jpeg *.tiff \begin_inset LatexCommand \index{-format} \end_inset \layout Standard This command has the power \begin_inset LatexCommand \index{power} \end_inset to do a number of things in batch \begin_inset LatexCommand \index{batch} \end_inset including making thumbnails \begin_inset LatexCommand \index{thumbnails} \end_inset of sets \begin_inset LatexCommand \index{sets} \end_inset of images. \layout Standard For this you could type: \begin_inset Foot collapsed false \layout Standard This example has come been used from (unedited) \begin_inset Quotes eld \end_inset CLI for noobies: import, display, mogrify \begin_inset Quotes erd \end_inset , see [16] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset \layout Code mogrify -geometry \begin_inset LatexCommand \index{-geometry} \end_inset 120x120 *.jpg \end_deeper \layout Description showrgb \begin_inset LatexCommand \index{showrgb} \end_inset \emph on showrgb \emph default is used to uncompile \begin_inset LatexCommand \index{uncompile} \end_inset an rgb \begin_inset LatexCommand \index{rgb} \end_inset colour-name database. \begin_inset LatexCommand \index{database} \end_inset The default \begin_inset LatexCommand \index{default} \end_inset is the one that X was built \begin_inset LatexCommand \index{built} \end_inset with. This database \begin_inset LatexCommand \index{database} \end_inset can be used to find \begin_inset LatexCommand \index{find} \end_inset the correct \begin_inset LatexCommand \index{correct} \end_inset colour \begin_inset LatexCommand \index{colour} \end_inset combination for a particular colour \begin_inset LatexCommand \index{colour} \end_inset (well it can be used as a rough \begin_inset LatexCommand \index{rough} \end_inset guide \begin_inset LatexCommand \index{guide} \end_inset anyway). \begin_deeper \layout Standard To list \begin_inset LatexCommand \index{list} \end_inset the colours \begin_inset LatexCommand \index{colours} \end_inset from the X database, \begin_inset LatexCommand \index{database} \end_inset simply type: \layout Code showrgb \end_deeper \layout SGML \layout SGML Please note: \layout SGML \layout SGML All tools listed, excluding \emph on showrgb \emph default are part of the ImageMagick package. Type \emph on man ImageMagick \emph default for a full list of available commands. Or see the ImageMagick site \begin_inset LatexCommand \url[ImageMagick]{http://www.imagemagick.org} \end_inset \begin_inset LatexCommand \index{ImageMagick} \end_inset for further information. \layout SGML \layout SGML \layout Chapter \noindent Working with MS-DOS files \begin_inset LatexCommand \label{Working-with-MS-DOS} \end_inset \layout Standard \noindent Use the mtools \begin_inset LatexCommand \index{mtools} \end_inset programs \begin_inset LatexCommand \index{programs} \end_inset to work with ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset based files, execute \begin_inset LatexCommand \index{execute} \end_inset \emph on mtools \emph default for a full \begin_inset LatexCommand \index{full} \end_inset listing \begin_inset LatexCommand \index{listing} \end_inset of available \begin_inset LatexCommand \index{available} \end_inset m* tools. There are a lot of files within the mtools \begin_inset LatexCommand \index{mtools} \end_inset package \begin_inset LatexCommand \index{package} \end_inset for working with ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset disks, \begin_inset LatexCommand \index{disks} \end_inset also try the info \begin_inset LatexCommand \index{info} \end_inset documentation \begin_inset LatexCommand \index{documentation} \end_inset of mtools \begin_inset LatexCommand \index{mtools} \end_inset for more \begin_inset LatexCommand \index{more} \end_inset details. \begin_inset LatexCommand \index{details} \end_inset \layout SGML \layout SGML The use of slashes \layout SGML \layout SGML Note that with mtools commands you can use the slashes on the a: part either way (ie. backslash (windows-style) or forward slash (UNIX system style)). \layout SGML \layout SGML \layout Description \noindent mformat \begin_inset LatexCommand \index{mformat} \end_inset Formats \begin_inset LatexCommand \index{Formats} \end_inset an unmounted \begin_inset LatexCommand \index{unmounted} \end_inset disk as an ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset floppy disk. \begin_inset LatexCommand \index{disk} \end_inset Usage \begin_inset LatexCommand \index{Usage} \end_inset is similar to the ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset format \begin_inset LatexCommand \index{format} \end_inset utility, \begin_inset LatexCommand \index{utility} \end_inset to format \begin_inset LatexCommand \index{format} \end_inset the first floppy \begin_inset LatexCommand \index{floppy} \end_inset disk \begin_inset LatexCommand \index{disk} \end_inset you can type: \begin_deeper \layout Code mformat a: \end_deeper \layout Description \noindent mcopy \begin_inset LatexCommand \index{mcopy} \end_inset Copies files from an ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset disk when it's not mounted. \begin_inset LatexCommand \index{mounted} \end_inset Similar to the ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset copy command except it's more advanced. \begin_inset LatexCommand \index{advanced} \end_inset \begin_deeper \layout Standard \noindent Command syntax: \layout Code mcopy a:/file_or_files /destination/directory \end_deeper \layout Description \noindent mmount \begin_inset LatexCommand \index{mmount} \end_inset Mount an ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset disk, without using the normal \begin_inset LatexCommand \index{normal} \end_inset UNIX system mount. \begin_deeper \layout Standard For example: \layout Code mmount a: /mnt/floppy \layout Standard This will mount \begin_inset LatexCommand \index{mount} \end_inset the floppy under /mnt/floppy (this option may or may not be necessary, it depends on your /etc/fstab setup). \end_deeper \layout Description mbadblocks \begin_inset LatexCommand \index{mbadblocks} \end_inset Scans \begin_inset LatexCommand \index{Scans} \end_inset an ms-dos \begin_inset LatexCommand \index{ms-dos} \end_inset (fat formatted \begin_inset LatexCommand \index{formatted} \end_inset disk) for bad blocks, \begin_inset LatexCommand \index{blocks} \end_inset it marks \begin_inset LatexCommand \index{marks} \end_inset any unused bad blocks \begin_inset LatexCommand \index{blocks} \end_inset as \begin_inset Quotes eld \end_inset bad \begin_inset Quotes erd \end_inset so they won't be used. \begin_deeper \layout Standard Example: \layout Code mbadblocks a: \end_deeper \layout Description dosfsck \begin_inset LatexCommand \index{dosfsck} \end_inset This program \begin_inset LatexCommand \index{program} \end_inset is used to check \begin_inset LatexCommand \index{check} \end_inset and repair \begin_inset LatexCommand \index{repair} \end_inset ms-dos based filesystems. \begin_inset LatexCommand \index{filesystems} \end_inset Use the \emph on -a \begin_inset LatexCommand \index{-a} \end_inset \emph default option to automatically \begin_inset LatexCommand \index{automatically} \end_inset repair \begin_inset LatexCommand \index{repair} \end_inset the filesystem \begin_inset LatexCommand \index{filesystem} \end_inset (ie don't ask the user questions), the \emph on -t \begin_inset LatexCommand \index{-t} \end_inset \emph default option \begin_inset LatexCommand \index{option} \end_inset to mark \begin_inset LatexCommand \index{mark} \end_inset un-readable \begin_inset LatexCommand \index{un-readable} \end_inset clusters \begin_inset LatexCommand \index{clusters} \end_inset as bad and the \emph on -v \emph default option to be more \begin_inset LatexCommand \index{more} \end_inset verbose \begin_inset LatexCommand \index{verbose} \end_inset (print more information). \begin_deeper \layout Standard Example: \layout Code dosfsck -at /dev/fd0 \layout Standard This would check \begin_inset LatexCommand \index{check} \end_inset your floppy disk \begin_inset LatexCommand \index{disk} \end_inset for any errors \begin_inset LatexCommand \index{errors} \end_inset (and bad sectors) and repair \begin_inset LatexCommand \index{repair} \end_inset them automatically. \begin_inset LatexCommand \index{automatically} \end_inset \end_deeper \layout Chapter Scheduling Commands to run in the background \begin_inset LatexCommand \label{Scheduling} \end_inset \layout Standard \noindent There are two main tools used to perform \begin_inset LatexCommand \index{perform} \end_inset scheduled \begin_inset LatexCommand \index{scheduled} \end_inset tasks, \emph on at \emph default and \emph on cron \emph default . You may also like to try \begin_inset LatexCommand \url[anacron]{http://anacron.sourceforge.net} \end_inset \begin_inset LatexCommand \index{anacron} \end_inset if your computer \begin_inset LatexCommand \index{computer} \end_inset does not run continuously, as cron \begin_inset LatexCommand \index{cron} \end_inset will only work if your computer is left on (anacron can catch \begin_inset LatexCommand \index{catch} \end_inset up with the scheduled \begin_inset LatexCommand \index{scheduled} \end_inset tasks the next time the computer is on\SpecialChar \ldots{} ). \layout Description \noindent at \begin_inset LatexCommand \index{at} \end_inset 'at' executes a command once on a particular \begin_inset LatexCommand \index{particular} \end_inset day, \begin_inset LatexCommand \index{day} \end_inset at \begin_inset LatexCommand \index{at} \end_inset a particular time. \begin_inset LatexCommand \index{time} \end_inset \emph on at \emph default will add \begin_inset LatexCommand \index{add} \end_inset a particular command to be executed. \begin_deeper \layout Standard \noindent Examples: \layout Code at 21:30 \layout Standard You then type the commands you want executed then press \begin_inset LatexCommand \index{press} \end_inset the end-of-file \begin_inset LatexCommand \index{end-of-file} \end_inset key \begin_inset LatexCommand \index{character} \end_inset (normally CTRL-D). Also try: \layout Code at now + time \layout Standard This will run at the current time + the hours/mins/seconds you specify \begin_inset LatexCommand \index{specify} \end_inset (use \emph on at \begin_inset LatexCommand \index{at} \end_inset now + 1 hour \begin_inset LatexCommand \index{hour} \end_inset \emph default to have command(s) run in 1 hour from now\SpecialChar \ldots{} ) \layout Standard You can also use the \emph on -f \begin_inset LatexCommand \index{-f} \end_inset \emph default option to have at \begin_inset LatexCommand \index{at} \end_inset execute a particular \begin_inset LatexCommand \index{particular} \end_inset file (a shell \begin_inset LatexCommand \index{shell} \end_inset script). \layout Code at -f shell_script now + 1 hour \layout Standard This would run the shell \begin_inset LatexCommand \index{shell} \end_inset script 1 hour \begin_inset LatexCommand \index{hour} \end_inset from now. \end_deeper \layout Description atq \begin_inset LatexCommand \index{atq} \end_inset Will list jobs currently in queue \begin_inset LatexCommand \index{queue} \end_inset for the user who executed it, if root \begin_inset LatexCommand \index{root} \end_inset executes at \begin_inset LatexCommand \index{at} \end_inset it will list \begin_inset LatexCommand \index{list} \end_inset all jobs \begin_inset LatexCommand \index{jobs} \end_inset in queue \begin_inset LatexCommand \index{queue} \end_inset for the at \begin_inset LatexCommand \index{at} \end_inset daemon. Doesn't need or take any options. \begin_inset LatexCommand \index{options} \end_inset \layout Description atrm \begin_inset LatexCommand \index{atrm} \end_inset Will remove \begin_inset LatexCommand \index{remove} \end_inset a job \begin_inset LatexCommand \index{job} \end_inset from the 'at' queue. \begin_inset LatexCommand \index{queue} \end_inset \begin_deeper \layout Standard Command syntax: \layout Code atrm job_no \layout Standard Will delete \begin_inset LatexCommand \index{delete} \end_inset the job \begin_inset LatexCommand \index{job} \end_inset \begin_inset Quotes eld \end_inset job_no \begin_inset Quotes erd \end_inset (use \emph on atq \emph default to find out the number \begin_inset LatexCommand \index{number} \end_inset of the job) \end_deeper \layout Description \noindent cron \emph on cron \begin_inset LatexCommand \index{cron} \end_inset \emph default can be used to schedule \begin_inset LatexCommand \index{schedule} \end_inset a particular \begin_inset LatexCommand \index{particular} \end_inset function \begin_inset LatexCommand \index{function} \end_inset to occur every minute, \begin_inset LatexCommand \index{minute} \end_inset hour, \begin_inset LatexCommand \index{hour} \end_inset day, \begin_inset LatexCommand \index{day} \end_inset week, or month. \begin_inset LatexCommand \index{month} \end_inset \begin_deeper \layout Standard \noindent It's normal \begin_inset LatexCommand \index{normal} \end_inset to use the crontab \begin_inset LatexCommand \index{crontab} \end_inset to perform the editing \begin_inset LatexCommand \index{editing} \end_inset functions as this automates \begin_inset LatexCommand \index{automates} \end_inset the process \begin_inset LatexCommand \index{process} \end_inset for the cron \begin_inset LatexCommand \index{cron} \end_inset daemon \begin_inset LatexCommand \index{daemon} \end_inset and makes it easier for normal \begin_inset LatexCommand \index{normal} \end_inset users to use cron. \begin_inset LatexCommand \index{cron} \end_inset \layout SGML \layout SGML Anacron \layout SGML \emph on anacron \emph default is another tool designed for systems which are not always on, such as home computers \layout SGML While \emph on cron \emph default will not run if the computer is off, \emph on anacron \emph default will simply run the command when the computer is next on (it catches up with things). \layout SGML \layout Standard \begin_inset Note collapsed false \layout Standard if thats incorrect please email me and explain how it works\SpecialChar \ldots{} \end_inset \end_deeper \layout Description crontab \begin_inset LatexCommand \index{crontab} \end_inset \emph on crontab \emph default is used to edit, \begin_inset LatexCommand \index{edit} \end_inset read and remove \begin_inset LatexCommand \index{remove} \end_inset the files which the cron \begin_inset LatexCommand \index{cron} \end_inset daemon \begin_inset LatexCommand \index{daemon} \end_inset reads. \begin_inset LatexCommand \index{reads} \end_inset \begin_deeper \layout Standard Options \begin_inset LatexCommand \index{Options} \end_inset for crontab \begin_inset LatexCommand \index{crontab} \end_inset (use \emph on crontab \begin_inset LatexCommand \index{crontab} \end_inset -option(s) \emph default ): \layout Itemize \emph on -e \begin_inset LatexCommand \index{-e} \end_inset \emph default --- to edit the file. \layout Itemize \emph on -l \begin_inset LatexCommand \index{-l} \end_inset \emph default --- to list the contents \begin_inset LatexCommand \index{contents} \end_inset of the file. \layout Itemize \emph on -u \begin_inset LatexCommand \index{-u} \end_inset username \emph default --- use the \emph on -u \emph default with a username \begin_inset LatexCommand \index{username} \end_inset argument \begin_inset LatexCommand \index{argument} \end_inset to work with another users crontab \begin_inset LatexCommand \index{crontab} \end_inset file. \layout Standard When using \emph on crontab -e \begin_inset LatexCommand \index{-e} \end_inset \emph default you have a number of fields \begin_inset LatexCommand \index{fields} \end_inset (6) what they mean is listed \begin_inset LatexCommand \index{listed} \end_inset below: \layout Standard \begin_inset Tabular \begin_inset Text \layout Standard Field \end_inset \begin_inset Text \layout Standard Allowed Values \end_inset \begin_inset Text \layout Standard minute \end_inset \begin_inset Text \layout Standard 0-59 \end_inset \begin_inset Text \layout Standard hour \end_inset \begin_inset Text \layout Standard 0-23 \end_inset \begin_inset Text \layout Standard day of month \end_inset \begin_inset Text \layout Standard 1-31 \end_inset \begin_inset Text \layout Standard month \end_inset \begin_inset Text \layout Standard 1-12 (or names, see below) \end_inset \begin_inset Text \layout Standard day of week \end_inset \begin_inset Text \layout Standard 0-7 (0 or 7 is Sun, or use three letter names) \end_inset \end_inset \layout Standard There are also a number of shortcut \begin_inset LatexCommand \index{shortcut} \end_inset methods for common \begin_inset LatexCommand \index{common} \end_inset tasks, including: \begin_inset LatexCommand \index{including} \end_inset \begin_inset Foot collapsed false \layout Standard This information has come from (without editing) a post on the LinuxChix techtalk mailing list, please see [16] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset \layout Itemize \emph on @reboot \emph default --- run \begin_inset LatexCommand \index{run} \end_inset command at \begin_inset LatexCommand \index{at} \end_inset reboot \layout Itemize \emph on @yearly \emph default --- same as 0 0 1 1 * \layout Itemize \emph on @annually \emph default --- same as @yearly \layout Itemize \emph on @monthly \emph default --- same as 0 0 1 * * \layout Itemize \emph on @weekly \emph default --- same as 0 0 * * 0 \layout Itemize \emph on @daily \emph default --- same as 0 0 * * * \layout Itemize \emph on @midnight \emph default --- same as @daily \layout Itemize \emph on @hourly \emph default --- same as 0 * * * * \layout Standard \begin_inset Foot collapsed false \layout Standard This information comes from the cron manual page with small additions (no changes to original content), refer to [13] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset \layout Standard Note that * (asterisk) is used to mean anything (similar to the wildcard). For example if you leave the day \begin_inset LatexCommand \index{day} \end_inset part (the 5th place) with an asterisk \begin_inset LatexCommand \index{asterisk} \end_inset it would mean everyday. \begin_inset LatexCommand \index{everyday} \end_inset \layout Standard Lists \begin_inset LatexCommand \index{Lists} \end_inset are allowed. \begin_inset LatexCommand \index{allowed} \end_inset A list is a set \begin_inset LatexCommand \index{set} \end_inset of numbers \begin_inset LatexCommand \index{numbers} \end_inset (or ranges) separated \begin_inset LatexCommand \index{separated} \end_inset by commas. \begin_inset LatexCommand \index{commas} \end_inset Examples: \begin_inset LatexCommand \index{Examples} \end_inset ``1,2,5,9'', ``0-4,8-12 \begin_inset Quotes erd \end_inset . \layout Standard Step \begin_inset LatexCommand \index{Step} \end_inset values \begin_inset LatexCommand \index{values} \end_inset can be used in conjunction \begin_inset LatexCommand \index{conjunction} \end_inset with ranges. \begin_inset LatexCommand \index{ranges} \end_inset Following \begin_inset LatexCommand \index{Following} \end_inset a range \begin_inset LatexCommand \index{range} \end_inset with ``/'' specifies \begin_inset LatexCommand \index{specifies} \end_inset skips of the number's value \begin_inset LatexCommand \index{value} \end_inset through the range. For example, ``0-23/2'' can be used in the hours \begin_inset LatexCommand \index{hours} \end_inset field \begin_inset LatexCommand \index{field} \end_inset to specify \begin_inset LatexCommand \index{specify} \end_inset command execution \begin_inset LatexCommand \index{execution} \end_inset every other hour \begin_inset LatexCommand \index{hour} \end_inset (the alternative \begin_inset LatexCommand \index{alternative} \end_inset in the V7 \begin_inset LatexCommand \index{V7} \end_inset standard is ``0,2,4,6,8,10,12,14,16,18,20,22''). Steps \begin_inset LatexCommand \index{Steps} \end_inset are also permitted \begin_inset LatexCommand \index{permitted} \end_inset after an asterisk, \begin_inset LatexCommand \index{asterisk} \end_inset so if you want to say ``every two hours'', just use ``*/2''. \layout Standard When writing \begin_inset LatexCommand \index{writing} \end_inset a crontab \begin_inset LatexCommand \index{crontab} \end_inset entry \begin_inset LatexCommand \index{entry} \end_inset you simply type in six \begin_inset LatexCommand \index{six} \end_inset fields separated \begin_inset LatexCommand \index{separated} \end_inset by spaces, \begin_inset LatexCommand \index{spaces} \end_inset the first five \begin_inset LatexCommand \index{five} \end_inset are those listed in the table \begin_inset LatexCommand \index{table} \end_inset (using numbers \begin_inset LatexCommand \index{numbers} \end_inset or letters \begin_inset LatexCommand \index{letters} \end_inset and numbers \begin_inset LatexCommand \index{numbers} \end_inset as appropriate), the 6th field \begin_inset LatexCommand \index{field} \end_inset is the command to be executed and any options, cron \begin_inset LatexCommand \index{cron} \end_inset will read everything \begin_inset LatexCommand \index{everything} \end_inset up until the newline. \begin_inset LatexCommand \index{newline} \end_inset \layout Standard Example: \layout Code 5 4 * * sun echo "run at 5 after 4 every sunday" \layout Standard This would run the echo \begin_inset LatexCommand \index{echo} \end_inset command with the string \begin_inset LatexCommand \index{string} \end_inset shown at 4:05 every Sunday. \end_deeper \layout Standard \noindent \begin_inset Note collapsed false \layout Standard I really have never used cron\SpecialChar \ldots{} and haven't used \emph on at \emph default that much either, does anyone else have any suggestions? \layout Standard I know anacron exists but I know nothing about it. \end_inset \layout Chapter Miscellaneous \begin_inset LatexCommand \label{Miscellaneous} \end_inset \layout Standard The miscellaneous \begin_inset LatexCommand \index{miscellaneous} \end_inset chapter contains commands that don't really fit into the other sections \begin_inset LatexCommand \index{sections} \end_inset of this guide. \layout Description \noindent renaming\SpecialChar ~ extensions \begin_inset LatexCommand \index{renaming extensions} \end_inset To rename \begin_inset LatexCommand \index{rename} \end_inset all of the files in the current \begin_inset LatexCommand \index{current} \end_inset directory \begin_inset LatexCommand \index{directory} \end_inset with a '.htm' extension \begin_inset LatexCommand \index{extension} \end_inset to '.html', type: \begin_deeper \layout Code \noindent \series bold $ \series default chcase -x 's/htm/html/' '*.htm' \begin_inset LatexCommand \index{-x} \end_inset \layout Standard You can get a copy \begin_inset LatexCommand \index{copy} \end_inset of \emph on the chcase \begin_inset LatexCommand \index{chcase} \end_inset \emph default perl \begin_inset LatexCommand \index{perl} \end_inset script \emph on \begin_inset LatexCommand \url[here.]{http://www.blemished.net/chcase.html} \end_inset \layout Standard For more \begin_inset LatexCommand \index{more} \end_inset complex \begin_inset LatexCommand \index{complex} \end_inset renaming \begin_inset LatexCommand \index{renaming} \end_inset you should read \begin_inset LatexCommand \ref{mass-rename} \end_inset \end_deeper \layout Description \noindent rel \begin_inset Foot collapsed true \layout Standard This information information comes from the Linux Cookbook (without editing). See [3] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \end_inset Use rel \begin_inset LatexCommand \index{rel} \end_inset to analyze \begin_inset LatexCommand \index{analyze} \end_inset text files for relevance \begin_inset LatexCommand \index{relevance} \end_inset to a given set of keywords. \begin_inset LatexCommand \index{keywords} \end_inset It outputs \begin_inset LatexCommand \index{outputs} \end_inset the names of those files that are relevant \begin_inset LatexCommand \index{relevant} \end_inset to the given keywords, ranked \begin_inset LatexCommand \index{ranked} \end_inset in order \begin_inset LatexCommand \index{order} \end_inset of relevance; \begin_inset LatexCommand \index{relevance} \end_inset if a file does not meet the criteria, \begin_inset LatexCommand \index{criteria} \end_inset it is not outputted in the relevance \begin_inset LatexCommand \index{relevance} \end_inset listing. \layout Description units\SpecialChar ~ man\SpecialChar ~ page \begin_inset LatexCommand \index{units man page} \end_inset There is a man page, part of the Linux Programmers \begin_inset LatexCommand \index{Programmers} \end_inset Manual called \begin_inset Quotes eld \end_inset units \begin_inset Quotes erd \end_inset . It displays various information \begin_inset LatexCommand \index{information} \end_inset on the various scientific \begin_inset LatexCommand \index{scientific} \end_inset measurements \begin_inset LatexCommand \index{measurements} \end_inset (such as mega, \begin_inset LatexCommand \index{mega} \end_inset giga \begin_inset LatexCommand \index{giga} \end_inset et cetera). This manual \begin_inset LatexCommand \index{manual} \end_inset page \begin_inset LatexCommand \index{page} \end_inset also has a short discussion about the argument \begin_inset LatexCommand \index{argument} \end_inset over which \begin_inset LatexCommand \index{which} \end_inset standard \begin_inset LatexCommand \index{standard} \end_inset should be used to measure \begin_inset LatexCommand \index{measure} \end_inset data (ie. the kibibyte \begin_inset LatexCommand \index{kibibyte} \end_inset vs kilobyte). \begin_deeper \layout Standard To access \begin_inset LatexCommand \index{access} \end_inset this man page type: \layout Code man 7 units \end_deeper \layout Description fortune \begin_inset LatexCommand \index{fortune} \end_inset \emph on fortune \emph default is a tool which will print \begin_inset LatexCommand \index{print} \end_inset a random, \begin_inset LatexCommand \index{random} \end_inset hopefully interesting quote \begin_inset LatexCommand \index{quote} \end_inset or entertaining short piece \begin_inset LatexCommand \index{piece} \end_inset of writing. \begin_inset LatexCommand \index{writing} \end_inset There are options \begin_inset LatexCommand \index{options} \end_inset to customise \begin_inset LatexCommand \index{customise} \end_inset which area the epigrams \begin_inset LatexCommand \index{epigrams} \end_inset should come from. Just type \emph on fortune \emph default to get a random \begin_inset LatexCommand \index{random} \end_inset epigram \begin_inset LatexCommand \index{epigram} \end_inset from any section. \begin_inset LatexCommand \index{section} \end_inset \begin_deeper \layout Standard Simply type: \layout Code fortune \end_deeper \layout Chapter Mini-Guides \begin_inset LatexCommand \label{Mini-guides} \end_inset \layout Standard The mini-guides \begin_inset LatexCommand \index{mini-guides} \end_inset chapter is a section \begin_inset LatexCommand \index{section} \end_inset of the document \begin_inset LatexCommand \index{document} \end_inset that describes \begin_inset LatexCommand \index{describes} \end_inset certain concepts \begin_inset LatexCommand \index{concepts} \end_inset in more depth \begin_inset LatexCommand \index{depth} \end_inset than the usual command descriptions. \begin_inset LatexCommand \index{descriptions} \end_inset The information \begin_inset LatexCommand \index{information} \end_inset listed is fairly specific \begin_inset LatexCommand \index{specific} \end_inset as I have tried to avoid \begin_inset LatexCommand \index{avoid} \end_inset the duplication \begin_inset LatexCommand \index{duplication} \end_inset of too much information that is already online. \begin_inset LatexCommand \index{online} \end_inset \layout Section RPM: \begin_inset LatexCommand \label{RPM} \end_inset Redhat Package Management System \layout Standard \begin_inset Note collapsed false \layout Standard Done in sooo many tutorials that I think its pointless repeating it (although I thought it was pretty good :P) \layout Standard Installing, removing and querying packages \begin_inset LatexCommand \label{installing-removing-and-querying-packages} \end_inset \layout Standard Command syntax: \layout Code rpm -option package_name \layout Standard \series bold Options \layout Itemize \noindent \series bold \shape italic \emph on -i \series default \shape default \emph default --- install a new package \layout Itemize \noindent \series bold \shape italic \emph on -U \series default \shape default \emph default --- upgrades or Installs a package \layout Itemize \noindent \series bold \shape italic \emph on -e \series default \shape default \emph default --- removes the package from the system (un-install) \layout Itemize \noindent \series bold \shape italic \emph on -v \series default \shape default \emph default --- be more verbose, tell the user more of what the program is doing. \layout Itemize \noindent \series bold \shape italic \emph on -h \series default \shape default \emph default --- hash marks (use # (hash marks) as a progress meter.) \layout Itemize \series bold -q \series default --- queries package database for information. Use \emph on -qa \emph default to list all installed packages. Try \emph on rpm -qa rpmfile \emph default to find the full name of a particular rpm. Use the \emph on -ql \emph default option to list installed files of a particular package. Use the \layout Itemize \series bold -qf \series default \emph on \emph default --- option to see which package a particular file came from and use \emph on -qi \emph default to query further information on a package. \layout Itemize \series bold -V \series default --- check whether a package has been changed (see below \begin_inset LatexCommand \ref{checking-installed-RPMS} \end_inset ). \layout SGML \layout SGML Tip \layout SGML \layout SGML Use \emph on -U \emph default instead of \emph on -i \emph default this will install the program if it's not there and upgrade if it already exists. \layout SGML \layout SGML \layout SGML \layout SGML Please note that \layout SGML \layout SGML Using the \emph on -U \emph default option when upgrading the kernel ('linux') will remove the old version. It is recommended you use the \emph on -i \emph default switch if you upgrade your kernel from RPM. \layout SGML \layout SGML \layout Standard \noindent To check a RPM signature package, use the command: \layout Code \noindent rpm -checksig package_name \layout Standard \noindent This command checks the PGP signature of specified package to ensure it's integrity and origin. Always use this command first before installing new RPM package on your system. GnuPG (GNU Privacy Guard) or PGP software must be already installed on your system before you can use this command. \layout SGML \end_inset \layout Description \noindent Checking \begin_inset LatexCommand \index{Checking} \end_inset \series bold Installed \begin_inset LatexCommand \index{Installed} \end_inset RPM's \layout Standard \noindent Use the \emph on rpm \begin_inset LatexCommand \index{rpm} \end_inset -V \begin_inset LatexCommand \index{-V} \end_inset \emph default option \begin_inset LatexCommand \index{option} \end_inset to check \begin_inset LatexCommand \index{check} \end_inset whether or not a package \begin_inset LatexCommand \index{package} \end_inset has been modified. \begin_inset LatexCommand \index{modified} \end_inset \layout Standard \noindent For example: \layout Code \noindent rpm -V textutils \layout Standard \noindent If none \begin_inset LatexCommand \index{none} \end_inset of the files from the textutils \begin_inset LatexCommand \index{textutils} \end_inset package \begin_inset LatexCommand \index{package} \end_inset have changed then rpm \begin_inset LatexCommand \index{rpm} \end_inset will exit \begin_inset LatexCommand \index{exit} \end_inset without outputting any data. \begin_inset LatexCommand \index{data} \end_inset If, on the other hand, \begin_inset LatexCommand \index{hand} \end_inset the program \begin_inset LatexCommand \index{program} \end_inset has changed, you may see something like this: \layout Code \noindent U.5....T /bin/cat \layout Standard \noindent This isn't as cryptic \begin_inset LatexCommand \index{cryptic} \end_inset as it appears. The line \begin_inset LatexCommand \index{line} \end_inset returned \begin_inset LatexCommand \index{returned} \end_inset from \emph on rpm \begin_inset LatexCommand \index{rpm} \end_inset -V \begin_inset LatexCommand \index{-V} \end_inset \emph default contains any number \begin_inset LatexCommand \index{number} \end_inset of eight characters \begin_inset LatexCommand \index{characters} \end_inset plus the full \begin_inset LatexCommand \index{full} \end_inset path \begin_inset LatexCommand \index{path} \end_inset to the file. Here are the characters \begin_inset LatexCommand \index{characters} \end_inset and their meaning: \begin_inset Foot collapsed true \layout Standard Note that the list under section 24.1.2 comes from the RPM manual page, see [11] in the \begin_inset LatexCommand \ref{references} \end_inset for further details. \end_inset \layout Itemize \noindent \series bold S \series default --- File size differs \layout Itemize \noindent \series bold M \series default --- Mode differs (includes permissions \begin_inset LatexCommand \index{permissions} \end_inset and file type) \layout Itemize \noindent \series bold 5 \series default --- MD5 \begin_inset LatexCommand \index{MD5} \end_inset sum \begin_inset LatexCommand \index{sum} \end_inset differs \layout Itemize \noindent \series bold D \series default --- Device \begin_inset LatexCommand \index{Device} \end_inset major/minor number mis-match \begin_inset LatexCommand \index{mis-match} \end_inset \layout Itemize \noindent \series bold L \series default --- ReadLink(2) path \begin_inset LatexCommand \index{path} \end_inset mis-match \layout Itemize \noindent \series bold U \series default --- User ownership \begin_inset LatexCommand \index{ownership} \end_inset differs \layout Itemize \noindent \series bold G \series default --- Group \begin_inset LatexCommand \index{Group} \end_inset ownership \begin_inset LatexCommand \index{ownership} \end_inset differs \layout Itemize \noindent \series bold T \series default --- mTime \begin_inset LatexCommand \index{mTime} \end_inset differs \layout SGML \layout SGML Mandriva \begin_inset LatexCommand \index{Mandriva} \end_inset Users Note \layout SGML \layout SGML Mandriva Linux uses a customised version of RPM called urpmi \begin_inset LatexCommand \index{urpmi} \end_inset (It consists of the urpm* \begin_inset LatexCommand \index{urpm*} \end_inset commands, urpmi to install, urpme \begin_inset LatexCommand \index{urpme} \end_inset to remove and urpmf \begin_inset LatexCommand \index{urpmf} \end_inset and urpmq \begin_inset LatexCommand \index{urpmq} \end_inset to query). \layout SGML \layout SGML \layout SGML This customised version has advantages over standard RPM, including automatic-de pendency solving and Debian apt-get \begin_inset LatexCommand \index{apt-get} \end_inset style functions (ability to download programs over the internet and have all dependencies resolved automatically). \layout SGML \layout SGML \layout SGML The urpm* commands are all described in detail in Mandriva's documentation and various sources online. \layout SGML \layout SGML \layout Section Checking the Hard Disk for errors \begin_inset LatexCommand \label{checking-the-hard-disk} \end_inset \layout Standard Checking \begin_inset LatexCommand \index{Checking} \end_inset the hard disk \begin_inset LatexCommand \index{disk} \end_inset for errors \begin_inset LatexCommand \index{errors} \end_inset on your primary \begin_inset LatexCommand \index{primary} \end_inset drive is very, very rarely required \begin_inset LatexCommand \index{required} \end_inset in GNU/Linux, most checking \begin_inset LatexCommand \index{checking} \end_inset is automated \begin_inset LatexCommand \index{automated} \end_inset on start-up \begin_inset LatexCommand \index{start-up} \end_inset if it is required. \begin_inset LatexCommand \index{required} \end_inset If you do need to check \begin_inset LatexCommand \index{check} \end_inset the hard disk for errors you will first need to unmount \begin_inset LatexCommand \index{unmount} \end_inset it. Then use the file system checker, \emph on fsck \emph default . \layout Code fsck.file_system_type \layout Standard If you had an ext3 \begin_inset LatexCommand \index{ext3} \end_inset file-system then it would be: \layout Code fsck.ext3 \layout SGML \layout SGML Also try \layout SGML \layout SGML You can also try using: \layout SGML \layout SGML fsck -t file_system_type \begin_inset LatexCommand \index{-t} \end_inset \layout SGML \layout SGML \layout SGML \layout Section Duplicating disks \begin_inset LatexCommand \label{duplicating-disks} \end_inset \layout Standard This simple technique \begin_inset LatexCommand \index{technique} \end_inset shows you how you would duplicate \begin_inset LatexCommand \index{duplicate} \end_inset floppy disks \begin_inset LatexCommand \index{disks} \end_inset in a GNU/Linux system using dd. \begin_inset LatexCommand \index{dd} \end_inset This technique \begin_inset LatexCommand \index{technique} \end_inset is not as useful as it used to be but can still be used for creating an image \begin_inset LatexCommand \index{image} \end_inset of a cd \begin_inset LatexCommand \index{cd} \end_inset (although that is best done through the cd burning \begin_inset LatexCommand \index{burning} \end_inset program). \layout Standard This information \begin_inset LatexCommand \index{information} \end_inset has been taken from the Linux Online Classroom, \begin_inset LatexCommand \index{Linux Online Classroom} \end_inset see [4] in the \begin_inset LatexCommand \ref{references} \end_inset for further details. \begin_inset LatexCommand \index{details} \end_inset \layout Code \series bold $ \series default dd if=/dev/fd0 of=floppy-image \layout Code \series bold $ \series default dd if=floppy-image of=/dev/fd0 \layout Standard The first dd \begin_inset LatexCommand \index{dd} \end_inset makes an exact \begin_inset LatexCommand \index{exact} \end_inset image of the floppy \begin_inset LatexCommand \index{floppy} \end_inset to the file floppy-image, \begin_inset LatexCommand \index{floppy-image} \end_inset the second one writes the image to the floppy. (The user has presumably switched \begin_inset LatexCommand \index{switched} \end_inset the floppy before the second command. Otherwise the command pair is of doubtful usefulness). \layout Standard Similar techinques \begin_inset LatexCommand \index{techinques} \end_inset can be used when creating bootdisks, \begin_inset LatexCommand \index{bootdisks} \end_inset you simply use dd \begin_inset LatexCommand \index{dd} \end_inset to transfer \begin_inset LatexCommand \index{transfer} \end_inset the image to the floppy disk. \layout Section Wildcards \begin_inset LatexCommand \label{wildcards} \end_inset \layout Standard Wildcards are useful in many ways for a GNU/Linux system and for various other uses. Commands can use wildcards \begin_inset LatexCommand \index{wildcards} \end_inset to perform \begin_inset LatexCommand \index{perform} \end_inset actions on more \begin_inset LatexCommand \index{more} \end_inset than one file at a time, \begin_inset LatexCommand \index{time} \end_inset or to find \begin_inset LatexCommand \index{find} \end_inset part of a phrase \begin_inset LatexCommand \index{phrase} \end_inset in a text \begin_inset LatexCommand \index{text} \end_inset file. There are many uses for wildcards, there are two different \begin_inset LatexCommand \index{different} \end_inset major \begin_inset LatexCommand \index{major} \end_inset ways that wildcards are used, they are globbing \begin_inset LatexCommand \index{globbing} \end_inset patterns/standard wildcards that are often used by the shell. \begin_inset LatexCommand \index{shell} \end_inset The alternative \begin_inset LatexCommand \index{alternative} \end_inset is regular expressions, popular \begin_inset LatexCommand \index{popular} \end_inset with many other commands and popular \begin_inset LatexCommand \index{popular} \end_inset for use with text searching \begin_inset LatexCommand \index{searching} \end_inset and manipulation. \begin_inset LatexCommand \index{manipulation} \end_inset \layout SGML \layout SGML Tip \layout SGML \layout SGML If you have a file with wildcard expressions in it then you can use single quotes to stop bash expanding them or use backslashes (escape characters), or both. \layout SGML \layout SGML \layout SGML For example if you wanted to create a file called 'fo*' (fo and asterisk) you would have to do it like this (note that you shouldn't create files with names like this, this is just an example): \layout SGML \layout SGML touch 'fo*' \layout SGML \layout SGML \layout SGML \layout Standard Note that parts \begin_inset LatexCommand \index{parts} \end_inset of both subsections \begin_inset LatexCommand \index{subsections} \end_inset on wildcards are based (at least \begin_inset LatexCommand \index{least} \end_inset in part) off \begin_inset LatexCommand \index{off} \end_inset the grep \begin_inset LatexCommand \index{grep} \end_inset manual \begin_inset LatexCommand \index{manual} \end_inset and info \begin_inset LatexCommand \index{info} \end_inset pages. Please see the \begin_inset LatexCommand \ref{references} \end_inset for further information. \layout Subsection Standard Wildcards (globbing patterns) \begin_inset LatexCommand \label{standard-wildcards} \end_inset \layout Standard Standard wildcards \begin_inset LatexCommand \index{standard wildcards} \end_inset (also known as globbing patterns \begin_inset LatexCommand \index{globbing patterns} \end_inset ) are used by various command-line utilities \begin_inset LatexCommand \index{utilities} \end_inset to work with multiple \begin_inset LatexCommand \index{multiple} \end_inset files. For more information on standard wildcards (globbing patterns) refer \begin_inset LatexCommand \index{refer} \end_inset to the manual page \begin_inset LatexCommand \index{page} \end_inset by typing: \layout Code man 7 glob \layout SGML \layout SGML Can be used by \layout SGML \layout SGML Standard wildcards are used by nearly any command (including mv, cp, rm and many others). \layout SGML \layout SGML \layout Description \noindent ?\SpecialChar ~ (question\SpecialChar ~ mark) \begin_inset LatexCommand \index{?} \end_inset this can represent \begin_inset LatexCommand \index{represent} \end_inset any \emph on single \emph default character. If you specified \begin_inset LatexCommand \index{specified} \end_inset something at the command line like "hd?" GNU/Linux would look \begin_inset LatexCommand \index{look} \end_inset for hda, \begin_inset LatexCommand \index{hda} \end_inset hdb, \begin_inset LatexCommand \index{hdb} \end_inset hdc \begin_inset LatexCommand \index{hdc} \end_inset and every other letter/number between a-z, \begin_inset LatexCommand \index{a-z} \end_inset 0-9. \layout Description \noindent *\SpecialChar ~ (asterisk) \begin_inset LatexCommand \index{*} \end_inset this can represent \begin_inset LatexCommand \index{represent} \end_inset any number of characters \begin_inset LatexCommand \index{characters} \end_inset (including zero, \begin_inset LatexCommand \index{zero} \end_inset in other words, zero \begin_inset LatexCommand \index{zero} \end_inset or more characters). If you specified \begin_inset LatexCommand \index{specified} \end_inset a "cd*" it would use "cda", "cdrom" \begin_inset LatexCommand \index{cdrom} \end_inset , "cdrecord" \begin_inset LatexCommand \index{cdrecord} \end_inset and \emph on anything \emph default that starts \begin_inset LatexCommand \index{starts} \end_inset with \begin_inset Quotes eld \end_inset cd \begin_inset Quotes erd \end_inset also including \begin_inset LatexCommand \index{including} \end_inset \begin_inset Quotes eld \end_inset cd \begin_inset Quotes erd \end_inset itself. "m*l" could by mill, mull, \begin_inset LatexCommand \index{mull} \end_inset ml, and anything that starts with an m and ends \begin_inset LatexCommand \index{ends} \end_inset with an l. \layout Description \noindent [\SpecialChar ~ ]\SpecialChar ~ (square\SpecialChar ~ brackets) \begin_inset LatexCommand \index{[ ]} \end_inset specifies \begin_inset LatexCommand \index{specifies} \end_inset a range. \begin_inset LatexCommand \index{range} \end_inset If you did m[a,o,u]m it can become: mam, mum, \begin_inset LatexCommand \index{mum} \end_inset mom \begin_inset LatexCommand \index{mom} \end_inset if you did: m[a-d]m it can become anything that starts and ends \begin_inset LatexCommand \index{ends} \end_inset with m and has any character \begin_inset LatexCommand \index{character} \end_inset a to d inbetween. For example, these would work: mam, mbm, \begin_inset LatexCommand \index{mbm} \end_inset mcm, \begin_inset LatexCommand \index{mcm} \end_inset mdm. \begin_inset LatexCommand \index{mdm} \end_inset This kind of wildcard specifies \begin_inset LatexCommand \index{specifies} \end_inset an \begin_inset Quotes eld \end_inset or \begin_inset Quotes erd \end_inset relationship \begin_inset LatexCommand \index{relationship} \end_inset (you only need one to match). \layout Description {\SpecialChar ~ }\SpecialChar ~ (curly\SpecialChar ~ brackets) \begin_inset LatexCommand \index{{ }} \end_inset terms \begin_inset LatexCommand \index{terms} \end_inset are separated \begin_inset LatexCommand \index{separated} \end_inset by commas \begin_inset LatexCommand \index{commas} \end_inset and each term \begin_inset LatexCommand \index{term} \end_inset must be the name of something or a wildcard. This wildcard will copy anything that matches either wildcard(s), or exact \begin_inset LatexCommand \index{exact} \end_inset name(s) (an \begin_inset Quotes eld \end_inset or \begin_inset Quotes erd \end_inset relationship, \begin_inset LatexCommand \index{relationship} \end_inset one or the other). \begin_deeper \layout Standard For example, this would be valid: \begin_inset LatexCommand \index{valid} \end_inset \layout Code cp {*.doc,*.pdf} ~ \layout Standard This will copy anything ending \begin_inset LatexCommand \index{ending} \end_inset with .doc \begin_inset LatexCommand \index{.doc} \end_inset or .pdf \begin_inset LatexCommand \index{.pdf} \end_inset to the users home \begin_inset LatexCommand \index{home} \end_inset directory. \begin_inset LatexCommand \index{directory} \end_inset Note that spaces \begin_inset LatexCommand \index{spaces} \end_inset are not allowed \begin_inset LatexCommand \index{allowed} \end_inset after the commas \begin_inset LatexCommand \index{commas} \end_inset (or anywhere else). \end_deeper \layout Description \noindent \series bold [!] \series default \begin_inset LatexCommand \index{[!]} \end_inset This construct is similar to the \series bold [\SpecialChar ~ ] \series default construct, except rather than matching \begin_inset LatexCommand \index{matching} \end_inset any characters \begin_inset LatexCommand \index{characters} \end_inset inside \begin_inset LatexCommand \index{inside} \end_inset the brackets, \begin_inset LatexCommand \index{brackets} \end_inset it'll match \begin_inset LatexCommand \index{match} \end_inset any character, \begin_inset LatexCommand \index{character} \end_inset as long \begin_inset LatexCommand \index{long} \end_inset as it is \shape italic not \shape default listed \begin_inset LatexCommand \index{listed} \end_inset between the \series bold [ \series default and \series bold ] \series default . This is a logical \begin_inset LatexCommand \index{logical} \end_inset NOT. \begin_inset LatexCommand \index{NOT} \end_inset For example \emph on rm \begin_inset LatexCommand \index{rm} \end_inset myfile[!9] \emph default will remove \begin_inset LatexCommand \index{remove} \end_inset all myfiles* (ie. myfiles1, \begin_inset LatexCommand \index{myfiles1} \end_inset myfiles2 \begin_inset LatexCommand \index{myfiles2} \end_inset etc) but won't remove \begin_inset LatexCommand \index{remove} \end_inset a file with the number 9 anywhere within it's name. \layout Description \backslash \SpecialChar ~ (backslash) \begin_inset LatexCommand \index{\} \end_inset is used as an "escape" character, \begin_inset LatexCommand \index{escape character} \end_inset i.e. to protect \begin_inset LatexCommand \index{protect} \end_inset a subsequent \begin_inset LatexCommand \index{subsequent} \end_inset special character. \begin_inset LatexCommand \index{special character} \end_inset Thus, " \backslash \backslash \begin_inset Quotes erd \end_inset searches \begin_inset LatexCommand \index{searches} \end_inset for a backslash. \begin_inset LatexCommand \index{backslash} \end_inset Note you may need to use quotation \begin_inset LatexCommand \index{quotation} \end_inset marks and backslash(es). \layout Subsection Regular Expressions \begin_inset LatexCommand \label{regular-expressions} \end_inset \layout Standard Regular expressions are a type of globbing pattern \begin_inset LatexCommand \index{globbing pattern} \end_inset used when working with text. They are used for any form \begin_inset LatexCommand \index{form} \end_inset of manipulation \begin_inset LatexCommand \index{manipulation} \end_inset of multiple \begin_inset LatexCommand \index{multiple} \end_inset parts \begin_inset LatexCommand \index{parts} \end_inset of text \begin_inset LatexCommand \index{text} \end_inset and by various programming \begin_inset LatexCommand \index{programming} \end_inset languages that work with text. For more information \begin_inset LatexCommand \index{information} \end_inset on regular expressions refer \begin_inset LatexCommand \index{refer} \end_inset to the manual page or try an online tutorial, for example IBM Developerworks \begin_inset LatexCommand \index{IBM Developerworks} \end_inset \begin_inset LatexCommand \url[using regular expressions]{https://www6.software.ibm.com/developerworks/education/l-regexp/index.html} \end_inset . For the manual \begin_inset LatexCommand \index{manual} \end_inset page \begin_inset LatexCommand \index{page} \end_inset type: \layout Standard Type: \layout Code man 7 regex \layout SGML \layout SGML Regular expressions can be used by \layout SGML \layout SGML Regular Expressions are used by \emph on grep \emph default (and can be used) by \emph on find \emph default and many other programs. \begin_inset Note collapsed true \layout Standard can anyone suggest some other programs\SpecialChar \ldots{} besides grep \end_inset \layout SGML \layout SGML \layout SGML \layout SGML Tip \layout SGML If your regular expressions don't seem to be working then you probably need to use single quotation marks over the sentence and then use backslashes on every single special character. \layout SGML \layout SGML \layout Description \noindent .\SpecialChar ~ (dot) \begin_inset LatexCommand \index{.} \end_inset will match \begin_inset LatexCommand \index{match} \end_inset \emph on any single character \emph default , equivalent \begin_inset LatexCommand \index{equivalent} \end_inset to ? (question mark) in standard wildcard \begin_inset LatexCommand \index{standard wildcard} \end_inset expressions. \begin_inset LatexCommand \index{expressions} \end_inset Thus, "m.a" matches "mpa" and "mea" but not "ma" or "mppa". \layout Description \noindent \backslash \SpecialChar ~ (backslash) \begin_inset LatexCommand \index{\} \end_inset is used as an "escape" character, \begin_inset LatexCommand \index{escape character} \end_inset i.e. to protect \begin_inset LatexCommand \index{protect} \end_inset a subsequent \begin_inset LatexCommand \index{subsequent} \end_inset special character. \begin_inset LatexCommand \index{specialcharacter} \end_inset Thus, " \backslash \backslash " searches \begin_inset LatexCommand \index{searches} \end_inset for a backslash. \begin_inset LatexCommand \index{backslash} \end_inset Note you may need to use quotation \begin_inset LatexCommand \index{quotation} \end_inset marks and backslash(es). \layout Description \noindent .*\SpecialChar ~ (dot\SpecialChar ~ and\SpecialChar ~ asterisk) \begin_inset LatexCommand \index{.*} \end_inset is used to match \begin_inset LatexCommand \index{match} \end_inset any string, \begin_inset LatexCommand \index{string} \end_inset equivalent \begin_inset LatexCommand \index{equivalent} \end_inset to * in standard wildcards. \layout Description \noindent *\SpecialChar ~ (asterisk) \begin_inset LatexCommand \index{*} \end_inset the proceeding \begin_inset LatexCommand \index{proceeding} \end_inset item is to be matched \begin_inset LatexCommand \index{matched} \end_inset \emph on zero \begin_inset LatexCommand \index{zero} \end_inset or more \begin_inset LatexCommand \index{more} \end_inset \emph default times. \begin_inset LatexCommand \index{times} \end_inset ie. n* will match \begin_inset LatexCommand \index{match} \end_inset n, nn, \begin_inset LatexCommand \index{nn} \end_inset nnnn, \begin_inset LatexCommand \index{nnnn} \end_inset nnnnnnn \begin_inset LatexCommand \index{nnnnnnn} \end_inset but not na or any other character. \begin_inset LatexCommand \index{character} \end_inset \layout Description \noindent ^\SpecialChar ~ (caret) \begin_inset LatexCommand \index{^} \end_inset means "the beginning \begin_inset LatexCommand \index{beginning} \end_inset of the line". So "^a" means find a line \begin_inset LatexCommand \index{line} \end_inset starting \begin_inset LatexCommand \index{starting} \end_inset with an "a". \layout Description \noindent $\SpecialChar ~ (dollar\SpecialChar ~ sign) \begin_inset LatexCommand \index{$} \end_inset means "the end \begin_inset LatexCommand \index{end} \end_inset of the line". So "a$" means find a line ending with an "a". \begin_deeper \layout Standard \noindent For example, this command searches \begin_inset LatexCommand \index{searches} \end_inset the file myfile \begin_inset LatexCommand \index{myfile} \end_inset for lines \begin_inset LatexCommand \index{lines} \end_inset starting with an "s" and ending \begin_inset LatexCommand \index{ending} \end_inset with an "n", and prints \begin_inset LatexCommand \index{prints} \end_inset them to the standard output \begin_inset LatexCommand \index{standard output} \end_inset (screen): \layout Code \noindent cat myfile | grep '^s.*n$' \end_deeper \layout Description [\SpecialChar ~ ]\SpecialChar ~ (square\SpecialChar ~ brackets) \begin_inset LatexCommand \index{[ ]} \end_inset specifies \begin_inset LatexCommand \index{specifies} \end_inset a range. \begin_inset LatexCommand \index{range} \end_inset If you did m[a,o,u]m it can become: mam, mum, \begin_inset LatexCommand \index{mum} \end_inset mom \begin_inset LatexCommand \index{mom} \end_inset if you did: m[a-d]m it can become anything that starts \begin_inset LatexCommand \index{starts} \end_inset and ends \begin_inset LatexCommand \index{ends} \end_inset with m and has any character \begin_inset LatexCommand \index{character} \end_inset a to d inbetween. For example, these would work: mam, mbm, \begin_inset LatexCommand \index{mbm} \end_inset mcm, \begin_inset LatexCommand \index{mcm} \end_inset mdm. \begin_inset LatexCommand \index{mdm} \end_inset This kind of wildcard specifies \begin_inset LatexCommand \index{specifies} \end_inset an \begin_inset Quotes eld \end_inset or \begin_inset Quotes erd \end_inset relationship \begin_inset LatexCommand \index{relationship} \end_inset (you only need one to match). \layout Description | \begin_inset LatexCommand \index{|} \end_inset This wildcard \begin_inset LatexCommand \index{wildcard} \end_inset makes a logical \begin_inset LatexCommand \index{logical} \end_inset OR \begin_inset LatexCommand \index{OR} \end_inset relationship \begin_inset LatexCommand \index{relationship} \end_inset between wildcards. \begin_inset LatexCommand \index{wildcards} \end_inset This way you can search \begin_inset LatexCommand \index{search} \end_inset for something or something else (possibly using two different regular expression s). You may need to add \begin_inset LatexCommand \index{add} \end_inset a ' \backslash ' (backslash) before this command to work, because the shell may attempt \begin_inset LatexCommand \index{attempt} \end_inset to interpret \begin_inset LatexCommand \index{interpret} \end_inset this as a pipe. \begin_inset LatexCommand \index{pipe} \end_inset \layout Description [^] \begin_inset LatexCommand \index{[^]} \end_inset This is the equivalent \begin_inset LatexCommand \index{equivalent} \end_inset of [!] \begin_inset LatexCommand \index{[!]} \end_inset in standard wildcards. \begin_inset LatexCommand \index{standard wildcards} \end_inset This performs \begin_inset LatexCommand \index{performs} \end_inset a logical \begin_inset LatexCommand \index{logical} \end_inset \begin_inset Quotes eld \end_inset not \begin_inset Quotes erd \end_inset . This will match \begin_inset LatexCommand \index{match} \end_inset anything that is not listed within those square \begin_inset LatexCommand \index{square} \end_inset brackets. For example, \emph on rm \begin_inset LatexCommand \index{rm} \end_inset myfile[^9] \emph default will remove \begin_inset LatexCommand \index{remove} \end_inset all myfiles* (ie. myfiles1, \begin_inset LatexCommand \index{myfiles1} \end_inset myfiles2 \begin_inset LatexCommand \index{myfiles2} \end_inset etc) but won't remove \begin_inset LatexCommand \index{remove} \end_inset a file with the number \begin_inset LatexCommand \index{number} \end_inset 9 anywhere within it's name. \layout Subsection \noindent Useful\SpecialChar ~ categories\SpecialChar ~ of\SpecialChar ~ characters\SpecialChar ~ (as\SpecialChar ~ defined\SpecialChar ~ by\SpecialChar ~ the\SpecialChar ~ POSIX\SpecialChar ~ standard) \begin_inset LatexCommand \label{useful-posix-characters} \end_inset \layout Standard This information has been taken from the grep \begin_inset LatexCommand \index{grep} \end_inset info \begin_inset LatexCommand \index{info} \end_inset page \begin_inset LatexCommand \index{page} \end_inset with a tiny \begin_inset LatexCommand \index{tiny} \end_inset amount \begin_inset LatexCommand \index{amount} \end_inset of editing, \begin_inset LatexCommand \index{editing} \end_inset see [10] in the \begin_inset LatexCommand \ref{references} \end_inset for further information. \layout Itemize [:upper:] uppercase \begin_inset LatexCommand \index{uppercase} \end_inset letters \layout Itemize [:lower:] lowercase \begin_inset LatexCommand \index{lowercase} \end_inset letters \layout Itemize [:alpha:] alphabetic \begin_inset LatexCommand \index{alphabetic} \end_inset (letters) meaning upper+lower (both uppercase and lowercase letters) \layout Itemize [:digit:] numbers \begin_inset LatexCommand \index{numbers} \end_inset in decimal, \begin_inset LatexCommand \index{decimal} \end_inset 0 to 9 \layout Itemize [:alnum:] alphanumeric \begin_inset LatexCommand \index{alphanumeric} \end_inset meaning alpha+digits (any uppercase or lowercase letters \begin_inset LatexCommand \index{letters} \end_inset or any decimal \begin_inset LatexCommand \index{decimal} \end_inset digits) \layout Itemize [:space:] whitespace \begin_inset LatexCommand \index{whitespace} \end_inset meaning spaces, \begin_inset LatexCommand \index{spaces} \end_inset tabs, \begin_inset LatexCommand \index{tabs} \end_inset newlines \begin_inset LatexCommand \index{newlines} \end_inset and similar \layout Itemize [:graph:] graphically printable \begin_inset LatexCommand \index{graphically printable} \end_inset characters excluding \begin_inset LatexCommand \index{excluding} \end_inset space \layout Itemize [:print:] printable \begin_inset LatexCommand \index{printable} \end_inset characters including \begin_inset LatexCommand \index{including} \end_inset space \begin_inset LatexCommand \index{space} \end_inset \layout Itemize [:punct:] punctuation \begin_inset LatexCommand \index{punctuation} \end_inset characters meaning graphical \begin_inset LatexCommand \index{graphical} \end_inset characters minus \begin_inset LatexCommand \index{minus} \end_inset alpha \begin_inset LatexCommand \index{alpha} \end_inset and digits \begin_inset LatexCommand \index{digits} \end_inset \layout Itemize [:cntrl:] control \begin_inset LatexCommand \index{control} \end_inset characters meaning non-printable characters \begin_inset LatexCommand \index{characters} \end_inset \layout Itemize [:xdigit:] characters \begin_inset LatexCommand \index{characters} \end_inset that are hexadecimal \begin_inset LatexCommand \index{hexadecimal} \end_inset digits. \layout SGML \layout SGML These are used with \layout SGML \layout SGML The above commands will work with most tools which work with text (for example: \emph on tr \emph default ). \layout SGML \layout SGML \layout Standard \noindent For example (advanced example) \emph on , \emph default this command scans \begin_inset LatexCommand \index{scans} \end_inset the output \begin_inset LatexCommand \index{output} \end_inset of the dir \begin_inset LatexCommand \index{dir} \end_inset command, and prints \begin_inset LatexCommand \index{prints} \end_inset lines \begin_inset LatexCommand \index{lines} \end_inset containing a capital \begin_inset LatexCommand \index{capital} \end_inset letter followed \begin_inset LatexCommand \index{followed} \end_inset by a digit: \begin_inset LatexCommand \index{digit} \end_inset \layout Code \noindent ls -l | grep '[[:upper:]][[:digit:]]' \layout Standard The command greps for [upper_case_letter][any_digit], meaning any uppercase \begin_inset LatexCommand \index{uppercase} \end_inset letter \begin_inset LatexCommand \index{letter} \end_inset followed by any digit. \begin_inset LatexCommand \index{digit} \end_inset If you remove the [\SpecialChar ~ ] (square brackets) in the middle \begin_inset LatexCommand \index{middle} \end_inset it would look for an uppercase letter or a digit, because it would become [upper_case_letter\SpecialChar ~ any_digit] \the_end