Some Unix stuffs that I've tried


Links within this page

1.   Some common Unix commands

Google BSD

2.   Some powerful Unix text editors that I've tried

3.   Some goodies programs that I used   [Local copies for Windows]

4.   Some bash scripts that I have written  


1) Some common Unix Commands (Quick Reference)

Welcome to the Unix section of my web-page. I've always encountered numerous amount of problems when I was a freshman in School of Computing. Even till now, I would say I still come across several terminologies that I've never come across before. I'm not an expert in this field (in fact, I'm still a newbie =)) but I've decided to contribute my part in writing some of the mini-howtos for utilities like Pine and Pico because I've realised that the school didn't actually come to write the documentations for these programs. I've decided to use plain colors throughout the rest of the web-pages in this section because I feel that it is easier to search the information in this way.

Last but not least, I hope this few web-pages of mine can really help those newbies who are really interested in learning. Please feel free to pin-point the errors in this section too.

The below link is scanned from the year 99's survival guide.
I personally feel that this is quite a comprehensive command guide for a newbie in Unix.

To be down-loaded in word format
To be viewed in html format

Because I couldn't find any "how-tos" for any of the below in our own faculty web site, I have decided to contribute my part here by writing a few paragraphs of "how-tos".

The below link which is written by me provides some tips in using 'Pico'.
Pico

The below link provides some tips in using Pine.
Pine

The below link which is written by me provides some tips in using 'BBS'.
(by the command 'bbs' in Unix, not using outlook express or Netscape)
BBS

The below link is some experiences of mine when using Unix commands.
Mini-Howtos

return top


2) Some powerful Unix text editors that I've tried

The opinions below are written for the intention of those who feels that the editor Pico is too lousy for them and would like to challenge themselves with other alternatives. However, I must warn newbies that the learning curve for most of the editors below are much steeper compared to that of the Pico. However, they will get the benefit returns in the long run.

Vi:
A powerful editor that is nearly 100% found in every Unix machines. It makes used of two basic modes; command mode and insert mode. In short, insert mode enables one to input data into Vi in various ways and command mode helps one to make use of a vast array of commands including external Unix commands for editing purposes. It is able to switch selected lines from upper case to lower case and vice versa, able to substitute the selected word with the new word throughout the file, able to navigate in many ways, match brackettings, able to do shell command, deleting paragraphs, ......etc.

It is the second editor that I've tried other than Pico. I took quite a long time to learn this though. But it is quite rewarding once you master the skill of memorising that few commands. It is in fact more powerful than Windows Notepad or Dos Editor but of-course, the cons about it is the unfriendliness in using it. ie: If you don't know how to do a particular operation, there is almost no way that you can guess it because there is no command or any other equivalent to help you. But yes, you can always do a 'man vi' but unfortunately, I find the manuals not comprehensive enough to solve my problems. What I did when I get stuck in Vi was to search the web for the answers.

Thanks to Jerry, Siow, and err I've forgotten who else are being left out ..., who showed me the manual pages of Vi when I got stuck-ed in helping the freshmen myself. That was also the first time that I was exposed to Vi. And it was Mr Aaron who convinced me (through BBS) that it is a powerful editor that is worth to learn.

The below is a Vi tutor(runs in Unix Environment) which was contributed by Niko Gunadi.
vi.zip

Vim (Vi IMproved):
An improved version of Vi with many additional features such as syntax highlighting, "C" indentation, mouse enabling, etc. This is also my preferred Unix editor. And it is Vi-compatible. That means I don't really need to re-learn Vim after learning Vi. Sounds great doesn't it???

As compared to Vi, Vim itself got a 'vimtutor' which helps you to get adapt to Vim as fast as possible. It can be invoked by typing ":help tutor". Besides that, Vim has an online "manual" so you can always refer to it whenever you get stuck somewhere. So in a way, it is a bit more user-friendly and easier to learn than Vi. The visual mode in Vim (this mode is not present in Vi) has made itself much more superior than Vi in my opinion.

I have nearly forgotten to mention about the G-Vim for those who can't tolerate text-based editors. It is actually the GUI-version of Vim and you need to start the X-Windows first before using it. It can be invoked by typing "gvim" on the command line. Well, G-Vim looks cool but I still prefer Vim after attempting it for a few times because Vim is faster and less prone to crashes as compared to G-Vim. But the good thing about G-Vim is that it is much more user-friendly than Vim because there are options and menus on top of the editor to help you to get around with it. G-Vim is more "Windows-like" and I think that is fairly important for a beginner in Unix.

Well the credits should go to Eric Prataman who showed me how powerful Vim was. Then it was Andy who convinced me (through BBS again) that I should "give up" on Vi and start to pick up Vim instead.

Emacs:
Another totally different yet powerful editor that has many advance features such as interpreting the language lisps, highlighting matching brackets, syntax-highlighting, reading and posting e-mails and even playing games. Unlike Vi or Vim, it is "mode-less" and makes use of so-called meta keys in its various operations. If you have started the X-Windows, Emacs by default will load up the GUI version with various menus and buttons on it. If not, you can still use the text-based version of it in which most beginners may not feel comfortable with this one. The Emacs tutor can be invoked by pressing Ctrl-h followed by a "t" to help you to get adapt to it.

Actually I don't really know how to use this one 8P

X-Emacs:
X-Emacs is the GUI version of Emacs with some additional features built on. You must start the X-Windows before invoking this program as it is strictly the GUI version of Emacs. You can start it by typing "xemacs" on the command line. Beginners may wish to adapt to this one as you can learn it instantly. You don't need to go through any tutors and at the same time have the power of Emacs. However, the draw back is that it is pretty resource hungry.

It was Waimun who taught me how to use this editor in the X-Windows environment during one of the programming assignments. This comes in very handy especially when you are coding some functional languages such as scheme or lisps which contains hundreds of brackets that may (or should I say will) becoming confusing to you. I quite like the way Emacs presents its matching brackets in different modes.

Maybe I should mention about some of the games that I've played on X-Emacs before. But please do not expect games like "Diabolo" or "Counter Strike" to be inside X-Emacs. I've played Tertris, Eliza, and some other very simple and small games which I couldn't remember what they are.

Joe:
Joe is a hybrid of Pico, Vi, Emacs, WordStar, ... (5 editors). Personally, I find it much easier to adapt than Emacs and Vim. You don't need to go through any "tutors" to learn it. One just needs to type "joe" to start it. A help menu can be found by pressing Ctrl-k followed by a "h" and you are ready to learn it instantly. Beginners may consider replacing Pico with Joe. One can also invoke the "Pico version" of joe by entering the command jpico. This can come in handy if you are used to the way Pico edits. In this way, you need not learn other editing styles yet can hold more editing power.

I've yet to explore the more advance functionalities of Joe though. I'm still trying to do syntax highlighting, bracket matching and inputing non-ascii words at this point in time. Do inform me by emailing if you have discovered the way to do it.

1. Which one to choose from?
Well, you should choose either Emacs or Vim if you are willing to invest in learning. Personally, I would prefer Vim over Emacs because of it's size. Okay it's a bit unfair to compare like this but I still prefer Vim because I learn it first 8P

Why Emacs or Vim??? Simple, because they are powerful. =)

If you want something easier to learn yet more powerful than Pico, you may try X-Emacs/Emacs or G-Vim on the X-Windows. However, do note that they are resource hungry; if a server is busy and many people are using say X-Emacs on it, the server may be overloaded and your editing will become extremely slow and may even crash. A safer alternative will be using the text-based Joe in my opinion. (Text-based Emacs, Vi and Vim just eat as much resources as Pico and Joe)

2. Tips on learning these monsters
Don't get scared off when you see the long scroll-bars or the thousand pages of manual. From my experience, you just need to get to know a few pages of the manual and you can start off already. Take your time to learn them too. ie: Try not to learn the editor and do your programming assignment in it at the same time. In this way, even if you make a fatal error, you won't give up on learning it.

Last but not least, practice, practice and practice. =)

3. The above-mentioned are just text-editors
They are not word-processors. Well, what I mean by that is Vi, Emacs or whatever are not designed to do formatting, decorating or whatever fanciful things on files. They are designed to help you to write programs more easily. So do not try to put images using Vim or to do something like that to the file.

4. What's so great about these editors?
At this point in time, you may wonder; since you already know Pico, why the heck I tell you about all these editors??? Well, consider the following cases.

Case one:

Can you tell whether which pair of brackets belong to which here?

(defun display (x)
   (cond ((null x) (terpri) 'end)
      (t (show (car x)) (display (cdr x)))))

In such a short paraphrase, you may have little problem with it. But do you know how tough it is to do a bracket-matching by inspection of a file that contains hundreds of such lines? How are you going to do that with Pico?

Case two:

class Librarian { character gender; ... }
// change to
class Librarian { String gender; ... }

In another file which is about two thousand lines long, you have lots of such Librarian instances with the "character gender". You need to change all of them to "String gender" because of the change in the Librarian class. How are you going to solve this changing of type problem elegantly by using Pico?

Case three:

You are writing a system which comprises many files which in turn contain several functions. In which, you may have used various functions from different files in a single program. With Pico, how are you going to know which function is from which file?

Do note that the above can be done quite easily using Vi/Vim or Emacs. I'm not sure about Joe though.

5. Why doesn't I write the "How-tos" for these editors?
It is because these editor manuals are already very abundant in the web. You can just click on the icons below to search for their manuals. I couldn't find any logos for Joe and the website for Pico is actually in Pine. I still can't find the official website for Joe til now. Strange ...

Vi homepage       Vim homepage       X-Emacs homepage       Pine homepage       GNU homepage      

return top


Some goodies programs that I used (Local copies for Windows)

The programs below are not for Unix but they do help you to connect to and do your work in Unix environment. All the programs below are local copies. =)

This is a ws-ftp program. Actually I put it here for my own down-loading purposes. 8P

If you don't like the Microsoft telnet client program, you may wish to down-load a local copy of the SSH client that I'm using now over here. If you don't have a program that un-zip this program, click here to down-load the Winzip program.

This is a local copy of the Windows md5sum program. It is used for checking for any corruption of the file during the file transfer. Read the manual pages of md5sum in Unix to use it.

Ha! I've discovered a small and good telnet/SSH client program called Putty (Recommended by Polar Bear and Wire in BBS Unix folder). It is not only free, small enough to be keep in a floppy, it also supports our school SSH (version 1) login. =) But I must warn you that this telnet/SSH client is not so user-friendly as compared to others.

For those who are interested in getting them, click the below links to get the local copy of them. Please use Winzip 8.0 to uncompress and extract the archive after down-loading the file.

For Win95/95/ME/NT and 2000 users:
putty.tar.gz

Side Note:
The executable Putty programs are being tape-archived (tar), compressed and down-loaded without the permission of the original authors. However, no recompiling was done because I don't even know how to at the very first place. 8P

Courtesy taken from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html .

return top


Some Bash Scripts that I have written

Most of the Bash scripts written here are for my own usage. In fact, I touch Bash scripts because I wanted to understand how to work around with my .profile or .bash_profile in Unix or Linux account. This explains for the birth of the "profiler" at here.

Note: This is meant for those who doesn't know how to write his own profile. Click the "profiler" in the link, remove the text extension, chmod a+x and run it to generate the profile.

The next bash script shows how to avoid your files being deleted by the daemon in public folders such as the "scratch" in Soc. When the disk is full, the daemon will delete the top users who occupied the most space and hosted their files for the longest period of time. Hence, I've come up with an idea to copy files whenever I login to my own Unix account. Click here for details.

return top


Last modified: 2:33 AM 7/12/02
Hosted by www.Geocities.ws

1