You are on page 1of 16

Linux

Linux
Kernel
Shell
bash
Applications

Linux (Linux Kernel)


Linux

Linux Shell
Shell:
Shell:(Shell script)
:
init -> login -> passwd -> shell
Linux
Linux Xwindow
Internet
i=1
do while (i<=1000)
useradd stu$i
i=$i+1
enddo

Linux
Linux
datecalclear echo
who
mailwritemesg
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
#date -s 20041229
Wed Dec 29 00:00:00 CST 2004
#date -s 12:23:23
#date -s 2006-10-10 12:12:23

CSTChina Standard Time


Linux cal

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
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

$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.

Linux clear echo

$clear
.
$echo
.

$ echo Please insert diskette


Please insert diskette
$echo please insert \
> diskette
please insert diskette
\:
Linux who
$who
denise pts/1 Jun 8 07:07
joe
lft/0
Jun 8 08:34
$whoami

denise

joe

lft/0

Jun 8 08:34

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

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
?t2

U .
N .
? & as the mail subsystem prompt()
?
d
R .
q mail
t
enter
n n
$HOME/mbox

mail f

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

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

Linux mesg
mesg write wall root
.
$mesg n
$mesg y

Linux
<backspace>
<ctrl-c>
Shell.
<Ctrl-d>

<ctrl-u>
.

Linux

CommandName option(s) argument(s)

Windows.

\ ,

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

Linux man
,
man man
man who
man -a who
man -kkeyword keyword

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

:
NAME :
SYNOPSIS : .
DESCRIPTION :

[ ] :[ ]
a | b : a , b.
{ } :
Man
2
3
4
5
6
7
8
9


/dev
/etc/passwd


root
Linux

bash help
#help
#help if
#help set
#help help

W
su
lsmod
wget
find
locate
chroot
du
ast
ps
kill
top
which
df
head
tail
id
sleep
last
dmesg
ping
/proc
cat /proc/cpuinfo
cat /porc/meminfo

cat kallsyms | grep start_kernel

Linux -
Linux

(file)
Linux

(file)
Linux 256
._-
/

?,*,@, #,$,&,(,),\,|,;,,,`,<,>,[,]
.

+-

xu.c
.bashrc
aa.txt
mount.sh
:
regular file

directory


(device file)
Linux
EVERYTHING is a file!
--

(txt)
ASCII

--(1)

(entry) ()
(i-node number )

i-node
Linux

i-node
i-node i-node i-node entry

..

..

..

..

..
..

..
..

--
Linux I/O I/O
I/O

Linux


Linux mount
,

(Home Directory)

/home
joe/home/joe
root /root

cd
echo $HOME

pwd(print working directory)


pwd

Linux :
linux

/
.
.
..

Linux

cat
$ cat n test1
1 this is test1
$ cat n test2
1 this is test2
$ cat n test*
1 this is test1
2 this is test2
more
more

$more
$more mydata
more ,

f <Space>:
b :
<Enter>:
q <Ctrl+C>:
wc


$wc [ -options] [ Filename ]

-c
-l
-w
tabs

wc

$ wc - lwc file1 file2


4 4 33 file1
7 7 52 file2
11 11 85 total
$ wc file1
---lwc
4 4 33 file1
$who | wc l
$cat aaa | wc
ls

ls [-options] [filelist]
filelist
filelist ;
-options: ls

ls

-a .
-l

-d
R
-r
-x
--color
ASCII
--color
root /root) .bashrc ls -a )
alias ls=ls --color , #source .bashrc .

:
--->
--->
--->
->
--->()
/etc/DIR_COLORS

You might also like