There are no .bmp files in ~cs50/pset4 to test with peek. How can I copy .bmp files from my workspace to ~cs50/pset4?


You don't need to copy anything into the /home/cs50 directory. Just provide the correct pathnames to all the files.

The peek executable binary is in the cs50 user's home directory, so you need to specify the path:


But when you provide the arguments to peek, you are going to provide bitmaps that are in your home directory!

If you are comparing two files in your current working directory, the usage is:

~cs50/pset4/peek foo.bmp bar.bmp

where foo.bmp and bar.bmp are files in the current working directory.

Just to be absolutely crystal clear, I will spell it out with absolute pathnames. This is another way of saying:

/home/cs50/pset4/peek /home/ubuntu/workspace/pset4/bmp/foo.bmp /home/ubuntu/workspace/pset4/bmp/bar.bmp

Every command that you execute has a full pathname leading to the location where the executable file is stored in the file system. To illustrate this, you can use the which command:

which ls
which man
which which

If you can run the command without supplying the absolute or relative pathname to its executable, that means the path to the file is in the $PATH environment variable:

echo $PATH

Hope this helps.

Possible duplicate of this question.

  • Ha, ha. You linked to my own question. There are no files in cs50 working directory to wither run their version of resize or peek on. Sep 29 '16 at 19:10

You must log in to answer this question.

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