Docsity

linux lecture notes for students, Lecture notes of Java Programming

Partial preview of the text

Download linux lecture notes for students and more Lecture notes Java Programming in PDF only on Docsity!

http://www.cs.ucr.edu/~weesan/

Roadmap

What is Unix?

What is Linux?

Basic Commands

http://www.cs.ucr.edu/~weesan/

What is Unix?

A multi-task and multi-user Operating System

Developed in 1969 at AT&T’s Bell Labs by

Ken Thompson (Unix)

Some other variants: System V, Solaris, SCO

Unix, SunOS, 4.4BSD, FreeBSD, NetBSD,

OpenBSD, BSDI

http://www.cs.ucr.edu/~weesan/

What is Linux?

Originally developed for

32-bit x86-based PC

Ported to other

architectures, eg.

 PowerPC, IBM S/390,

MIPS, IA-

PS2, cellphones,

watches, Nokia N810,

NDS, routers, NAS, GPS,

  • See references at the end for the corresponding websites.

http://www.cs.ucr.edu/~weesan/

Which Linux Distribution is

better?

> 300 Linux Distributions

 Slackware (one of the oldest, simple and stable distro.)

 Redhat

 RHEL (commercially support)

 Fedora (free)

 CentOS (free RHEL, based in England)

 Gentoo (Source code based)

 Debian (one of the few called GNU/Linux)

Ubuntu (based in South Africa)

Knoppix (first LiveCD distro.)

http://www.cs.ucr.edu/~weesan/

Basic Commands (cont)

 echo

 $ echo “Hello World”

 $ echo -n “Hello World”

 cat

 $ cat /etc/motd

 $ cat /proc/cpuinfo

 cp

 $ cp foo bar

 $ cp -a foo bar

 mv

 $ mv foo bar

 mkdir

 $ mkdir foo

 rm

 $ rm foo

 $ rm -rf foo

 $ rm -i foo

 $ rm -- -foo

 chgrp

 (^) $ chgrp bar /home/foo

 chsh

 (^) $ chsh foo

 chfn

 (^) $ chfn foo

 chown

 (^) $ chown -R foo:bar /home/foo

http://www.cs.ucr.edu/~weesan/

Basic Commands (cont)

 tar

 (^) $ tar cvfp lab1.tar lab

 gzip

 (^) $ gzip -9 lab1.tar

 untar & ungzip

 (^) $ gzip -cd lab1.tar.gz | tar xvf –  (^) $ tar xvfz lab1.tar.gz

 touch

 $ touch foo

 $ cat /dev/null > foo

 Pipe

 $ cal > foo

 $ cat /dev/zero > foo

 $ cat < /etc/passwd

 $ who | cut -d’ ‘ -f1 | sort |

uniq | wc –l

 backtick

 $ echo “The date is date”

 $ echo seq 1 10

 Hard, soft (symbolic) link

 ln vmlinuz-2.6.24.4 vmlinuz

 ln -s firefox-2.0.0.3 firefox