The Linux Environment Programming with C CSCI 112, Spring 2015 - - PowerPoint PPT Presentation

the linux environment
SMART_READER_LITE
LIVE PREVIEW

The Linux Environment Programming with C CSCI 112, Spring 2015 - - PowerPoint PPT Presentation

The Linux Environment Programming with C CSCI 112, Spring 2015 Patrick Donnelly Montana State University Linux Flavors There are many different distributions of the Linux operating systems. Some of the most popular are as follows: Ubuntu


slide-1
SLIDE 1

The Linux Environment

Programming with C

CSCI 112, Spring 2015

Patrick Donnelly

Montana State University

slide-2
SLIDE 2

Linux Flavors

There are many different distributions of the Linux operating

  • systems. Some of the most popular are as follows:
  • Ubuntu
  • Fedora
  • CentOS
  • Mint
  • Debian

The distro used in the lab here on campus is Fedora.

Programming with C (CSCI 112) Spring 2015 2 / 10

slide-3
SLIDE 3

A Brief History of Unix

1964 1969 1970 1971 1972 1975 1979 MIT, GE, and Bell Labs develop Multics (“Multiplexed Information and Computing Service”), an influential early time-sharing operating system. Thompson, Ritchie, Canaday developed a hiercrachical file system at Bell Labs. Peter Neumann coined the project name UNICS (UNiplexed Information and Computing Service), a pun on Multics. The UNIX Programmer’s Manual was published on 3 November 1971. Unix was rewritten in the (new) C programming language. Sixth edition; Bourne shell is introduced. Seventh edition of Unix released.

Programming with C (CSCI 112) Spring 2015 3 / 10

slide-4
SLIDE 4

Ken Thompson (sitting) and Dennis Ritchie working together at a PDP-11.

Programming with C (CSCI 112) Spring 2015 4 / 10

slide-5
SLIDE 5

A Brief History of Unix

1983 1987 1990 1991 1994 1996 2003 2004 AT&T licenses System V - first commercial version of UNIX. Justice Department mandates breakup of the Bell System. GNU project is announced by Richard Stallman. Sun and AT&T cooperated to develop Unix System V R4. Open Software Foundation released OSF/1. Sun unveils Solaris 2 operating environment. Linux is introduced by Linus Torvalds, a student in Finland. Red Hat Linux is introduced. KDE development began by Matthias Ettrich. Fedora, Debian released. First release of Ubuntu

Programming with C (CSCI 112) Spring 2015 5 / 10

slide-6
SLIDE 6

Vision for Unix

What we wanted to preserve was not just a good environment in which to do programming, but a system around which a fellowship could form. We knew from experience that the essence of communal computing, as supplied by remote-access, time-shared machines, is not just to type programs into a terminal instead of a keypunch, but to encourage close communication. Dennis Ritchie, 1979

Programming with C (CSCI 112) Spring 2015 6 / 10

slide-7
SLIDE 7

Shell

Each Linux distribution has it’s own unique software and changes to the visual style. In the end however, they all share a virtually identical shell that runs “under the hood”.

  • The shell prompt is a text-based interface
  • With it you can perform most all tasks you would with a GUI
  • It is similar to Windows’ command line, but more robust

In this course, we will do most of our work using the shell.

Programming with C (CSCI 112) Spring 2015 7 / 10

slide-8
SLIDE 8

File System

  • The Linux file system works like it does on Windows or Mac
  • Each directory can contain files or other directories
  • When browsing through these directories, the current

directory you have open is called the “working directory”

  • With shell, contents of your working directory are not shown

by default, you must explicitly request that they be listed

  • To list directories, use the ls command
  • To change directories (i.e. open another folder), use the cd

command, followed by the target directory

  • Note that in any directory, “.” is the name of the current

directory, “..” is the name of the parent directory, and “-” is the name of the previously visited directory

Programming with C (CSCI 112) Spring 2015 8 / 10

slide-9
SLIDE 9

Creating Files and Directories

  • To create a file, use the touch command followed by the name
  • f the file to create.
  • To create a directory, use the mkdir commmand followed by

the name of the directory you wish to create.

  • To quickly view the contents of a file, use the cat command

followed by the name of the file you wish to view.

Programming with C (CSCI 112) Spring 2015 9 / 10

slide-10
SLIDE 10

Text Editors

The following is a list of text editors in order of learning difficulty. Nano

  • Usage: nano filename.txt
  • Nano is a minimalistic text editor, but is easy to learn for

first-time Linux users. Emacs

  • Usage: emacs filename.txt
  • Emacs has a steeper learning curve, but has many excellent

features for programming. Vim

  • Usage: vim filename.txt
  • Similar to Emacs, Vim has many nice features but it is more

difficult to learn.

Programming with C (CSCI 112) Spring 2015 10 / 10