All are welcomed NOT to challenge me but to contribute or to pin-point my errors by mailing me at [email protected] .
Please take note that I assume those who read the below already know basic commands such as ls , cp , mkdir , cd and mv . If not, you can refer to Introduction to UNIX if in doubt.
Well that is no such a command called "rename" in unix unlike dos. But strange enough, the mv (normally known as "move") command does allow you to rename a file or a directory.
ie: mv foo foo1
whereby foo is the original name of the "file" and "foo1" is the new name
that I want to name it.
And the same goes for renaming a directory.
Removing a file with some odd characters
Just do a rm filename whereby "filename" is the name of your file.
I believe most of us know how to do the above and now I should share with you this misconception of mine when helping a freshie to delete a particular file. The freshie accidentally type a '-' when naming a file and he got something like this.
ie: Name of file is "-filename".
Will rm -filename solves this??? Well that is what I thought at
the first place but obviously I was wrong. That is because unix will think
that a "-" is part of the option and "filename" is an argument, so unix
will tell you that "-filename" is not found.
There are 2 ways to remove this file.
Do either a rm -- -filename or rm ./-filename. By the way if
I recall correctly, the first paragraph of the manual page of rm
already tell us that. So please do a man rm when in doubt. Strange
enough, I didn't encounter such similar problems when doing a "find" or a
"ls".
Removing a non-empty directory
Before I reveal the answer, I think I should mention the command rmdir first. The command rmdir only allows you to remove an empty directory for the benefit of your doubt. A rm -r directory will do the job in a recursive manner on the on the other hand.
But my story of removing a non-empty directory haven't end here. =) The above command rm -r may prompt you to ensure that you really want to delete a particular file. The next question is what if I have say a hundred files in my folder. How do I turn the so-called "interactive mode" off?
Do a rm -rf directory whereby directory is the directory you want to delete should do the job. BUT please do take note that -f here means to remove without prompting. That means if you have make a typo in a command, either nothing happens or the wrong directory will be deleted if you are that unlucky.
Well there is a number of way for us to find a file in unix. We can either choose the command prompt way or we can use the MidNight Commander to help us. I've yet to explore the MidNight Commander and you can contribute here by teaching me how to use it =).
I will only touch on the command prompt way of finding a file here. You can find a file by its "text-pattern" or its exact file name.
1. Finding a file by the command grep
What do I mean by a text-pattern???
ie: helloworld.java is the name of my file but somehow, I couldn't remember the name of the file but I only remember "hello" something.
Taking the assumption that you already know where is the directory of the file, you can do a ls hello* or a ls |grep hello to find it. Maybe it is time I should mention about the meta characters "*" and "?".
A "*" (aka 'Kleene closure') is actually a wildcard here. It represents anything. In the example above, the "*" represent "world.java". A "?" on the other hand also represent wildcard! =) The difference is that a "?" represent a wildcard character whereas a "*" represent a wildcard "string". Therefore you can also do a ls hello?????.???? if you like.
Now you may wonder how abt |grep hello? A "|" here is pronounced as pipe and it is one of the essence in unix. It means to pass in another command grep in this case. The command grep hello will help to "capture" the text-pattern hello and prints it on the screen if it can find it. Nothing will be printed if it can't find it.
Note:
You can do a grep text-pattern filename where "text-pattern" is what
you want to find in your file and "filename" is the name of the file. Be
careful not to supply regular expression to the "text-pattern". Examples of
regular expressions are ")", "(", "$", "/" and many others more. You can
always refer to the manual pages of grep whenever you are in doubt.
2. Finding a file by the command find
The command find comes in handy in this operation. It will find the file in a recursive manner and do the action that you specified in the command prompt.
ie: find . -name helloworld.txt -print whereby "helloworld.txt" is the name of the file that you want to find. This will print the path of the file onto the screen if the search is found.
If you want to say find all the java files in your home directory, after cd to your home directory, do a find . -name '*.java' -print.
If you want to use the find command to search a file by its text-pattern, you can also a find . \*helloworld\* -print.
There are several other things the find command can do and I have yet to explore it myself.
Changing the permission for a file or folder
For the benefit of those who don't know why is there a need to change permission for a file, try doing this. Do a mkdir /scratch/tmp1, then a chmod 744 /scratch/tmp1 and upload your file to this directory and ask your friend to download that file. I doubt your friend will be able to download it because of the wrong permission settings of the folder and file.
Whenever we do the command ls -l file, we should see something like the below.
ie:
drwx--x--x 2 lukmengs iscs99 512 Apr 12 21:53 picts
The "d" here indicates that "picts" is a directory. If it is a file, a
"-" will be shown then.
On the other hand, "r", "w" and "x" represents "read", "write" and
"execute" respectively.
The first set of field excluding the "d" represents the user. In the example above, the picts allows the "read", "write" and "execute" operations for the user because the 2nd to 4th bit were marked with "rwx".
The second set of field starting from the 5th to 7th bit represent the group. In the above examples, the picts only allows "execute" for the group because the "read" and "write" bit are not being marked.
The third set of field starting from the 8th to the last bit represent the others. In the example above, only the "execute" is allow for others.
You may wonder what are the "user", "group" and "others" are used for. The logic is this: If you want your file to be view by others take a picture file for example, you need to turn on the "read" in the others field. ie: chmod 711 mouse.jpg.
If you want others to able to download your file, do a chmod 755 music.mp3.
And now, if we look back at the "drwx--x--x" from the above again, the permission setting is interpreted as "pict" is a directory (from the 1st bit), users are allowed to read, write and execute, groups are only allowed to execute and others are allowed to executed.
If we exclude the "d" and see the above as a binary number, it is interpreted as 111 001 001. If we convert the 3 set of binary number as an octidecimal number, we get 711. Therefore we can use the command chmod 711 picts to achieve the same effect here. Alternatively, we can do a chmod go+x picts where "go" represents the group and the others and "x" means to turn on the executable bit for the above fields. A "-" and "=" on the other hand means to turn off and to assign the permission respectively.
One may ask: I just do a chmod 777 filename and I do not have to worry anymore. If you are thinking of that, then you are hopelessly wrong! =p
First of all, the problem may not be solved because the parent directory of that file may not be changed. If that is the case, then even a "777" will not take any effect. Secondly even if you have sucessfully did that, people can "steal" your file or worse, modified or delete your file.
The trick in chmod is to ensure that the parent's directory must allow others to execute first.
For example, I have a file named "hello.mid" which is inside my "public_html" directory which is in my home directory.
ie:
drwx------ 2 lukmengs iscs99 512 Apr 12 21:53 ..
drwx------ 2 lukmengs iscs99 512 Apr 12 21:53 .
drwx------ 2 lukmengs iscs99 512 Apr 12 21:53
My usual way of changing the modes is to do a chmod 711 ~/, chmod 711 ~/public_html and a chmod 755 ~/public_html/hello.mid.
Using the pipe "|"
Piping allow us to combine two or more commands in the command prompt. It is one of the important feature that I prefer unix over windows. =)
For the benefit of those who haven't see a piping of commands before, you can try typing banner hello|write myname and see what happen where "myname" is your own userid in your unix account. If you didn't reject message and nothing goes wrong you should get this:
Message from lukmengs on sununx.comp.nus.edu.sg (pts/1) [ Sat May 5 02:07:55 ] ... # # ###### # # #### # # # # # # # ###### ##### # # # # # # # # # # # # # # # # # # # # ###### ###### ###### #### <EOT> |
Take note that you can change the userid to any valid userid and use
the above command to give your friends a surprise. =)
ie: Do a banner hello|write lukmengs if you can find me online
provided that I did not reject messages.
If you think that you can combine any commands with the help of pipe, you are wrong. The command after the pipe must be able to take in a standard input from the the command before the pipe so that both commands can "co-operate" together to achieve the tasks you want.
Other examples of using the pipes are ls|less, ls|grep text pattern, w|grep textpattern and many others which I myself have yet to explore them.
Printing a file through unix
The command to print is lpr and the format of it is : lpr
Printer_ID filename.
ie: lpr psmr name.dat
Warning
However, do take note of the extension of your file. For example, if
your file type is of a html format, unix will print out the source code
of your html files! That is what happened to me when I was still a
freshie in School of Computing =(. What I got was a whole lump of html
codes which I could hardly read it. Do not print word document using the
above method too. I've seen a particular printer which prints piles of
binary codes which I believe is due to printing of the wrong type
through unix.
The advantages of printing in unix is that you can always send your print jobs at home and collect them on the next day because our school printers are opened 24 hours a day unless they are jammed or are running out of papers.
You may like this "feature" of printing in unix and would like to print html or word document in unix but wondering the way to get around with the problems stated above. The trick is you can always convert the file format to another in which unix are able to see them. Examples of such formats are ps and other text files. Conversion of word document can be done within the windows environment itself by making use of the printer driver to convert those office document into ps format. Html files on the other hand can be converted to ps format with the help of the html2ps utility which is covered in the later part of this page.
FTP-ing a file through unix
The DOS way of ftp-ing and the unix way of ftp-ing are quite similar except that I recently just realised that unix way of ftp-ing appears to be more powerful to me than the DOS way of ftp-ing.
1. The command "ftp"
The command to establish the connection to the ftp host is ftp
hostname or simply ftp, followed by open followed by
the hostname. The important thing to take note here is that the host
that you are connected to is called the remote host and the host where
you type your command is called the local host. This is important
because in the later part, I'm going to use this two terms extensively
to illustrate how to ftp.
2. The command "put"
To ftp from the local host to the remote host, we do a put
filename. To help the newbies to visualise better, you can take
"put" as "-->". In this example, the name of the file over the remote host
will automatically take the name of file in the local host unless a
third argument is being passed through.
ie: put filenameL filenameR
In the example above, the name of the file over the remote host will
take the "filenameR" as its name. Do pay attention to the file format of
the file while doing a ftp. When you are transferring an ascii file such
as ".txt", ".java", etc, do a asc before the "put" command. The
same thing goes for transferring a binary file. Do a bin before
you do a "put" command. Examples of binary files are "*.jpg", "*.class",
"*.out", "*.doc", etc. If the specifying of the ascii or binary file is
not done, you may get some funny results such as getting some "bar
codes" on local-host for your java files.
3. The command "get"
This command is exactly the opposite of the command "put". You can
visualise it as "<--". When we want to ftp a file from the remote host
to the local host, we do a get filename. The rest of it are exactly
the same as the "put" command.
4. The command "lcd"
Before I go into explaining the command "lcd", there is actually a
command "cd" which means to change the directory in the remote host.
Therefore you are right if you have now guessed that the extra "l" in
the "lcd" stands for local and it means to change directory in the
locate host. Just type a lcd to use it.
5. The command "mget"
To ftp multiple files from the remote host to the local host, we do a
mget filename1 filename2 ..... or we can make use of the wildcard
and do mget *.java *.c .... Take note that "mget" is not
recursive in nature. ie: If you do a mget *.* and there are
subfolders, "mget" will ignore the contents inside the subfolders. Do
remember to specify the "asc" or the "bin" before doing a "mget". By
default, the interactive mode is turned on for the ftp. This means that
ftp will prompt you whether to transfer the file everytime it searches
the file that is about to transfer. You can make use of this behaviour
in "mget" to help you to transfer files with long names if you do not
wish to type the long names. However, you can also turn the interactive
mode off which will be covered later.
6. The command "mput"
To ftp muliple files from the local host to the remote host, we use the
command "mput". The details are exactly the same as "mget" so I do not
wish to regurgitate how to use it here.
7. Turning off the interactive mode
There are two ways that I know of to do the above. You can supply the
"-i" argument for the "ftp" in the command prompt, ie: ftp -i
ftp.comp.nus.edu.sg or to make use of the "prompt" command inside
ftp. The "prompt" command will toggle the interactive mode. ie: If the
interactive mode is already on, typing "prompt" will turn it off. If the
interactive mode is off, typing "prompt" will turn it on.
The above commands should be able to let you to survive in ftp without the help of external programs such as cute-ftp or ws-ftp. You can always do a "help" in the ftp itself to find out more commands. To know what does a command mean, simply type a "help command" will do. You can always "man ftp" as a last resort in unix-ftp.
Redirecting a standard output to a file
I take the assumption that the shell you are is bash. The basic format of "writing" a standard output to a file is command > filename. An example will look something like this: java helloworld > tmp. If there is already a file named "tmp" in the current directory, bash will give you an error message telling you that the file already exists. You can either give another name to the file besides "tmp" or you can choose the appending the standard output to the file. The way to do this is java helloworld >> tmp taking the assumption that the file "tmp" already exists.
This technic is very useful in compiling especially if your program contains several compilation errors so much that you can't see all of them in a single page.
ie:
If you are running a buggy java program, you can do a javac foo.java
2> error to capture all the errors to the file "error".
Redirecting a standard input to a file
Before I show you the way to do it, your program must have read in some reading of standard input if you intend to use this method. Else there will be no effect on it.
ie:
To use this method for a java program, do a java foo <
input.txt.
Creating a symbolic link to a file
There are two types of links you can make in unix. They are namely hardlinks and symbolic links. Hardlinks are direct links to the files on the same file system. They will have the same file size with their origin. If their origin is being deleted, the hardlinks will still remain.
On the other hand, symbolink links are some kind of alias to their origin. They do not have the same file size with their origin and they are dependent of them. ie: If the origin is being deleted, the symbolink links will become useless.
You can do a "ls -l links" to see the difference between the hard links and the symbolic links.
The command to create a hardlink is ln file1 file2.
The command to create a symbolic link is ln -s file1 file2.
Creating an empty file
You can make use of the redirecting of output to help you to create an empty file. ie: > foo. Alternatively, you can use the "touch" commands.
ie: To create 4 empty files
touch foo foo1 foo2
Actually the command "touch" was not only meant for creating files. It is also meant for updating the timestamp of the files to prevent the deletion of files in some folders which is done by some cronjobs and some other purpose. Updating of timestamp of files should be covered later so please stay tuned to this page. =)
Finding which binary you are using
The binary I'm refering here are programs or utilities like emacs, ls, vi, and so on. If we try to use the "find" command to search for them, we will most likely end up with alots of permission denies. It is sometimes important to know where these utilities are because sometimes these things are not in our path or there are more than one version of them.
For instance, try typing the command "sml" and I bet some of you will get a bash not found error. But that doesn't mean that the binary "sml" is not in our unix system. You can do a whereis sml in the command prompt to print out the paths of sml. If the "sml" is found in the unix system, the paths will be printed out and vice versa.
Sometimes, there may be more than one occurences of the binary files in the unix system. For example, there can be more than one "ls" in our unix system. In this case, how do we know which "ls" are we using? We can do a which ls to print out the actual "ls" that we are using.
Last not not least, you may ask how do we include them once we have located them. The easiest way for me is to make an alias to them. ie: put alias ls='/usr/local/bin/ls' in your .profile and run your .profile. Alternatively, you can also include them in your path which will not be covered here. =p
Converting a pdf file to ps file
If you are in a X-windows environment, you can actually view your ps with the help of the ghostview program. But if you have a pdf file, you probrably unable to find the acrobat reader to help you to read the file. However, you can always use the command pdf2ps to help you to convert the pdf file to a ps file.
ie: pdf2ps file1.pdf
Unzipping a file in unix
There is a unzip command in unix to help us to extract files
automatically from a zip. Simply do a unzip file.zip to unzip the
file will do. =)
However, if you have encountered the extension "gz", you can use the
gunzip to uncompress it. It works as the same way as "unzip".
Dealing with files with the extension "tar"
If you ever get a file with the extension "tar", you can always use the "tar" utility to help you to extract it.
tar xvf foo.tar
The "x" option will help you to extract the file.
The "v" option will turn on the verbose mode and provide you with
information when extracting the file.
The "f" option will tells the "tar" to name the directory of the
extracted file to that of the name of the tar-ball file.
Checking the differences between the contents of 2 ascii files
Type diff file1 file2 to do the above. If the 2 ascii file are exactly the same, nothing will be printed out. On the contrary, the differences between the files will be printed out on the screen. This is useful for checking if the file is being corrupted during the FTP too.
Checking the differences between the contents of 2 binary files
There is no clear cut way that I've know of to do the above. However, there is a md5sum program that helps us to generate a unique number for the binary files. ie: If 2 binary files are exactly the same, they will share the same md5sum number.
The command to do a md5sum check is md5sum foo where "foo" is the name of your binary file. I will do this step again for the other binary file that I'm going to check. Next I will see the differences between the md5sum. If there is any discrepancy, it will be printed out on the screen.
ie:
md5sum foo < file1
md5sum foo1 < file2
diff file1 file2
Click here for the local copy for the dos
version of the md5sum program.
Timing how long a process takes to run
The time command can help us to achieve the above. However, it will show us 3 types of timing namely real time, user time and system time.
ie:
lukmengs@sun450:~$ time java test SunOS real 0m0.419s user 0m0.210s sys 0m0.160s |
Displaying a list of process that you run
The above can comes in handy in finding all the process ids of yours so that it is easy for you to kill a particular process. You can do a ps -fu userid on the command prompt to display all your pids. Alternatively, you can type jobs on it. Do take note that different hosts have different processes of yours. If you have cleared all the processes on one host, it doesn't mean that you have cleared them on other hosts.
I am sorry to say that I do not know of any way to kill all my processes in all hosts. The closest that I know of is to do a kill -9 -1 which is to kill all the processes on the host that you login.
Enabling a log file in unix
You can actually keep a log file in unix by typing the command "script" on the command prompt. This will bring you to the "sh" shell and you can do most of your work there. Press "Ctrl-D" to escape out of the script.
Do take note that all your alias will be gone when you are in a "sh" shell. You can chmod for the typescipt and run it by typing ./typescript to view your log file.
Aliasing and unaliasing a command
If you found a particular command that is too long or too difficult to remember for you, you can always do an "alias" to the command. This means that you can substitute the command with the key mappings that you like.
ie:
alias ls='/local/bin/ls --color=yes'
In the above, the user simply can replace the long command by merely typing "ls" in the command prompt. If you want the alias to stay everytime you login, you should include it in your $HOME/.profile.
Take note that alias should not be abuse because it can cause alot of "logical errors" if it is not used properly. For example if I have alias the command "finger" with "finger -m", I will encounter a logical error if I try to do more advance 'fingering' like finding all the users with the surname 'Tan' in the machine.
Therefore, please do hesitate to have alot of alias because at the end of the day, you can be the one who is confused. =D
To know all the alias that you have, you can simply type the command "alias" on the command prompt and every alias will be shown on the screen.
If you do not want the alias anymore, you can always do an unalias to it. ie: Type unalias ls on the command prompt if you have did the alias of ls from the above example.
Bannering a text as a message
You may have wonder how do people type words like the below:
# # ###### # # #### # # # # # # # ###### ##### # # # # # # # # # # # # # # # # # # # # ###### ###### ###### #### |
This is simply done by the command banner HELLO. Have some fun with it. =)
Rejecting a message
If you do not wish to be disturbed to chat or talk to anyone when logging in, you can do a mesg n in the command prompt. Alternatively, you can put "mesg n" in your $HOME/.profile so that the system will automatically reject message whenever you login.
However, do take note that you cannot reject message from the sysadmin and yourself. =) If you have enable talk in pine and you are still inside pine, others are still able to chat or talk to you. So please so remember to disable the talk if you want to be alone in pine.
The next question you may ask is how do one knows that his/her message status? One can either do a "finger" of himself/herself or he/she can type mesg on the command prompt to print the status of the "mesg".
To disable the "mesg n", you can always do a mesg y on the command prompt.
Logging from one host to another host
If you are in say sun450 and you wish to login to another host say sunjava, you can do a telnet, rlogin or a ssh to it. The below example will take the assumption that you are in the sun450 and you wanted to login to decunx.
To telnet to decunx, you can always type telnet decunx on the command prompt. The command telnet will prompt you for your login name and password though.
Alternatively, you can do a rlogin decunx which indicates a remote login to the system. You will exempted from typing your login name but you still need to type in your password for it. From what I've read from other websites, you can bypass the password by creating a file named .rhosts but I've couldn't make it for this one. =p Please tell me how you did it if you have succeeded in making the .rhosts works. =)
Lastly, you can do a ssh decunx on the command prompt. If you have generated the private and the public ssh keys in your home directory, you will be exempted from typing your login name and password. To generate the private and public ssh keys, please refer to http://www.comp.nus.edu.sg/~lukmengs/unix/pine.html#bypass . Otherwise, you will still need to type in your password everytime you use ssh.
Logging from one user to another user
If you see a friend who has already logged into the unix system and you have not even found a terminal to login, you can always ask your friend to let you login using his unix account. You actually need not open another telnet session again. The advantages of doing this is that your friend can resume his/her work immediately after you have logged out of the terminal.
To do the above, type the command su -f youruserid in the terminal and your login password will be prompted. The command "su" represents 'substitute user'. If no arguments are being passed in using this "su" command, the system will assume that you are trying to login to the root account.
Including the '.plan' and '.project' in your profile
Have you ever wonder how do people manage to "print" some information about themselves whenever you "fingered" them? Well, the trick to do that is to have a $HOME/.plan and $HOME/.project files. The "finger" command will look for the .plan and .project files in your home directory whenever you are being "fingered".
Simply open a new file and type in something and name it as a .plan will do the wonders as mentioned above. However, you may need to chmod.
ie:
lukmengs@sun450:~$ pico ~/.plan
Type: "Hello, welcome to my profile
Exit and save pico.
Do a chmod 711 ~/ followed by a chmod 644 ~/.plan and
there you have it. =)
If you are still not satisfied, you can have a $HOME/.project file. However, the .project file takes in only one line of words. If your .project contains more than one line, the subsequent lines will be ignored. After writing to the .project file, please remember to do a chmod 644 ~/.project.
Using the utilities in "nuslib"
Nuslib is the place where the SoC "goodies" are found. Examples of these are goodies are the proggies "spy", "spy2", "arf", "html2ps", "micq" and many others more. These utilies are friendly and fun to use. However, do not take not all the unix hosts support them. Do note that some of the utilies are supposed to run on a "X" environment too.
To use the utilies in the nuslib, it is best for you to this line in your $HOME/.profile.
. ~nuslib/bash.all
Aftering activating the .profile by the command . ~/.profile, you are ready to use the utilities in them. I would only cover the utilies "spy/spy2", "arf" and "micq". You can explore the rest of them on your own. Some are quite enjoyable.
1. Using the utility "spy/spy2"
As the program's name suggested, the program "spy" will spy the name
list in your "name.dat" file in your home directory and reports their
location to you. Therefore you need to create a file named "name.dat" in
your home directory for the "spy" to read in.
The format of your "name.dat" should like the below:
userid1 friend1 userid2 friend2 userid3 friend3 userid4 friend4 . . . |
Alternatively, you can exclude the "friends" part.
ie:
userid1 userid2 userid3 . . . |
After saving and exit the above, you are now ready to type "spy" in the command prompt to spy your friend. You should get something like the below.
Spy(c) By Motley Crue
lqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Userid x Full Name x TTY x Location Of User x
tqqqqqqqqqqnqqqqqqqqqqqqqqqqqqqqqqnqqqqqqqqnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu
x cheongk1 x x pts/0 x mcns175.docsis80.singa.pore.net x
x tanhouhe x f10 x pts/14 x mcns13.docsis71.singa.pore.net x
mqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
|
You can also type "spy2" on the command prompt and compare the differences by yourselves.
2. Using the utility "arf"
The "arf" program is some kind of watchdog in the unix system. If your
friend have gone online or offline, "arf" will remind you by printing the
userid or your friend's name on the screen. The difference between the
"arf" and the "spy" is that "arf" will inform you that your friends had
login or logout while the "spy" will inform you where your friends are or
what are they doing.
If you already have the "name.dat" as in the "spy" program above, just put arf -f name.dat in your $HOME/.profile. If you don't have it, please refer to the "spy" program paragraph and follow the instructions. You can read the "arf" documentation by typing arf --help on the documentation and explore the rest of the functions yourself.
3. Using the utilty "micq"
The micq program program is a kind of text cum web-based icq that
connects itself to the mirabilis server. It does support quite a number
of functions such as authorize users, changing status of users, random
chats and others. However, it does not support file-transfer, multiple
chat and functions that need the "X" environment.
3.1 Starting and quiting micq
To start the micq program, simply type micq on the command
prompt. Micq will then prompt you for your micq number and password. To
quit the micq, simply type "q" on the micq's command prompt.
3.2 Adding users to micq
To add users, you can either type "add <uin> <nick>" on the
micq command prompt or you can add the following to the $HOME/.micqrc
file: "<uin> <nick>".
3.3 Sending icq messages to your friends
To send a new message to your friend, type "message <uin>" on the
micq command prompt. If it is not a new message, ie: it is the second
message, you can do a "a <Enter>" followed by your message and "."
on the micq command prompt.
3.4 Replying icq messages to your friends
To reply to your friend's message, simply type "r", your message and a
"." will do the trick.
3.5 Sending url to your friends
This is slightly more complicated than replying messages to your
friends. Do a url <uin> <url> <message> will do.
3.6 Clearing the screen on micq
You may need to do this if there are alot of messages coming to and fro
in micq. Simply type "clear" and press enter to do the above.
3.7 Finding help in micq
Type <help> in the micq command and you should be able to see the
below.
Please select one of the help topics below. Client - Commands relating to micq displays and configuration. Message - Commands relating to sending messages. User - Commands relating to finding other users. Account - Commands relating to your ICQ account. Micq> |
If you want to look for more information for a topic say client, simply type help client on the micq command prompt will show you a whole list of commands relating to client and the format of the command and its explanation.
ie:
verbose # Set the verbosity level ( default = 0 ). clear Clears the screen. sound Toggles beeping when recieving new messages. color Toggles displaying colors. q Logs off and quits auto Displays your autoreply status auto [on|off] Toggles sending messages when your status is DND, NA, etc. auto |
If you want to look at the history of you and your friend's messages, I will say that it is abit cumbersome because you will need the uin of your friend. The uin of your friend in the micq list can be obtained from the .micqrc in your home directory. Next, you can go into a folder named micq.log in your home directory and you can find your the log file of the conversation of you and your friend there. The name of the log file will be "<uin of your friend>.log".
Redirecting your mails in unix
To redirect your mails to other mail accounts such as yahoo, you need to create a file named ".forward" in your home directory. After doing so, you just need to type in the name of the mail account that you want to redirect.
Contents of the ".forward" file
xxx.yahoo.com
Take note that this method may not be able to work on your hotmail account. Don't ask me why because I don't know either. 8P. Besides that, only subsequent incoming mails after the creation of this file will be directed. Please be patient and wait for some time if you are very anxious to see the result because you will need to wait for the cron job to realise the existence of your ". forward" file and do the appropriate actions to it. After doing the above, the subsequent mails will not be kept in your inbox in unix unless you do something similar like the below.
Contents of the ".forward" file
xxx.yahoo.com
xxx.comp.nus.edu.sg
"xxx.comp.nus.edu.sg" is the email address of your own SoC email
account. Do not worry that the above will run into an infinite loop
because the mail daemon program will be smarted enough to not to fall
into this trap.