100% found this document useful (1 vote)
78 views

Linux Basics: Weesan Lee

This document provides an overview of Linux basics. It discusses that Unix is a multi-user operating system developed in 1969, and that Linux is an open source clone of Unix developed by Linus Torvalds in 1991. It also covers various Linux distributions, basic Linux commands like ls, cd, cp, and vi/emacs text editors. The document contains a roadmap and sections on what Unix and Linux are, the better Linux distribution to use, and fish versus fishing terminology.

Uploaded by

abdul
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
78 views

Linux Basics: Weesan Lee

This document provides an overview of Linux basics. It discusses that Unix is a multi-user operating system developed in 1969, and that Linux is an open source clone of Unix developed by Linus Torvalds in 1991. It also covers various Linux distributions, basic Linux commands like ls, cd, cp, and vi/emacs text editors. The document contains a roadmap and sections on what Unix and Linux are, the better Linux distribution to use, and fish versus fishing terminology.

Uploaded by

abdul
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 20

Linux Basics

WeeSan Lee <[email protected]>

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

What is Unix?
What is Linux?
Which Linux Distribution is better?
Fish vs. Fishing
Basic Commands
Vi and Emacs
Q&A
References
http://www.cs.ucr.edu/~we
What is Unix?

A multi-task and multi-user Operating System


Developed in 1969 at AT&Ts Bell Labs by
Ken Thompson (Unix)
Dennis Ritchie (C)
Douglas Mcllroy (Pipes - Do one thing, do it well)
Some other variants: System V, Solaris, SCO
Unix, SunOS, 4.4BSD, FreeBSD, NetBSD,
OpenBSD, BSDI

http://www.cs.ucr.edu/~we
What is Linux?
A clone of Unix
Developed in 1991 by Linus Torvalds, a Finnish
graduate student
Inspired by and replacement of Minix
Linus' Minix became Linux
Consist of
Linux Kernel
GNU (GNU is Not Unix) Software
Software Package management
Others

http://www.cs.ucr.edu/~we http://www.linuxdevices.com/files/misc/ibm-watchpad.jpg
What is Linux?
Originally developed for
32-bit x86-based PC
Ported to other
architectures, eg.
Alpha, VAX, PowerPC,
IBM S/390, MIPS, IA-64
PS2, TiVo, cellphones,
watches, Nokia N810,
NDS, routers, NAS, GPS,

* See references at the end


http://www.cs.ucr.edu/~we for the corresponding websites.
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)
SuSe ( based in German)
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/~we
Which Linux Distribution is
better? Ubuntu
Debian
Knoppix

Slackware Gentoo

CentOS

Redhat

Source:
http://www.cs.ucr.edu/~we
http://futurist.se/gldt/
Which Linux Distribution is
better?
Ask yourself these questions (from LAH)
Is it going to be around in 5 yrs?
Is it giong to stay on top of the latest security
patches?
Is it going to release updated software promptly?
If I have problems, will the vendor talk to me?
Personally, I use Slackware
But, we will use CentOS (possibly along with
Slackware :)
http://www.cs.ucr.edu/~we
Fish vs. Fishing
Manpage 4 Device drivers and
$ man ls network protocols
/dev/tty
$ man 2 mkdir
$ man man
5 Standard file formats
/etc/hosts
$ man -k mkdir 6 Games and demos
Manpage sections (LAH /usr/games/fortune
Table 1.2 @ page 12) 7 Misc. files and docs
1 User-level cmds and man 7 locale
apps
/bin/mkdir
8 System admin. Cmds
/sbin/reboot
2 System calls
int mkdir(const char *, );
$ manpath
3 Library calls $ env | grep MANPATH
int printf(const char *, ); /etc/man.config

http://www.cs.ucr.edu/~we
Fish vs. Fishing (cont)

Google
linux package management -rpm
linux package management -rpm
linux OR windows
rpm site:redhat.com
linux faq filetype:pdf
Info
Text-base, menu-based help from GNU
?, h, u, t, ^N, ^P, Enter
$ info info
http://www.cs.ucr.edu/~we
Basic Commands
ls which
$ ls -l $ which ls
$ ls -a whereis
$ ls -la $ whereis ls
$ ls -l --sort=time locate
$ ls -l --sort=size -r $ locate stdio.h
cd $ locate iostream
$ cd /usr/bin rpm
pwd $ rpm -q bash
$ pwd $ rpm -qa
~ $ rpm -qa | sort | less
$ cd ~ find
~user $ find / | grep stdio.h
$ cd ~weesan $ find /usr/include | grep stdio.h
What will cd ~/weesan do?

http://www.cs.ucr.edu/~we
Basic Commands (cont)
echo rm
$ echo Hello World $ rm foo
$ echo -n Hello World $ rm -rf foo
cat $ rm -i foo
$ cat /etc/motd $ rm -- -foo
$ cat /proc/cpuinfo chgrp
cp $ chgrp bar /home/foo
$ cp foo bar chsh
$ cp -a foo bar $ chsh foo
mv chfn
$ mv foo bar
$ chfn foo
mkdir
chown
$ chown -R foo:bar /home/foo
$ mkdir foo

http://www.cs.ucr.edu/~we
Basic Commands (cont)
tar Pipe
$ tar cvfp lab1.tar lab1 $ cal > foo
gzip $ cat /dev/zero > foo
$ gzip -9 lab1.tar $ cat < /etc/passwd
untar & ungzip $ who | cut -d -f1 | sort |
$ gzip -cd lab1.tar.gz | tar xvf uniq | wc l
$ tar xvfz lab1.tar.gz backtick
touch $ echo The date is `date`
$ touch foo $ echo `seq 1 10`
$ cat /dev/null > foo Hard, soft (symbolic) link
ln vmlinuz-2.6.24.4 vmlinuz
ln -s firefox-2.0.0.3 firefox

http://www.cs.ucr.edu/~we
Basic Commands (cont)
Disk usage
$ df -h /
File space usage
$ du -sxh ~/
Advance stuff
$ ssh eon who
$ ssh eon cd .html ; tar cvfp - cs183 | gzip -9c | tar
xvfpz -
$ ssh kilo-1 tar cvfp - /extra/weesan | tar xvfp - -C /

http://www.cs.ucr.edu/~we
Vi
2 modes Delete
dd (delete a line)
Input mode
d10d (delete 10 lines)
ESC to back to cmd mode d$ (delete till end of line)
Command mode dG (delete till end of file)
Cursor movement
x (current char.)
h (left), j (down), k (up), l (right)
Paste
^f (page down)
p (paste after)
^b (page up)
P (paste before)
^ (first char.) Undo
$ (last char.) u
G (bottom page) Search
:1 (goto first line) /
Swtch to input mode Save/Quit
a (append) :w (write)
i (insert) :q (quit)
o (insert line after :wq (write and quit)
O (insert line before) :q! (give up changes)

http://www.cs.ucr.edu/~we
Emacs
$ emacs Paste
Cursor movement ^y (yank)
^f (forward one char.) Undo
^b (backward one char.) ^/
^a (begin of line) Load file
^e (end of line) ^x^f
^n (next line) Cancel
^p (prev. line) ^g
^v (page up) Save/Quit
alt-v (page down) ^x^c (quit w/out saving)
Deletion ^x^s (save)
^d (delete one char) ^x^w (write to a new file)
alt-d (delete one word)
^k (delete line)

http://www.cs.ucr.edu/~we
Q&A

http://www.cs.ucr.edu/~we
References
LAH
Ch 1: Where to Start
Unix history
http://en.wikipedia.org/wiki/Unix
http://upload.wikimedia.org/wikipedia/commons/7/77/Unix_h
istory-simple.svg
Linus Torvalds
http://en.wikipedia.org/wiki/Linus_Torvalds
Linux Kernel
http://www.kernel.org/

http://www.cs.ucr.edu/~we
References
GNU (Gnus Not Unix)
http://www.gnu.org/
Linux Distribution
http://en.wikipedia.org/wiki/Linux_distribution
http://en.wikipedia.org/wiki/List_of_Linux_distributions
PS2: Computational Cluster
http://arrakis.ncsa.uiuc.edu/ps2/cluster.php
Linux Gadgets
http://linuxdevices.com/articles/AT4936596231.html
TiVo
http://dynamic.tivo.com/linux/linux.asp

http://www.cs.ucr.edu/~we
References
Nintendo DS Lite
http://www.nintendo.com/ds/

Nokia N810
http://www.nokia.com/

http://www.engadget.com/2007/10/17/nokia-n810-gets-official/

Linux Distribution
http://en.wikipedia.org/wiki/Linux_distribution

GNU/Linux Distro Timeline: http://futurist.se/gldt/

http://www.distrowatch.com/

http://www.linux.org/dist/

Google Advance Search


http://www.google.com/intl/en/help/refinesearch.html

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

You might also like