How to create a text file and a folder from terminal?
A directory can be made using the mkdir command. To make a child directory of the current directory it's simply:
mkdir somechild

This will create a directory (shown as a folder in Finder) named somechild.
A text file can be created in a few different ways. The simplest being the echo'ing of text and redirecting it in to a file like so:
echo This is some text &gt; myfile.txt

This will create myfile.txt and its contents will be the string This is some text.
You can also use a command line text editor such as vim or emacs or nano to start a new text file. The following start a new text file and open them in the editor for each of the aforementioned editors:
vim myfile.txt
emacs myfiles.txt
nano myfile.txt

The nano text editor is probably the most new-user-friendly of those three choices.