Lesson 1
Lesson 1
Lesson 1
JOCV Volunteer
Kunihiko ADACHI
Schedule
day Contents
May 10 , AM Introduction to Linux
May 10 , AM Basic Commands and Concepts
May 10 , PM File Processing 1
May 10 , PM File Processing 2
May 11 , AM Text and Document Processing
May 11 , AM Shells
May 11 , PM Administrative Tasks
May 11 , PM Password Management
May 12 , AM Exercise and Check Comprehension
AM 9:00 11:30 PM 14:00 16:30
Todays objectives
1. What is Linux?
2. Where did it come from?
3. Open Source Software
4. How do you get it?
5. Why is it significant?
Introduction to Linux
Basic Commands and Concepts
1. Logging in
2. Popular Commands
3. Some Special File Names
4. Useful Keys and How to Get Them to Work
5. Typing Shortcuts
Introduction to Linux
What is Linux?
Multi-user, Multitasking, Multiprocessor
Has the X Windows GUI
Coexists with other Operating Systems
Runs on multiple platforms
Includes the Source Code
Where did it come from?
Linus Torvalds created it
first posted on Internet in 1991
with assistance from programmers around the
world
Linux version 1.0 in 1994; 2.6 in 2005
Today used on 7-10 million computers
with 1000s of programmers working to
enhance it
Open Source Software
When programmers on the Internet can
read, redistribute, and modify the source
for a piece of software, it evolves.
People improve it, people adapt it, people
fix bugs. And this can happen at a speed
that, compared to conventional software
development, seems astonishing.
How do you get it?
Download it from the Internet
From a Distribution (e.g. RedHat)
Linux kernel
X Windows system and GUI
Web, e-mail, FTP servers
Installation & configuration support
3rd party apps
Hardware support
Why is it significant?
Growing popularity
Powerful
Runs on multiple hardware platforms
Users like its speed and stability
No requirement for latest hardware
Its free
Vendors are distributors who package Linux
Basic Commands and Concepts
Logging in
1. Click Start button.
2. Click Run on the menu.
3. Type telnet 192.168.1.10 into the
box and press Enter.
Logging in
Logging in
Linux login :
Password :
# $
root
other users
Logging in
[user1@mindoro user1] $
User name
Computer name
Current Directory
Linux Command Basics
$ ls -l /etc
Command name
Options (flags)
Arguments
To execute a command, type its name and
arguments at the command line
Popular Commands
pwd to verify your current directory
cd to change your current directory
$ pwd
/home/user1
$ cd /usr/bin
$ pwd
/usr/bin
Linux File System Basics
Linux files are stored
in a single rooted,
hierarchical file
system
Data files are stored in
directories (folders)
Directories may be
nested as deep as
needed
Directories
User home
directories
Data files
root
Naming Files
Files are named by
naming each containing
directory
starting at the root
This is known as the
pathname
/etc/passwd
/home/user1/b
The Current Directory
One directory is
designated the
current working
directory
if you omit the leading
/ then path name is
relative to the current
working directory
Use PWD to find out
where you are
Current working
directory
doc/letter
./doc/letter
/home/user1/doc/letter
Popular Commands
cat display the contents of a file
more display output one screen at a
time
$ cat /etc/group
$ more /etc/group
Popular Commands
ls List information about file(s)
$ cd /home
$ ls
user1 user2 user3
user4
Popular Commands
ls -al List information about all files in detail
$ ls -al
drwx------ 2 user1 user1 4096 May 3 00:25 user1
drwx------ 2 user2 user2 4096 May 3 00:25 user2
drwx------ 2 user3 user3 4096 May 3 00:25 user3
drwx------ 2 user4 user4 4096 May 3 00:25 user4
* a all
* l long
Popular Commands
$ cd
$ ls -al
v-! v-! ` '- `:!
' ` '- .!:!
! v-! v-! ! '- `:! --_'-
! v-! v-! . '- ``:.! --_'v
! v-! v-! !! '- ``:.! --_:''
! v-! v-! !. '- ``:.! --
Some Special File Names
Some file names are special
The root directory (not to be confused with the root
user)
. The current directory
.. The parent (previous) directory
My home directory
Examples
- same as a
M-u go up one level then look in directory jane
for x
Useful Keys and How to Get Them to Work
Ctrl + u delete the line from the
cursor to the beginning of the
line
$ cat .bashrc
$
Ctrl + u
Useful Keys and How to Get Them to Work
Ctrl + c abort the process
$ vmstat 1
Ctrl + c
$
* vmstat report virtual memory statistics
Useful Keys and How to Get Them to Work
Ctrl + z suspend the process
$ vmstat 1
Stopped vmstat 1
Ctrl + z
$ fg
fg : foreground
Typing Shortcuts
Word completion
$ cd /usr/inc
tab
$ cd /usr/include
Typing Shortcuts
Word completion
$ cd /usr/l
tab 2
lib libexec local
Typing Shortcuts
Moving around among Commands
$ mroe .bashrc
up arrow
-bash: mroe: command not found
$ more .bashrc
Then press the left arrow until the cursor lies over the o in mroe