Professional Documents
Culture Documents
Learn GNU Linux in Tamil Part 2
Learn GNU Linux in Tamil Part 2
- 2
.
http://kaniyam.com
GNU/Linux
- 2
2013
2013 .
:
:
. ,
.
.
.
, , www.kaniyam.com
. .
.
:
http://bit.ly/kaniyam
GNU/ Linux .
4
. ,
.
, "
.
, MySQL-
. , ""
.
. ,
.
.
,
GNU/Linux- .
,
,
.
1 , ' GNU/Linux - - 2'
,
.
.
.
,
29 2013
: nithyadurai87@gmail.com
: http://nithyashrinivasan.wordpress.com
1...................................................................................................................................9
Linux - .............................................................................9
2.................................................................................................................................15
Users- ........................................................................................................15
sudo command.............................................................................................................15
adduser command.......................................................................................................16
su command.................................................................................................................17
user- sudo .............................................17
chown command..........................................................................................................19
chgrp command...........................................................................................................20
owner group- .......................................................20
userdel Command........................................................................................................21
Groups ...........................................................................................................................23
/etc/shadow file:......................................................................................................27
3.................................................................................................................................29
Disk Management............................................................................................................29
Partition- :..........................................................................................29
fdisk- :........................................................................................................30
4................................................................................................................................36
Mount Unmount...................................................................................................36
Mount- :........................................................................................36
Unmount :....................................................................................................37
/etc/fstab..................................................................................................................37
Filesystem :......................................................................................................38
Mount Options:.........................................................................................................38
file- mount :.......................................................................................39
file system- repair :.................................................................................41
5.................................................................................................................................42
Process Management......................................................................................................42
ps command.................................................................................................................42
pstree command..........................................................................................................42
top command................................................................................................................43
Kill command................................................................................................................44
6.................................................................................................................................45
:.............................................................45
:.....................................................................................45
repositories:..............................................................................................................45
repo- ...................................................................................46
Source- :........................................................................................46
:..................................................................................46
:..........................................................................................47
- upgrade:................................................................................................48
6
:...........................................................................................................48
:.......................................................................48
Deb file :..................................................................................................48
7.................................................................................................................................50
Shell Programming .............................................................................50
Shell Script- ........................................................................................50
Shell Script- .............................................................................................51
Variables........................................................................................................................51
Global Variables............................................................................................................51
Local Variables..............................................................................................................52
local variable - :......................................................................52
Local variables- Global variables- .................................................53
Special Variables..........................................................................................................54
8.............................................................................................................................55
Shell Script- 2....................................................................................................................55
Hash # .........................................................................................55
Escape Mechanism .....................................................................................................55
Command substitution................................................................................................56
Positional Parameters..................................................................................................57
File descriptors.............................................................................................................58
Shift Command.............................................................................................................61
exit Command..........................................................................................................61
Numerical Comparisons..............................................................................................61
Arithmetic Operators & Expressions........................................................................62
Conditional Operators.................................................................................................63
9.................................................................................................................................64
Shell Scripting 3............................................................................................................64
Programming language Constructs..............................................................................64
If Statement..................................................................................................................64
case Statement............................................................................................................65
for Loop..........................................................................................................................67
while Loop......................................................................................................................69
until Loop.......................................................................................................................70
Functions........................................................................................................................72
10...............................................................................................................................74
Job Scheduling..................................................................................................................74
at command..................................................................................................................74
crontab ..........................................................................................................................74
11...............................................................................................................................77
Rsync backup .........................................................................................77
;......................................................................................................77
.....................................................................................................................85
.......................................................................................................................85
........................................................................................................................85
.............................................................................................................86
........................................................................................................86
7
30, 2013
, .
: . .. , ,
, ( )
: . , 2004- ,
. ( )
,
,
- , . ..
100 (6500 ) .
, " MySQL" 5000
.
Linux -
, Linux
.
.
Linux 20- 70- .
1969- AT&T subsidiary- Bell
Laboratories Unix .
unix- Linux .
Linux .
GNU Minix .
GNU
1983- Richard M Stallman
GNU .
Cambridge- Massachusetts Institute
of Technology Artificial
Intelligence
.
Stallman
.
source code-
. .
AT&T unix- $40,000
.
" unix- source
code- "
.
. Stallman- .
source code
source code -
10
. Stallman-
.
.
1983- Stallman GNU
.
.
Stallman :
========
, 27, 1983 12:35:59 EST
GNU (GNU is Not Unix) Unix compatible software system-
. ,
,
.
GNU kernel C Programs-
utilities- . editor, shell, C Compiler,
linker, assembler . text editor,
a YACC, an Empire game, spreadsheet applications-
.
online hardcopy documentation- .
GNU- unix . unix-
.
.
==========
.
GNU GNU is Not Unix . Unix
.
. unix-
windows- . , Stallman
Manifest GNU GPL (General Public License)
.
GPL-
() .
11
(Freedom #0)
,
(Freedom #1)
(Freedom #2)
Program- , programs-
(Freedom #3).
.
.
GPL
.
,
.
1990- GNU
components . Emacs
text editor, Compiler gcc, GNU C Compiler debugger gdb
stallman .
compiler
, .
compilers, C++, Pascal Fortran
. GCC GNU Compiler
Collection .
Richard Stallman- 1990- GNU System-
. component- kernel
. kernel- (GNU Hurd )
Mach- set of server process- implement
. Mach Carnegie Mellon Utah
micro kernel .
kernel
.
12
Minix:
1990- Intel Microprocessor-, Microsoft-
. Microsoft
desktop , server . Intel
Intel compatible processors- , unix-
workstations- .
unix based system- versions,
Intel- .
Unix- processors- (eg: SGI & MIPS)
. Unix-
Intel Processor- OS . 1987-
Andrew Tanenbaum Minix OS-
. Netherlands- , Amsterdam
Vrije University-
. Minix-
OS-
.
OS
. C Assembly language-
12,000
.
Tanenbaum- "Operating Systems: Design and Implementation"
Minix
. Linus Torvalds
Minix- Linux- .
Linux:
1991- Linus Benedict Torvalds Finland , Intel
Processor- Unix
kernel- . Minix
prototype- .
Minix-
kernel- GPL
. Linus Torvalds kernel-
Linux .
1991- August 25- , Minix news group-
Torvalds- .
.
13
:
Minix
!!!
.
. GNU
.
.
Minix- .
Minix-
.
.
.
bash(1.08) gcc(1.40)- port .
.
torvalds@kruuna.helsinki.fi .
================
.
Torvalds Freax
kernel/makefile 0.11- programs- .
Ari lemmke FTP site- system- load
directory- pub/OS/Linux . Linux
OS- .
1991- Torvalds -
.
Torvalds- .
1992- Linux - ,
.
Torvalds-
. Torvalds .
Linux- . Linux
. Linux - GPL
,
Linux versions-
14
.
Linux .
compile distribution format-
.
Linux GNU GNU/Linux Distribution
.
Red Hat, Caldera
. Debian
distribution . X-windows system, KDE,
GNOME GUI- distributions-
.
Torvalds
. version 0.01- acknowledgement
copyrights- . , GNU
license- .
Linux-
.
1992- February GNU/Linux distributions- floppy
disk-
, floppy disk-
.
linux .
GNU
GNU/Linux- .
GCC Compiler- linux .
GPL . Torvalds version
0.12- GPL .
GNU/Linux
GNU/Linux-
. GNU/Linux
.
15
Users-
user management- commands-
.
root ?
Ubuntu- install
root account- . root-
disable ubuntu developers
. root- .
sudo tool- .
sudo- root-
.
Ubuntu- install /etc/sudoers
file- . sudo
admin group-
.
sudo command
sudo- root user- command
.
root- sudo-
. sudo- , root user
.
root-
. sudo-
. adduser command- .
16
adduser command
sudo adduser command-
user- . .
$ adduser harini
, harini user .
users /etc/passwd
. harini
user .
$ cat /etc/passwd
password x . /etc/shadow
users- encrypt password-
. .
17
$ sudo cat /etc/shadow
su command
su switch user . su
.
logout login .
$ su harini
user- sudo
root user sudo user, user--
sudo . harini- sudo
, /etc/group- harini- .
.
18
19
harini- sudo
chown command
chown command- file- owner- .
LKG file- user, Nithya . Harini
, command- .
$ chown harini LKG
20
chgrp command
chgrp command- file- group- .
LKG file- group, Nithya . Harini
, command- .
$ chgrp harini LKG
owner group-
chmod command owner group-
.
$ chmod nithya:shrini LKG
21
userdel Command
userdel command- user- .
$ userdel harini
Password Policy:
password .
. password 4
, entropy checks-
.
22
/etc/pam.d/common-password file-
.
password :
user- , password-
.
password- .
password-
command .
$ sudo chage -l shrini
23
command- .
$ sudo chage shrini
password- .
sudo chage -l shrini
.
Groups
groups- command
. groups
groups- .
24
$ cat /etc/group
groups- command
.
$ groups shrini
group- commands .
$ sudo addgroup clg
$ sudo delgroup clg
25
clg group ,
.
group- :
$ sudo delgroup --only-if-empty group
user- group- :
$ sudo usermod -G group -a user
User :
user- backup .
$ sudo deluser --backup-to /location/to/put/backup/user
--remove-home user
User-
user- home directory
$ sudo deluser --remove-home user
26
user, home directory user- ownership file-
Group-
user- Group- .
$ id user
/ etc/ passwd- :
. file- :
. 7 .
27
1. username :
2. password : . x . /etc/shadow
file- .
3. User id (UID) : user id ( ) . 0
root- . 1-999 system user-
human user- .
4. Group id (GID) : , (Primary group id
/etc/group ) - .
5. User Id info: . .
, , . finger
.
6. home directory: home directory ().
.
7. command / shell: login command
shell /bin/bash. command .
$ less /etc/passwd
$ grep nithya /etc/passwd
28
1. Username :
2. Password
: ( encryption )
7. Inactive
: ,
8. expire
29
3
Disk Management
Hard disk .
/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd
:
:
:
:
Primary Master
Primary slave
Secondary Master
Secondary slave
Partition- :
partition-
$ sudo fdisk-l
30
1. disk- partition-
$ sudo fdisk -l /dev/sda
fdisk- :
, partition .
. m
# fdisk
/dev/sda
31
l
m
n
o
p
q
s
t
u
v
w
x
2. partition-
# fdisk /dev/sda
The number of cylinders for this disk is set to 9729.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf6edf6ed
Device Boot
/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4
/dev/sda5
*
/dev/sda6
/dev/sda7
/dev/sda8
/dev/sda9
Start
1
1960
5284
6529
1960
2662
2905
3148
3265
End
1959
5283
6528
9729
2661
2904
3147
3264
5283
Blocks
15735636
26700030
10000462+
25712032+
5638752
1951866
1951866
939771
16217586
Id
c
f
7
c
83
83
83
82
b
System
W95 FAT32 (LBA)
W95 Ext'd (LBA)
HPFS/NTFS
W95 FAT32 (LBA)
Linux
Linux
Linux
Linux swap / Solaris
W95 FAT32
32
WARNING: Re-reading the partition table failed with error 16: Device or resource
busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
3. partition-
partition- , cylinder ,
partition- () cylinder .
p, print .
# fdisk
/dev/sda
w .
mkfs format .
33
# mkfs.ext3 /dev/sda7
4. boot flag-
partition- boot a .
.
# fdisk /dev/sda
The number of cylinders for this disk is set to 9729.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf6edf6ed
Device Boot
/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4
/dev/sda5
*
/dev/sda6
/dev/sda7
Start
1
1960
5284
6529
1960
3265
2662
End
1959
5283
6528
9729
2661
5283
3264
Blocks
15735636
26700030
10000462+
25712032+
5638752
16217586
4843566
Id
c
f
7
c
83
b
83
System
W95 FAT32 (LBA)
W95 Ext'd (LBA)
HPFS/NTFS
W95 FAT32 (LBA)
Linux
W95 FAT32
Linux
Id
c
f
7
c
83
b
83
System
W95 FAT32 (LBA)
W95 Ext'd (LBA)
HPFS/NTFS
W95 FAT32 (LBA)
Linux
W95 FAT32
Linux
Start
1
1960
5284
6529
1960
3265
2662
End
1959
5283
6528
9729
2661
5283
3264
Blocks
15735636
26700030
10000462+
25712032+
5638752
16217586
4843566
34
Partition table entries are not in disk order
Command (m for help):
5. partition order-
logical partition- ,
, . Partition out of order. Partition table
entries are not in disk order.
Sda6, sda7, sda8 .
sda6 , sda7 . sda9 ,
sda6 . f .
.
$ fdisk
/dev/sda
Start
1
1960
5284
6529
1960
3265
2662
End
1959
5283
6528
9729
2661
5283
3264
Blocks
15735636
26700030
10000462+
25712032+
5638752
16217586
4843566
Id
c
f
7
c
83
b
83
System
W95 FAT32 (LBA)
W95 Ext'd (LBA)
HPFS/NTFS
W95 FAT32 (LBA)
Linux
W95 FAT32
Linux
35
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource
busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
36
4
Mount Unmount
Partition- .
file system . ext3, ext4,
ReiserFS, Btrfs / filesystems.
Journalins Filesystem .
index , file
index . , , hard
disk- .
mkfs file system .
sudo mkfs.ext4 /dev/sda5
sudo mkfs.reiserf5 /dev/sda6
file system mount
.
mount raw- device/partition
/ folder .
Mount disk partition, Linux network share, windows network share, iso file
cd/dvd folder .
Mount- :
root sudo
.
1:
sudo mount /dev/sda5 /songs
/dev/sda5 /songs- mount . ls /songs
cd /songs /dev/sda5 file- .
37
2:
sudo mount -t iso9660 movie.iso /media/movie
movie.iso ISO file- /media/movie folder- mount .
folder- mount . mount point .
mount filesystem- , mount
.
Unmount :
mount filesystem unmount
.
root- . mount file
folder , unmount
.
sudo umount
/media/movie
/ etc/ fstab
boot filesystem- mountpoint- mount
. /etc/fstab file .
6 column .
filesystem .
38
Filesystem :
filesystem :
ext3/ext4
iso9660
proc
vfat
auto
nts
smbfs
: / file system
: iso file
: proc virtual file system
: fat 16, fat 32 file system
: filesystem
: network file system
: network file system
Mount Options:
Mount -o , .
/etc/fstab- .
noauto
: boot mount .
cd/dvd .
ro
: Read-Only mount
users : root mount () unmount
.
user
: , mount unmount
39
/etc/fstab- 5 column, dump .
dump, restore backup . filesystem
1 , cd/dvd/usb removable media- 0 .
6 column- pass-no . boot file system check
.
root / 1
boot- mount file system- 0
file system- 2
file- mount :
iso file file- device mount .
1.44 MB file .
dd if=/dev/zero of=disk.img bs=1024 count=1400
dd = disk dump
if = input file
of = output file
bs = block size
count = count of dump operation
file- .
file system back level copy .
dd if=/dev/sdb1 of=usb.img
mount -o loop usb.img /mnt/disk
40
disk :
disk space :
df
folder- :
du <foldername>
folder- .
du -h
du -sh
41
.
sudo fsck -y -f /dev/sda5
-y = yes for questions
-f = force
fdisk file system unmount .
42
5
Process Management
process . parent process child process .
init process .
process- pid refer .
ps command
ps command-
process- .
ps
pstree command
pstree command-
process-, parent process child process-
tree .
pstree
43
top command
top command- process
process- . output-
real time monitoring .
$ top
44
Kill command
process- .
process- signal-
$ kill 2180
screenshot- terminal- pid 2180
. kill 2180 , terminal
.
45
:
synaptic, software center GUI
, command- .
Apt
, ,
. user interface, module, library, translation
.
. dependancy .
Package management system
, , .
Redhat distribution- yum , debian, ubuntu APT, Arch
linux- pacman .
:
sudo apt-cache search [search term 1] [search term 2] [search
term n]
repositories:
debian, ubuntu, centos, suse distribution
package .
repository .
repository- .
, .
46
debian, ubuntu- /etc/apt/sources.list repository .
repo-
sudo add-apt-repository [repository name here]
sudo add-apt-repository ppa:tualatrix/ppa
Source- :
repo- repo .
sudo apt-get update
:
:
sudo apt-get install [package name 1] [package name 2] [package
name n]
47
,
repository- .
:
sudo apt-get remove [package name 1] [package name 2] [package
name n]
48
configuration file directory
purge .
sudo apt-get remove purge <name1> <name2>
- upgrade:
sudo apt-get upgrade <name1> <name2> ... <name n>
upgrade
sudo apt-get upgrade
, ,
.
sudo apt-get -s upgrade
, simulate .
:
repo- deb file-
.
sudo apt-get clean
:
sudo dpkg list
,
.
Deb file :
49
debian/ubuntu packages deb .
,
.
50
7
Shell Programming
, shell-
, program- .
shell- programming language-
. programming language-
programming constructs, logical conditional operators, command
substitution, escape mechanisms, positional parameters
shell- .
Shell Script-
unix- commands-
. commands
"shell script"
.
date, ls, uname, echo unix commands-
'example1' file- . .
51
Shell Script-
shell script- .
1: sh unix command- script file- argument-
shell script- . .
Variables
Unix-, variables-, local variables global variable
.
.
Global Variables
Global Variables unix
,
. environment variables .
PATH variable- directory-
. PS1 variable- shell prompt-
, HOME variable- home directory-
.
$ (dollar) variables- ,
.
52
$ $PATH
$ $PS1
$ $HOME
Local Variables
shell environment- variable- local variable
. shell environment- ,
. 'shell variables'
.
local variable - :
a,b 2 variable- shell environment-
.
variables- echo .
.
53
54
variables- shell script- .
.
Special Variables
Local variable global variable unix-
variable- .
$# positional parameters
.
$- shell options- ,
$? execute command- exit .
$$ shell- process .
$! background command- process .
$0 execute command- .
$* Positional parameters- .
55
8
Shell Script- 2
Hash #
# type ,
type , execution
.
shell script
, # ,
shell script- .
ec.sh file- comment- ,
run .
output- comment-
.
Escape Mechanism
. *
(Asterisk symbol) echo .
56
echo command- *- .
* unix- special character.
* , Unix
. character-
unix- .
special characters- character-
unix- , character- backslash
(\) .
* .
escape mechanism .
Command substitution
. unix command- echo .
57
ls .
ls command- backticks- echo
.
Positional Parameters
Shell script- command line- arguments-
. shell script- $1
argument-, $2 argument-, $3
argument- .
$0 shell script- , $* command
line- arguments- .
$1,$2,$3 , arguments- position-
, positional parameters .
arguments.sh shell script- .
58
File descriptors
File descriptors 0,1 2 standard input,
standard output standard error- .
shell script- , commands
, error messages ,
program .
59
descriptors- , error messages
, file- ,
program .
man xyz command error-
. error descriptor- 2-
file- .
$ man xyz 2> file2
60
61
Shift Command
shell script- $1 $9 positional
parameters- . ,
shift command- .
exit Command
exit command- shell script- .
shell script-
0-, 1- .
Numerical Comparisons
shell script-
. , 3 5
.
3 -eq 5 (3 5 (equals) )
3 -ne 5 (3 5 (not equals) )
3 -gt 5 (3- 5- (greater than) )
3 -lt 5 (3- 5- (greater than) )
3 -ge 5 (3- 5-
(greater than or equal to) )
3 -le 5 (3- 5-
(greater than or equal to) )
command line- .
$
$
$
$
[
[
[
[
3
3
3
3
-eq
-eq
-lt
-lt
3
5
5
2
]
]
]
]
&&
&&
&&
&&
echo
echo
echo
echo
true
true
true
true
62
expr
expr
expr
expr
6
6
6
6
+ 4
- 4
\* 4
/ 4
* operators- , \
escape operator- .
, / operator- ,
,
.
63
Conditional Operators
commands- successful execution-
failed execution- commands- execute
. && || conditional
execution operators .
&& operator- successful execution- ,
|| operator- failed execution-
commands- execute .
$ grep Apple fruits && echo found || echo Not found
$ grep Mango fruits && echo found || echo Not found
64
9
Shell Scripting 3
Programming language Constructs
Shell- programming language- looping & branching,
operations on variables, file creation argument passing
. shell-, DOS-
batch files- .
If Statement
If Construct- condition- set of commands-
execute .
syntax:
if (condition)
then
commands
else
commands
fi
:
example2.sh file- if statement- ,
run .
65
case Statement
Case statement option- ,
commands- execute .
syntax:
case value in
choice1) commands; ;
choice2) commands; ;
. . .
esac
:
example3.sh file- case statement- ,
run .
66
67
for Loop
list-
output- .
syntax:
for <variable> in
do
Commands
done
<looping condition>
:
example4.sh file- for loop- , run
.
68
69
.
while Loop
while loop- condition loop-
commands- execute .
syntax:
while <looping condition>
do
Commands
done
70
:
example5.sh file- while loop- ,
run .
i variable- 1 assign .
while loop- condition , i variable,
5 loop- execute
.
loop- i variable
. i- 5-
loop output .
until Loop
until loop- while loop- . until
loop- condition loop- commands-
execute .
71
syntax:
until <looping condition>
do
Commands
done
:
example6.sh file- until loop- , run
.
output .
72
Functions
shell script- function
. commands-
, logical
function- .
functions-
.
function input , parameter
.
Syntax:
function_name () {
commands
}
:
functions.sh file- function- , run
.
73
74
10
Job Scheduling
Shell- jobs- schedule at crontab 2
commands . .
at command
command/shell script execute
schedule
at command .
$ touch india | at 16.39
touch command 4:39 PM- india file-
.
crontab
Crontab- command/shell script-,
execute .
crontab- file . crontab -e
file- open .
.
minute - (0 59 )
hour - (0 23 )
day of month - (1 31 )
month - (1 12 )
day of week - (0 6 ) (0=Sunday)
75
touch command 25- 4. 40
crontab-
command .
$ crontab -e
40 16 25 * * touch trade
(press)Esc:wq
(press)Enter
40 , 16 ,
25 . *
, * .
crontab- schedule commands
l option- . .
$ crontab -l
76
77
11
Rsync backup
. ,
.
rsync ,
, , .
;
:
source file directory
destination . , Source
file directory . backup
, .
:
, ssh
encryption - - , .
bandwidth:
, .
(compress). , .
(extract). bandwidth .
:
. root
.
Syntax:
rsync <options> <source> <destination>
source destination , network
. , , IP
hostname destination full path
.
78
- 1;
directory sync .
-zvr options .
,
-z = compress -
-v = verbose -
-r = recusrsive - .
timestamp .
$ ls -l /var/opt/installation/inventory/sva.xml /root/temp/sva.xml
-r--r--r-- 1 bin bin 949 Jun 18 2009 /var/opt/installation/inventory/sva.xml
-r--r--r-- 1 root bin 949 Sep 2 2009 /root/temp/sva.xml
. .
2: metadata sync .
Rsync -a option
sync .
-a = archive mode
symbolic link
permissions
timestamp
owner, group
-a .
79
$ rsync -azv /var/opt/installation/inventory/ /root/temp/
building file list ... done
./
sva.xml
svB.xml
.
sent 26499 bytes received 1104 bytes 55206.00 bytes/sec
total size is 44867 speedup is 1.63
$
timestamp sync .
$ ls -l /var/opt/installation/inventory/sva.xml /root/temp/sva.xml
-r--r--r-- 1 root bin 949 Jun 18 2009 /var/opt/installation/inventory/sva.xml
-r--r--r-- 1 root bin 949 Jun 18 2009 /root/temp/sva.xml
3: file- rsync
$ rsync -v /var/lib/rpm/Pubkeys /root/temp/
Pubkeys
sent 42 bytes received 12380 bytes 3549.14 bytes/sec
total size is 12288 speedup is 0.99
2432411.23 bytes/sec
80
6: remote shell
-e option remote shell .
-e ssh encryption rsync .
$ rsync -avz -e ssh shrini@192.168.200.10:/var/lib/rpm /root/temp
Password:
receiving file list ... done
rpm/
rpm/Basenames
sent 406 bytes received 15810230 bytes
total size is 45305958 speedup is 2.87
2432405.54 bytes/sec
7: Destination- , overwrite
.
destination- File . rsync
source- . -u option
.
$ ls -l /root/temp/Basenames
total 39088
-rwxr-xr-x 1 root root
4096 Sep
2 11:35 Basenames
81
rpm/
sent 122 bytes received 505 bytes 114.00 bytes/sec
total size is 45305958 speedup is 72258.31
$ ls -lrt
total 39088
-rwxr-xr-x 1 root root
4096 Sep
2 11:35 Basenames
318.46 bytes/sec
9: Progress
file- rsync , .
rsync .
--progress .
rsnapshot .
$ rsync -avz --progress shrini@192.168.200.10:/var/lib/rpm/ /root/temp/
Password:
receiving file list ...
19 files to consider
./
Basenames
5357568 100%
14.98MB/s
0:00:00 (xfer#1, to-check=17/19)
Conflictname
12288 100%
35.09kB/s
0:00:00 (xfer#2, to-check=16/19)
.
.
.
sent 406 bytes received 15810211 bytes 2108082.27 bytes/sec
total size is 45305958 speedup is 2.87
82
# Source and target are in sync. Now creating new file at the target.
$ > new-file.txt
$ rsync -avz --delete shrini@192.168.200.10:/var/lib/rpm/ .
Password:
receiving file list ... done
deleting new-file.txt
./
sent 26 bytes received 390 bytes 48.94 bytes/sec
total size is 45305958 speedup is 108908.55
11: rsync
source file , target
file rsync . --existing .
[/var/lib/rpm ]$ > new-file.txt
$ rsync -avz --existing root@192.168.1.2:/var/lib/rpm/ .
root@192.168.1.2's password:
receiving file list ... done
./
sent 26 bytes received 419 bytes 46.84 bytes/sec
total size is 88551424 speedup is 198991.96
12: source/destination
-i .
Source:
$ ls -l /var/lib/rpm
-rw-r--r-- 1 root root
-rw-r--r-- 1 root root
-rw-r--r-- 1 root root
83
Destination:
$ ls -l /root/temp
-rw-r--r-- 1 root root
-rw-r--r-- 1 bin bin
-rw-r--r-- 1 root root
13:
rsync- ,
.
$ rsync -avz --include 'P*' --exclude '*' shrini@192.168.200.10:/var/lib/rpm/
/root/temp/
Password:
receiving file list ... done
./
Packages
Providename
Provideversion
Pubkeys
sent 129 bytes received 10286798 bytes
total size is 32768000 speedup is 3.19
2285983.78 bytes/sec
84
Installtid
Name
Sha1header
Sigmd5
Triggername
sent 252 bytes received 123081 bytes 18974.31 bytes/sec
total size is 45305958 speedup is 367.35
2874657.64 bytes/sec
85
.
, , .
.
.
, ,
.
.
.
.
editor@ kaniyam. com
.
:
.
.
, .
.
,
.
.
, , , , ,
.
.
editor@kaniyam.com
.
86
, .
editor@kaniyam.com .
.
.
.
.
.
2013 .
http://creativecommons.org/licenses/by-sa/3.0/
.
,
, , , , ,
.
: . editor@kaniyam.com +91 98417 95468
.
: . , 4, , 42, ,
- 600 059
. : +91 98417 95468 tshrinivasan@gmail.com
:
LibreOffice Writer 4.0.3.3
Kubuntu Linux
13.04 |
Gimp 2.8
87
Creative Commons
.
.
88
GNU/ Linux
- - 3
Basics of Networking
Basic Network Settings
Domain Name Server
Network File Server
Dynamic Host Control Protocol
Printing
Apache Web server
Ssh
.