You are on page 1of 30

Linux

2015.07
rgz@sdu.edu.cn

Linux

Kernel
Shell bash
Applications

Linux (1/4)

Linux (Linux

Kernel)

Linux

Linux (2/4)

Linux

Shell

Shell:

Shell: (Shell
script)
:
init -> login -> passwd ->
shell

Linux (3/4)

Linux

Shell
Interpreter

User:
ls command

shell

Kernel

ls: list directory contents


5

Linux (4/4)

Linux

Linux
Xwindow
Internet

i=1
do while (i<=1000)
useradd stu$i
i=$i+1
enddo
6

Linux

Linux
date cal clear echo
who
mail write mesg
man

Linux Linux

$login: UserName

$password: [your password]


shell

$ Ctrl-d

$ exit
$ logout

login:
# ,$

Linux date
$date

Wed Sep 29 09:58:29 CST 2004

Wed Dec 29 00:00:00 CST 2004

#date -s 20041229

#date -s 12:23:23

#date -s 2006-10-10 12:12:23

CST China Standard Time

Linux cal (1/3)

cal [month] [year]


$cal 1 2000
January 2000
Su Mo Tu We Th Fr Sa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

10

Linux cal (2/3)


cal [month] [year]
$cal

2009

1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

11

Linux cal (3/3)


$cal

2004

, 12

$cal 00
$cal 99
$cal 01

cal 00 produces an error the year must be


a number between 1 and 9999

The calendar for the year 1 AD.

12

Linux clear echo


$clear
$echo

.
.

$ echo Please insert diskette


Please insert diskette

$echo please insert \

\:

> diskette
please insert diskette

13

Linux who
$who

denise pts/1 Jun 8 07:07


joe
lft/0
Jun 8 08:34

$whoami

the user joe, on


terminal lft/0,
logged in at
8:34 a.m. on
June 8.

denise

14

Linux mail (1/4)


mail E-mail
$ mail <username>

$mail joe
Subject:meeting
Dontforget about the meeting today!
<ctrl-d>
<ctrl-d> !!
Cc: <enter>
$

15

Linux mail (2/4)


mail E-mail
$mail
Mail version 8.1 6/6/93. Type ? for help.
"/var/spool/mail/joe": 3 messages 2 new
> U 1 test@localhost.local Thu Sep 15 10:02 16/645 Hello!
N 2 test@localhost.local Thu Sep 15 10:03 16/644
Information
N 3 test@localhost.local Thu Sep 15 10:05 16/644
Meeting

? t 2

U .
N .
? & as the mail subsystem prompt(
)

16

Linux mail (3/4)


?
d
R .
q mail
t
enter
n n
$HOME/mbox

mail f
17

Linux wall

# wall the system will be shutdown from 10 pm today.

Broadcast message from root (pts/0) (Wed Sep


14 11:16:16 2005):
the system will be shutdown from 10pm today

18

Linux write
write
$write <username>
$write joe
$write sam
<ctrl-d> .
EOF
<ctrl-d>

19

Linux mesg
mesg write wall
root
.

$mesg n
$mesg y

20

Linux

<backspace>
<ctrl-c>
<Ctrl-d>
<ctrl-u>

Shell.

21

Linux

CommandName option(s) argument(s)

Windows.

\ ,

22

Linux
$ls -a l
$ls -al
$ls -l test
$ls --help

23

Linux man
,
man man
man who
man -a who

man -k keyword
keyword
<Space bar> :
<Enter>
:
<b> :
<f> :
<ctrl-c> or q: man .
24

Linux man
:
NAME :
SYNOPSIS : .
DESCRIPTION :
[ ]
a | b
{ }

:[ ]
: a , b.
:

25

man

1
2
3
4
5
6
7
8
9


/dev
/etc/passwd


root
Linux

26

bash help

#help
#help
#help
#help

if
set
help

27

w
last
ps
kill
top
which
df

du
su
lsmod
wget
find
locate
chroot

head
tail
id
sleep
last
dmesg
ping
28

/proc

cat
cat

/proc/cpuinfo
/porc/meminfo

cat

kallsyms | grep
start_kernel

29

30

You might also like