sed '/text_which_is_a_placeholder_in__my_html_file/r text_file_to_insert.txt' index_master_file.html > index.html
gawk
(=GNU awk. The awk command is a traditional UNIX tool.) A tool for processing text files, in many respects similar to sed, but more powerful. Perl can do all that gawk can, and more, so I don't bother with gawk too much. For simple tasks, I use sed, for more complicated tasks, I use perl. In some instances, however, awk scripts can be much shorter, easier to understand and maintain, and faster than an equivalent perl program.
gawk is particularly suitable for processing text-based tables. A table consists of records (each line is normally one record). The records contain fields separated by a delimiter. Often used delimiters are whitespace (gawk default), comma, or colon. All gawk expressions have a form: gawk 'pattern {action}' my_file. You can ommit the patern or action: the default pattern is "match everything" and the default action is "print the line". gawk can also be used as a filter (to process the output from another command, as used in our examples).
Example. To print lines containing the string "1024", I may use:
cat filename | gawk '/1024/ {print}'
Like in sed, the patterns to match are enclosed in a pair of "/ /".
What makes gawk more powerful than sed is the operations on fields. $1 means "the first field", $2 means "the second field", etc. $0 means "the entire line". The next example extracts fields 3 and 2 from lines containing "1024" and prints them with added labels "Name" and "ID". The printing goes to a file called "newfile":
cat filename | gawk '/1024/ {print "Name: " $3 "ID: " $2}' > newfile
The third example finds and prints lines with the third field equal to "peter" or containing the string "marie":
cat filename | gawk '$3 == "peter" || $3 ~ /marie/ '
To understand the last command, here is the list of logical tests in gawk: == equal, != not equal, < less than, > greater than, <= less than or equal to, >= greater than or equal to, ~ matching a regular expression, !~ not matching a regular expression, || logical OR, && logical AND, ! logical NOT.
cvs
Concurrent versions system. Try: info cvs for more information. Useful to keep the "source code repository" when several programmers are working on the same computer program.
cervisia
(in X-terminal). A GUI front-end to the cvs versioning system.
file -z filename
Determine the type of the file filename. The option -z makes file look also inside compressed files to determine what the compressed file is (instead of just telling you that this is a compressed file).
To determine the type of content, file looks inside the file to find particular patterns in contents ("magic numbers")--it does not just look at the filename extension like MS Windows does. The "magic numbers" are stored in the text file /usr/share/magic--really impressive database of filetypes.
touch filename
Change the date/time stamp of the file filename to the current time. Create an empty file if the file does not exist. You can change the stamp to any date using touch -t 200201311759.30 (year 2002 January day 31 time 17:59:30).
There are three date/time values associated with every file on an ext2 filesystem:
- the time of last access to the file (atime)
- the time of last modification to the file (mtime)
- the time of last change to the file's inode (ctime).
Touch will change the first two to the value specified, and the last one always to the current system time. They can all be read using the stat command (see the next entry).
stat filename
Print general info about a file (the contents of the so-called inode).
strings filename | more
Display the strings contained in the binary file called filename. "strings" could, for example, be a useful first step to a close examination of an unknown executable.
od
(=octal

