I'm sure this is a very basic question, but I'm just beginning to learn programming and I've gotten to a lesson where I have to create a file in text wrangler, save it to the desktop (called test.txt) and then copy it into the terminal. I then have to use the "less" command to view the file. How do I get that file from my desktop into the command line? and I'm using a mac fyi..


Open up Terminal.

Your Desktop is at ~/Desktop (the ~ is a shortcut for your home folder) so cd ~/Desktopreturn to go there then less test.txtreturn

By the way, if you are going to use TextWrangler and Terminal you might want to visit http://www.barebones.com/support/textwrangler/ and download the TextWrangler command line tools which allow you to open a file in TextWrangler from the command line, among other things.

  • Awesome..it worked, thank you very much! and I will get the command line tool, thanks again. – sabih4911 Jan 21 '14 at 16:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .