To compile this, you execute the mono C# compiler: mcs dirsize.cs Which should give us a file named dirtrav.exe -- it's interesting to note that because this file is in IL, it can be run on Windows as well. Now you can just run the exe: csharp-dirsize# ./dirsize.exe .. Total size: 1526282640 bytes File count: 25557 Directory count: 1658