Linux Blog

Sorting lists with Sort

Filed under: Quick Linux Tutorials — TheLinuxBlog.com at 11:11 pm on Wednesday, June 4, 2008

There comes a time when it is useful to know how to sort lists. Thankfully using open source software sorting text files can be very easy.

This example shows how to sort a file alphabetically using the sort command. I assume that you have a text file in mind so I will skip the creation of that. There are two ways to sort the file with the sort command. The first being the preferred method but not always suitable.

sort [textfile]
 
cat [textfile] | sort

That’s it! The second method can be useful if you would like to do any thing special, for example searching with grep, using cut or sed for data extraction or just out of convenience. Check out the man page for sort for more information on all of the options!

Wakoopa For Linux

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 12:01 am on Monday, March 31, 2008

I stumbled across Jakes blog post over at: http://blogs.howtogeek.com/jatecblog/posts/software-tracker-for-linux. Until this point I had never heard of the Wakoopa service. It seems like a really good idea. It is sort of the Alexa for software applications. Naturally I left a comment showing interest in an open source Wakoopa and shortly after received an e-mail from Jake.

Here it is:

Hello Owen, 

First I'd like to clarify that I don't actually have a need for the 
application tracker... it would be purely for fun. That said, I would love if 
you would be willing to create this. Here is the idea I have envisioned in 
more detail but do not have the skills to create:

1) The process list is purged every so often to generate a log file.
2) The log file is periodically sent to a server. It is cleared after each 
time it is uploaded.
3) The server then has an application which goes through and sorts out process 
names and so forth and presents them as user reader data (much like Wakoopa) 

I think that this would be the easiest way, but I'd love to hear your 
suggestions. If you were to make this I think it would be used and loved by many, as well as being useful.

Now that he has broken it down like that it seems like it would be pretty easy to implement. The only thing that I can see being a little bit complicated is determining what processes are running and how long they have been running for. I hopefully have a short shell script up for next Sundays column and have some sort of prototype. There should be nothing new in this script that I haven’t covered before on this blog, except possibly the sort command. Other commands I plan to know I will probably use are ps or top, cat and echo. There will probably be lots of loops and conditional if’s. The good thing about this idea is that if I write a shell script to do this some one will be able to translate it into another language. The real part where I would like to spend the majority of my time would be in the web interface. I expect that this will be written in PHP but I am unsure of the database technology that will be used since the recent happenings with MySQL.

So when this open source Wakoopa prototype is finished how many people do you think will use this service? Would you use it? What do you think an acceptable update time is? Any one have any other questions / input?