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 • Fedora • CentOS • Mint • Debian The distro used in the lab here on campus is Fedora. Programming with C (CSCI 112) Spring 2015 2 / 10
A Brief History of Unix 1964 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 1969 system at Bell Labs. Peter Neumann coined the project name UNICS (UNiplexed 1970 Information and Computing Service), a pun on Multics. The UNIX Programmer’s Manual was published on 3 1971 November 1971. 1972 Unix was rewritten in the (new) C programming language. 1975 Sixth edition; Bourne shell is introduced. 1979 Seventh edition of Unix released. Programming with C (CSCI 112) Spring 2015 3 / 10
Ken Thompson (sitting) and Dennis Ritchie working together at a PDP-11. Programming with C (CSCI 112) Spring 2015 4 / 10
A Brief History of Unix 1983 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. 1987 1990 Open Software Foundation released OSF/1. 1991 Sun unveils Solaris 2 operating environment. Linux is introduced by Linus Torvalds, a student in Finland. 1994 Red Hat Linux is introduced. 1996 KDE development began by Matthias Ettrich. 2003 Fedora, Debian released. 2004 First release of Ubuntu Programming with C (CSCI 112) Spring 2015 5 / 10
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
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
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 c hange d irectories (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
Creating Files and Directories • To create a file, use the touch command followed by the name of 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
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
Recommend
More recommend