Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Omar Farag
Omar Farag
4,573 Points

Make files in a UNIX console

I know I can make directories with the mkdir command, but I don't know how to make files. Any help?

Omar Farag
Omar Farag
4,573 Points

Also, can someone explain why, when I execute the "exit" command when logged in as treehouse, the shell goes blank and I can't type anything? Thanks in advance.

I'd use nano. Just type nano into the console, and type out your file content, and to save, first exit with ^X (Ctrl-X) then press Y. Next, you can type the file name. Hope that might help!

For more detail, try this:

$ nano
<Some thing pops up>
$ ls
cake cake cake <whatever your file is>
$ cat <whatever your file is>
cake cake cake cake
$ rm <whatever your file is>

Also, if you want to edit a file, do this:

$ nano <whatever your file is>

3 Answers

Sue Dough
Sue Dough
35,800 Points

@xela888 answer is not efficient. What if he wants to create 50 files? What if he doesn't want to nano and have to edit?

:)

Just do this mate:

touch hello.txt hello2.txt hello3.txt

Also @xela888 you can specify a file with nano like this to avoid the extra step:

nano hello.txt

It will then make that file.

Hmm... I haven't ever learned that! Thank you for explaining.

Omar Farag
Omar Farag
4,573 Points

So "touch" can create multiple files at once? Thanks

Sue Dough
Sue Dough
35,800 Points

Yes indeed. Very helpful.

If you want to see all the options touch can do just type this to see the manual:

man touch

No problem!

Erving Velez
Erving Velez
300 Points

That is a lot of cake. :-)

Yum yum. Just to fill in the text I decided to use "cake cake cake"