ece333-warmup-lab

ece333-warmup-lab - 1 Lab Assignment I I I NTRODUCTION In...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lab Assignment I I. I NTRODUCTION In this assignment you will learn basic Unix commands and work through the steps involved in writing and compiling a simple C program. For the benefit of those of you who have earlier programmed in C++, we highlight the differences between C and C++ at various points in the handout. Familiarity with the tasks in this handout is a bare minimum requirement to tackle future programming assignments in the course. Note that the lab machines are installed with CentOS-6.0 linux distributions. All programming assignments sumbitted by you should run on CentOS-6.0. II. G ETTING S TARTED You will need to get a user account ( login name and password ) on the Unix/Linux machine designated for lab work. Once you have the login and password you can access your home on the machine by logging into it via telnet or ssh (preffered). You may access the machine from your local desktop using ssh clients like TeraTerm and PuTTy 1 . A successful login will take you to a command prompt, typically # or $ or , and as is true with most things Unix, easily configurable to a prompt of your own choice. III. C OMMONLY USED U NIX C OMMANDS Having successfully logged in to the lab machine you are now ready to get your hands dirty with commands you will find very useful when using any unix based operating system. We will work with the following in this assignment. A longer list can be found at http://mally.stanford. edu/ sr/computing/basic-unix.html. man Probably the best way to learn about any Unix command. Usage: $man <command name> Examples: 1 A list of ssh clients for various operating systems can be found at http://static.msi.umn.edu/user support/ssh/sshclients.html. September 5, 2011 DRAFT
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 $man man $man ls You can also find them on the web, for example, at http://unixhelp.ed.ac.uk/CGI/man-cgi. passwd To change your account password. pwd Displays your present working directory. ls Lists all the files and directories in your current directory. cd The change directory command. touch Create a new file or update the timestamp of a file to current. cp Copy a file. rm Remove a file. With additional options remove a directory and all files in it. mv Move a file. mkdir Create a new directory. rmdir Remove a directory. chmod Change read, write and execute permissions on a file. wc Returns number of characters, words and lines in a file. grep Search a file for a pattern. find Find a file. tar Create an archive. Extract files from an archive. IV. W RITING AND R UNNING A C P ROGRAM Many of the future assignments will involve writing parts or whole of a C program. In its simplest form a C program consists of a main function. Just as in C++, a C program must have one main function. Other functions may be invoked from within the main function. Next, we will go through the steps of creating a very simple C program.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern