Want to create txt file in MAC

hi all.
i want to create a txt file in MAC.
it is possible to create a txt file in MAC using the following command ?

sr = new StreamWriter(“/tmp/test.txt”);
sr.Write(“Test”);
sr.Close();

and also can any one tell me. where we can find the test.txt file in mac

Thanks in advance

It works fine and writes the file. However I couldn’t see where to find the file. But typing “test” or whatever the file was called into spotlight (magnifying glass on top right) shows you file which you can open and write to.