CS111 Lab
Linux etc.
Instructor: Michael Gordon
Linux
We will be using the Linux OS, which
may be different from the operating
systems you have used before
(Windows, Mac ...
Linux commands
 Create


a directory (folder): mkdir

[prompt] mkdir mydir 

 Change



[prompt] cd mydir 
[prompt ...
Commands, continued
 Remove


[prompt] rmdir mydir 

 List


files/sub-directories: ls (letter ‘l’)

[prompt] ls 

...
Commands, continued
 Copy


a file: cp

[prompt] cp origfile newfile 

 Rename


[prompt] mv origfile newfile 

 Re...
Pico
 Pico

is a text editor for Unix. In this lab we
will use it to write our C++ code.
 To open or create a file in pi...
In Pico
 In

Pico we will write our C++ code.
 Note: You must move your cursor with the
arrows keys, not the mouse.
 To...
Compiling
 Once

you’ve written a C++ program, you
need to compile it (translate it into
machine code) before running it....
Executing
 To

run the executable file, type:
 [prompt] ./a.out 
 To

give a name to your .out file:
 [prompt] g++ -o...
Upcoming SlideShare
Loading in...5
×

Introduction to Linux, Pico, G++

390

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
390
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to Linux, Pico, G++

  1. 1. CS111 Lab Linux etc. Instructor: Michael Gordon
  2. 2. Linux We will be using the Linux OS, which may be different from the operating systems you have used before (Windows, Mac OS). There is no GUI or mouse-interface. Commands are typed at the prompt.
  3. 3. Linux commands  Create  a directory (folder): mkdir [prompt] mkdir mydir   Change   [prompt] cd mydir  [prompt mydir]  Go   current directory: cd up one directory: cd .. (note space) [prompt mydir] cd ..  [prompt]
  4. 4. Commands, continued  Remove  [prompt] rmdir mydir   List  files/sub-directories: ls (letter ‘l’) [prompt] ls   List  a directory (folder): rmdir with details: ls -l [prompt mydir] ls –l 
  5. 5. Commands, continued  Copy  a file: cp [prompt] cp origfile newfile   Rename  [prompt] mv origfile newfile   Remove  a file: mv a file: rm [prompt mydir] rm origfile 
  6. 6. Pico  Pico is a text editor for Unix. In this lab we will use it to write our C++ code.  To open or create a file in pico:  [prompt] pico filename.cpp   To save: Control+o (letter ‘o’) prompts you to overwrite. ‘Enter’ for ‘Yes’. Or change the file name.  To exit pico: Control+x
  7. 7. In Pico  In Pico we will write our C++ code.  Note: You must move your cursor with the arrows keys, not the mouse.  To ‘cut’ a line of code, use Control+k  To ‘paste’ use Control+u
  8. 8. Compiling  Once you’ve written a C++ program, you need to compile it (translate it into machine code) before running it.  We use a compiler called g++.  [prompt] g++ file.cpp   An executable file is automatically created (or overwritten) with the name a.out.
  9. 9. Executing  To run the executable file, type:  [prompt] ./a.out   To give a name to your .out file:  [prompt] g++ -o name.out file.cpp   To run:  [prompt] ./name.out 
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×