Found a great post over at good coders code, great reuse. This one deals with performing operations on sets using only unix (bash) command line operations on files of text.

* Set Membership. Test if an element belongs to a set.
* Set Equality. Test if two sets contain the same elements.
* Set Cardinality. Return the number of elements in the set.
* Subset Test. Test if a given set is a subset of another set.
* Set Union. Find union of two sets.
* Set Intersection. Find intersection of two sets.
* Set Complement. Given two sets A and B, find all elements in A that are not in B.
* Set Symmetric Difference. Find symmetric difference of two sets.
* Power Set. Generate all subsets of a set.
* Set Cartesian Product. Find A x B.
* Disjoint Set Test. Test if two sets are disjoint.
* Empty Set Test. Test if a given set is empty.
* Minimum. Find the smallest element of a set.
* Maximum. Find the largest element of a set.

It deals with such commands as sed, awk, tr, sort, comm, grep and wc. This is a good post for anyone dealing with data via command line linux.

Full article here.

2 comments
  1. Pingback: Dave Drager

Comments are closed.

You May Also Like

Simple Sysadmin Trick: Using tcpdump To Sniff Web Server Traffic

Sometimes, you just have to look into the raw data to see…

Convert Windows or DOS Encoded Files to Unix/Linux. (ANSI to UTF-8)

Windows files and Unix files (Redhat, Ubuntu, etc) are encoded in different…

Delete all directories more than a week old

This simple linux bash script will delete subdirectories in a directory based…

Evaluating FTP Servers: ProFTPd vs PureFTPd vs vsftpd

Usually, I will try to push clients towards using SCP (via a client such as WinSCP), however inevitably there are clients who do not understand this new method of accessing their files securely online, and who for one reason or another insist on using FTP for their online file access. As they say – the customer is always right?