My code worked, but where is my file?


#1

Hi, I can’t seem to find my file that I created: /tmp/cool.txt after I run the program. I added the code &error and it says that it was successful, but I can’t seem to find the file??? Is it only a temporary file that gets deleted when the program is finished?

I have searched my iMac using the finder and it doesn’t find the file, only the file that I created it in.
Any suggestions?


#2

Did you try the following?
Going Finder/Go/Go to Folder and entering /tmp; or
Opening the Terminal App and entering the Unix command ls /tmp to list the contents of /tmp.


#3

Hi sorry, I am new to my iMac and don’t see a ‘go/go to folder’… in the finder.
It just has a list : All my files, applications, documents… but I dont’ see a tmp folder anywhere… does this get deleted shortly after creation?


#4

Could you give me instructions to find the terminal app?


#5

In the Finder, Go to Applications/Utilities; then click on the Terminal Application. You should see a Unix window open up for you to enter commands from the command line.

A very useful command is the ls command. ls (lower-case letters l and s concatenated) allows you to list the contents of a directory (or folder).

For example: to list the contents of the /Applications directory, enter ls /Applications and hit the return key.

If you enter ls -l /Applications, ls should produce an output that looks like this:

drwxr-xr-x+  3 root  wheel  102 28 May  2012 Address Book.app
drwxrwxr-x   3 root  admin  102  4 Oct  2011 Adobe Reader.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 App Store.app
drwxr-xr-x   3 root  wheel  102 28 May  2012 Automator.app
drwxr-xr-x   3 root  wheel  102 28 May  2012 Calculator.app
drwxr-xr-x   3 root  wheel  102 28 May  2012 Chess.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 DVD Player.app
drwxr-xr-x   3 root  wheel  102 28 May  2012 Dashboard.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 Dictionary.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 FaceTime.app
drwxr-xr-x   3 root  wheel  102 28 May  2012 Font Book.app
drwxr-xr-x   3 root  wheel  102  3 Jul  2011 GarageBand.app
drwxrwxr-x@  3 ibex  admin  102 22 Mar 06:52 Google Chrome.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 Image Capture.app
drwxr-xr-x   3 root  wheel  102 28 May  2012 Launchpad.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 Mail.app
drwxr-xr-x   3 root  wheel  102 28 May  2012 Mission Control.app
drwxr-xr-x   3 ibex  admin  102 25 May  2012 OmniGraffle Professional 5.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 Photo Booth.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 Preview.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 QuickTime Player.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 Safari.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 Stickies.app
drwxrwxr-x+  3 root  wheel  102 28 May  2012 System Preferences.app
drwxr-xr-x   3 root  wheel  102 28 May  2012 TextEdit.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 Time Machine.app
drwxr-xr-x+ 27 root  admin  918 20 Sep  2011 Utilities
drwxr-xr-x   3 root  wheel  102 26 May  2012 Xcode.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 iCal.app
drwxr-xr-x+  3 root  wheel  102 28 May  2012 iChat.app
drwxr-xr-x   3 root  wheel  102  3 Jul  2011 iMovie.app
drwxr-xr-x   3 root  wheel  102  3 Jul  2011 iPhoto.app
drwxr-xr-x+  3 root  wheel  102 30 Apr  2012 iTunes.app

#6

Why is the folder tmp available using terminal but not available to Go to Folder in Finder???
Thanks
Warren Trammell