% uncompress foobar.tar.Z % tar xf foobar.tarA2. How do I extract files from *.tar.gz?
*.tar.gz means it has been tape-archived (tar) up, and then gzipped. So
to extract, do the reverse:
(a) using zip utility:
you should find sufficient help via
(b) using tar:
What is normally done after tar is to compress the archive. Various
utilities can be used:
At article level (this is where you can see the contents
of a message), press the following keys:
B2. When I start up bbs, all the newsgroups were "missing".
What happened and what should I do?
The default setting of the tin newsreader is to display only groups
that contain at least one article which you have not read. What happened
is that there is no new articles in any of the newsgroups that you have
not read. That is why no newsgroups are displayed.
If you want all newsgroups with and without unread articles to be displayed,
press 'r'.
You can change this default setting by editing an appropriate line in
the file tinrc which resides in your .tin subdirectory.
(Pressing 'r' at the newsgroup level toggles whether tin should display all
subscribed newsgroups or only those which contain at least one article which
you haven't read.
NO. This is because there's no instant update of new article postings in tin.
You have to come out to the main menu and go back into the newsgroup again to
see your article. If you stay in the newsgroup without exiting to the main menu
then you'll forever not able to see your own article, or somebody's new
followups.
B4. How do I delete/modify an article I posted?
To delete an article you have posted, press 'D' at the article level.
There is no shortcut key in tin for you to re-edit your article and post
it up again. You can however accomplish the same thing by playing around
with the posting headers.
Some users mistakenly use Control-K to delete their postings in tin, not
realizing this is actually the keystroke for accessing the auto-kill menu.
(From this menu, users can configure tin to automatically kill articles
with specific headers or from specific authors.) As a result, it may happen
that the user accidentally set some kill options unknowingly. Subsequently
the user discovers that "suddenly there is very few or no articles in
the bbs recently " or "How come I cannot see my own posting" (the case
when the user's own name is in his own kill-file.)
B6. I have fallen into the "Control-K trap". What should I do?
Delete your kill-file:
Set the 2 environment variables - NAME and ORGANIZATION:
in bash,
Most probably, you did not specify binary transfer before getting the
file. To do so, type 'bin' at the ftp prompt before you initiate the get.
The same thing applies for gifs and other non-text files.
C2. How do I upload/download files via a modem connection?
Segmentation fault is caused by using a pointer that is pointing to a
memory location that does not belong to the user program (or not allocated
to the user program).
A common cause of this error is that the programmer forget to allocate
the necessary memory. For example, the code below should cause a segmentation
fault.
D2. I got a bus error running my program. What does it mean?
The general reason for a bus error is changing a pointer to hold an odd
address. If you have any pointers to type char then that might be something
to look at. More often it is making a pointer to type char point at some
group of int. The compiler will see the int as being something it can use
the faster address registers with (address registers must be word-aligned on
the SparcServer) but it will see the pointer to type char as something which
can be incremented by ones. The first time you increment that char pointer
you will get a bus error.
One reason as to why it works on one machine and not another is differences
in the way the compliers (forced by architecture) have created the executable.
On one machine, you got lucky and your program worked. On the other machine,
the error appears because of the bounds problem.
Or it maybe an alignment problem. Some machines do not allow access to
misaligned data, which can cause bus errors. Some compilers have an option
like -misalign that can help.
For more questions and answers on C, you may wish to refer to
Usenet's C FAQ
To forward mails from another account, such as leonis/cobra (computer center),
create a file in the home directory of your leonis/cobra account named
.forward. Please note the dot in the filename. This file should contain your
DISCS email address. For example, at your leonis prompt, you may do the
following:
Set the environmental variable EDITOR to pico or vi. The application has to
read this variable to be effective, most programs do.
in bash,
Please approach the ground floor machine room operators. They may help
you recover your files if they are not created after the last backup.
% gunzip foobar.tar.gz
% tar xf foobar.tar
on some OS (linux, for eg.), you can do this via one step:
% tar zxf foobar.tar.gz
A3. How do I compress/backup/store entire directories and
files?
% zip -help
This is similar to the well known pkzip/pkunzip utilities on PC.
% tar cf foobar.tar <directory or files to be stored>
'tar', short for tape-archive, was implemented for tape backup (what'd you
expect?). The option 'f' tells tar to expect a disk file instead. The
option 'c' informs tar to create an archive. tar will recursively step
through the specified directories and store the files/directory structure
as it is. This means the end result is just a huge concatenated
file containing all your specified files, nothing fanciful.
% gzip foobar.tar OR
% compress foobar.tar OR
% zip foobar.tar
A4. Where may I find gzip/gunzip utilities?
(B) BBS/Tin Newsreader-related Qns
B1. Basic commands for posting/responding
( Please use the newsgroup iscs.test for test messages.)
Pressing 'r' at the thread level toggles whether tin should display
all threads or only those threads which contains at least one
article which you haven't read.)
B5. What is the "Control-K trap"?
% rm ~/.tin/kill
B7. In tin/rtin/bbs, how does those fanciful names and
organization headers appear?
% export NAME='myname'
% export ORGANIZATION='my_organization'
in tcsh,
% setenv NAME 'myname'
% setenv ORGANIZATION 'my_organization'
You can put these commands in your .profile (for bash) or .login (for tcsh)
so that they are executed every time you logged in.
(C) File-transfer-related Qns
C1. I have just gotten a zip file via ftp. But I am unable to unzip it.
What went wrong?
(D) C-programming-related Qns
D1. What is "Segmentation fault"? What does it mean?
#include
The problem with the above program is that, the pointer cp has not
been allocated a block of memory yet. So, cp would initially contain
some arbitrary value, pointing to some abitrary memory location. As a
result, the function printf would try to access this memory location
which does not 'legally' belong to this user program, causing a 'core
dump'.
What then is the correct way to go about using pointer and allocating
the memory? Well, let's take a look at the code below.
#include
Yes, you will have to use the function malloc(size_t) to allocate a
block of memory to the pointer. (Strictly speaking, it stores the address
of the memory block into cp.) And, you would get the output of ABCD on a
line by itself.
(E) Other general/miscellaneuos Qns
E1. How do I forward my mails from another account?
% cd ~
% cat > .forward
myname@iscs.nus.sg
<CTRL-D>
%
All mails sent to this account will be forwarded to myname@iscs.nus.sg -
technically speaking you can of course set another username instead of your
own. In addition, the .foward file may contain more than one address.
E2. How to set pico, joe or vi as my default editor?
% export EDITOR='myeditor'
in tcsh,
% setenv EDITOR 'myeditor'
E3. How does one go about removing files such as "-a"?
% rm -- -a
OR
% rm ./-a
E4. I accidentally deleted some very important files. How
can I recover them?
E5. How can I convert a postscript file, with .ps extension,
to a normal text file?
% ps2ascii mypsfile.ps
or
% pstotext mypsfile.ps
Note that ps2ascii does not work for encapsulated postscript (eps) files,
which may still have the .ps extension.
E6. Singapore NRIC number checksum algorithm
>From tantc@sunA.iscs.nus.sg Sun Aug 4 14:46:40 1996
From: Tan Tuck Choy
Last modified: 31 December 1995
Sat Aug 3 13:38:34 GMT-8 1996
ISCS Unix Frequently-Asked-Questions / NUSLib /
nuslib@iscs.nus.sg