20 Advanced nga mga Sugo alang sa mga Eksperto sa Linux
Salamat sa tanang likes, maayong mga pulong ug suporta nga imong gihatag kanamo sa unang duha ka bahin niining artikuloha. Sa una nga artikulo among gihisgutan ang mga sugo alang sa mga tiggamit nga bag-o lang mibalhin sa Linux ug nanginahanglan sa kinahanglan nga kahibalo aron magsugod.
- 20 Mapuslanon nga Sugo para sa Linux Newbies
Sa ikaduhang artikulo among gihisgutan ang mga sugo nga gikinahanglan sa usa ka tunga-tunga nga lebel sa pagdumala sa iyang kaugalingong sistema.
- 20 Advanced Commands para sa Middle Level Linux Users
Unsay sunod? Niini nga artikulo akong ipasabut kadtong mga sugo nga gikinahanglan alang sa pagdumala sa Linux Server.
41. Sugo: ifconfig
ifconfig gigamit sa pag-configure sa kernel-resident network interface. Gigamit kini sa panahon sa pag-boot aron ma-set up ang mga interface kung gikinahanglan. Pagkahuman niana, kasagaran gikinahanglan lamang kung mag-debug o kung gikinahanglan ang pag-tune sa sistema.
[[email ~]$ ifconfig eth0 Link encap:Ethernet HWaddr 40:2C:F4:EA:CF:0E inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::422c:f4ff:feea:cf0e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:163843 errors:0 dropped:0 overruns:0 frame:0 TX packets:124990 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:154389832 (147.2 MiB) TX bytes:65085817 (62.0 MiB) Interrupt:20 Memory:f7100000-f7120000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:78 errors:0 dropped:0 overruns:0 frame:0 TX packets:78 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4186 (4.0 KiB) TX bytes:4186 (4.0 KiB)
Ipakita ang mga detalye sa Tanan nga mga interface lakip ang mga disabled nga mga interface gamit ang -a nga argumento.
[[email ~]$ ifconfig -a eth0 Link encap:Ethernet HWaddr 40:2C:F4:EA:CF:0E inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::422c:f4ff:feea:cf0e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:163843 errors:0 dropped:0 overruns:0 frame:0 TX packets:124990 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:154389832 (147.2 MiB) TX bytes:65085817 (62.0 MiB) Interrupt:20 Memory:f7100000-f7120000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:78 errors:0 dropped:0 overruns:0 frame:0 TX packets:78 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4186 (4.0 KiB) TX bytes:4186 (4.0 KiB) virbr0 Link encap:Ethernet HWaddr 0e:30:a3:3a:bf:03 inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[[email ~]$ ifconfig eth0 down
[[email ~]$ ifconfig eth0 up
I-assign ang 192.168.1.12 isip IP address para sa interface eth0.
[[email ~]$ ifconfig eth0 192.168.1.12
[[email ~]$ ifconfig eth0 netmask 255.255.255.
[[email ~]$ ifconfig eth0 broadcast 192.168.1.255
[[email ~]$ ifconfig eth0 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255
Mubo nga sulat: Kung naggamit ka usa ka wireless network kinahanglan nimo nga gamiton ang command iwconfig. Alang sa dugang nga ifconfig nga mga panig-ingnan sa sugo ug paggamit, basaha ang 15 Mapuslanon nga \ifconfig nga mga Sugo.
42. Sugo: netstat
Ang netstat command nagpakita sa nagkalain-laing impormasyon nga may kalabutan sa network sama sa mga koneksyon sa network, routing tables, interface statistics, masquerade connections, multicast memberships etc..,
[[email ~]$ netstat -a Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node Path unix 2 [ ACC ] STREAM LISTENING 741379 /run/user/user1/keyring-I5cn1c/gpg unix 2 [ ACC ] STREAM LISTENING 8965 /var/run/acpid.socket unix 2 [ ACC ] STREAM LISTENING 18584 /tmp/.X11-unix/X0 unix 2 [ ACC ] STREAM LISTENING 741385 /run/user/user1/keyring-I5cn1c/ssh unix 2 [ ACC ] STREAM LISTENING 741387 /run/user/user1/keyring-I5cn1c/pkcs11 unix 2 [ ACC ] STREAM LISTENING 20242 @/tmp/dbus-ghtTjuPN46 unix 2 [ ACC ] STREAM LISTENING 13332 /var/run/samba/winbindd_privileged/pipe unix 2 [ ACC ] STREAM LISTENING 13331 /tmp/.winbindd/pipe unix 2 [ ACC ] STREAM LISTENING 11030 /var/run/mysqld/mysqld.sock unix 2 [ ACC ] STREAM LISTENING 19308 /tmp/ssh-qnZadSgJAbqd/agent.3221 unix 2 [ ACC ] STREAM LISTENING 436781 /tmp/HotShots unix 2 [ ACC ] STREAM LISTENING 46110 /run/user/ravisaive/pulse/native unix 2 [ ACC ] STREAM LISTENING 19310 /tmp/gpg-zfE9YT/S.gpg-agent ....
[[email ~]$ netstat -at Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost:mysql *:* LISTEN tcp 0 0 *:5901 *:* LISTEN tcp 0 0 *:5902 *:* LISTEN tcp 0 0 *:x11-1 *:* LISTEN tcp 0 0 *:x11-2 *:* LISTEN tcp 0 0 *:5938 *:* LISTEN tcp 0 0 localhost:5940 *:* LISTEN tcp 0 0 ravisaive-OptiPl:domain *:* LISTEN tcp 0 0 ravisaive-OptiPl:domain *:* LISTEN tcp 0 0 localhost:ipp *:* LISTEN tcp 0 0 ravisaive-OptiPle:48270 ec2-23-21-236-70.c:http ESTABLISHED tcp 0 0 ravisaive-OptiPle:48272 ec2-23-21-236-70.c:http TIME_WAIT tcp 0 0 ravisaive-OptiPle:48421 bom03s01-in-f22.1:https ESTABLISHED tcp 0 0 ravisaive-OptiPle:48269 ec2-23-21-236-70.c:http ESTABLISHED tcp 0 0 ravisaive-OptiPle:39084 channel-ecmp-06-f:https ESTABLISHED ...
[[email ~]$ netstat -s Ip: 4994239 total packets received 0 forwarded 0 incoming packets discarded 4165741 incoming packets delivered 3248924 requests sent out 8 outgoing packets dropped Icmp: 29460 ICMP messages received 566 input ICMP message failed. ICMP input histogram: destination unreachable: 98 redirects: 29362 2918 ICMP messages sent 0 ICMP messages failed ICMP output histogram: destination unreachable: 2918 IcmpMsg: InType3: 98 InType5: 29362 OutType3: 2918 Tcp: 94533 active connections openings 23 passive connection openings 5870 failed connection attempts 7194 connection resets received ....
OK! Alang sa pipila ka rason kung gusto nimo nga dili masulbad ang host, port ug user name isip output sa netstat.
[[email ~]$ netstat -an
Maayo, kinahanglan nimo nga makuha ang output sa netstat nga padayon hangtod nga mapasa ang interrupt nga panudlo (ctrl+c).
[[email ~]$ netstat -c
Para sa dugang nga “netstat” command examples ug paggamit, tan-awa ang artikulo 20 Netstat Command Examples.
43. Sugo: nslookup
Usa ka programa sa utility sa network nga gigamit aron makakuha og kasayuran bahin sa mga server sa Internet. Sama sa gisugyot sa ngalan niini, ang utility nakakaplag impormasyon sa name server alang sa mga domain pinaagi sa pagpangutana sa DNS.
[[email ~]$ nslookup linux-console.net Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: linux-console.net Address: 50.16.67.239
[[email ~]$ nslookup -query=mx linux-console.net Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: linux-console.net mail exchanger = 0 smtp.secureserver.net. linux-console.net mail exchanger = 10 mailstore1.secureserver.net. Authoritative answers can be found from:
[[email ~]$ nslookup -type=ns linux-console.net Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: linux-console.net nameserver = ns3404.com. linux-console.net nameserver = ns3403.com. Authoritative answers can be found from:
[[email ~]$ nslookup -type=any linux-console.net Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: linux-console.net mail exchanger = 10 mailstore1.secureserver.net. linux-console.net mail exchanger = 0 smtp.secureserver.net. linux-console.net nameserver = ns06.domaincontrol.com. linux-console.net nameserver = ns3404.com. linux-console.net nameserver = ns3403.com. linux-console.net nameserver = ns05.domaincontrol.com. Authoritative answers can be found from:
[[email ~]$ nslookup -type=soa linux-console.net Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: linux-console.net origin = ns3403.hostgator.com mail addr = dnsadmin.gator1702.hostgator.com serial = 2012081102 refresh = 86400 retry = 7200 expire = 3600000 minimum = 86400 Authoritative answers can be found from:
Usba ang numero sa port gamit ang gusto nimong ikonektar
[[email ~]$ nslookup -port 56 linux-console.net Server: linux-console.net Address: 50.16.76.239#53 Name: 56 Address: 14.13.253.12
44. Sugo: pagkalot
Ang dig usa ka himan alang sa pagpangutana sa mga DNS nameserver alang sa kasayuran mahitungod sa mga adres sa host, pagbayloay sa mail, mga nameserver, ug may kalabutan nga impormasyon. Kini nga himan mahimong gamiton gikan sa bisan unsang Linux (Unix) o Macintosh OS X operating system. Ang labing kasagaran nga paggamit sa pagkalot mao ang pagpangutana lamang sa usa ka host.
[[email ~]$ dig linux-console.net ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> linux-console.net ;; global options: +cmd ;; Got answer: ;; ->>HEADER<
[[email ~]$ dig linux-console.net +nocomments ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> linux-console.net +nocomments ;; global options: +cmd ;linux-console.net. IN A linux-console.net. 14400 IN A 40.216.66.239 ;; Query time: 418 msec ;; SERVER: 192.168.1.1#53(192.168.1.1) ;; WHEN: Sat Jun 29 13:53:22 2013 ;; MSG SIZE rcvd: 45
[[email ~]$ dig linux-console.net +noauthority ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> linux-console.net +noauthority ;; global options: +cmd ;; Got answer: ;; ->>HEADER<
[[email ~]$ dig linux-console.net +noadditional ; <<>> DiG 9.9.2-P1 <<>> linux-console.net +noadditional ;; global options: +cmd ;; Got answer: ;; ->>HEADER<
[[email ~]$ dig linux-console.net +nostats ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> linux-console.net +nostats ;; global options: +cmd ;; Got answer: ;; ->>HEADER<
[[email ~]$ dig linux-console.net +noanswer ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> linux-console.net +noanswer ;; global options: +cmd ;; Got answer: ;; ->>HEADER<
[[email ~]$ dig linux-console.net +noall ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6 <<>> linux-console.net +noall ;; global options: +cmd
45. Sugo: uptime
Bag-o ka lang nga konektado sa imong Linux Server Machine ug nakit-an ang Usa ka butang nga dili kasagaran o malisyoso, unsa ang imong buhaton? Pagtag-an…. DILI, siguradong dili ka makadagan sa oras aron mapamatud-an kung unsa gyud ang nahitabo kung ang server wala mabantayan.
[[email ~]$ uptime 14:37:10 up 4:21, 2 users, load average: 0.00, 0.00, 0.04
46. Sugo: bungbong
usa sa labing hinungdanon nga mando alang sa tagdumala, ang dingding nagpadala usa ka mensahe sa tanan nga naka-log in gamit ang ilang pagtugot sa mensahe nga gitakda sa oo. Ang mensahe mahimong ihatag isip argumento sa bungbong, o mahimo kining ipadala sa standard input sa bungbong.
[[email ~]$ wall "we will be going down for maintenance for one hour sharply at 03:30 pm" Broadcast message from [email (pts/0) (Sat Jun 29 14:44:02 2013): we will be going down for maintenance for one hour sharply at 03:30 pm
47. sugo: mesg
Gitugotan ka nga makontrol kung ang mga tawo makagamit sa pagsulat nga mando, aron ipadala ang teksto kanimo sa ibabaw sa screen.
mesg [n|y] n - prevents the message from others popping up on the screen. y – Allows messages to appear on your screen.
48. Sugo: isulat
Tugoti nga magpadala ka og text direkta sa screen sa laing Linux machine kung ang 'mesg' kay 'y'.
[[email ~]$ write ravisaive
49. Sugo: estorya
Ang usa ka pagpauswag sa pagsulat sa mando, ang mando sa pagsulti nagtugot kanimo nga makigsulti sa mga naka-log in nga tiggamit.
[[email ~]$ talk ravisaive
Mubo nga sulat: Kung wala ma-install ang talk command, mahimo nimo kanunay nga apt o yum ang gikinahanglan nga mga pakete.
[[email ~]$ yum install talk OR [[email ~]$ apt-get install talk
50. Sugo: w
unsay command 'w' murag kataw-anan ka? Apan sa pagkatinuod kini dili. Kini usa ka sugo, bisag usa lang ka letra ang gitas-on! Ang mando nga w usa ka kombinasyon sa oras sa pagtrabaho ug kinsa ang nagmando nga gihatag dayon pagkahuman sa lain, sa kana nga pagkasunud.
[[email ~]$ w 15:05:42 up 4:49, 3 users, load average: 0.02, 0.01, 0.00 USER TTY FROM [email IDLE JCPU PCPU WHAT server tty7 :0 14:06 4:43m 1:42 0.08s pam: gdm-passwo server pts/0 :0.0 14:18 0.00s 0.23s 1.65s gnome-terminal server pts/1 :0.0 14:47 4:43 0.01s 0.01s bash
51. Sugo: usba ang ngalan
Sama sa gisugyot sa ngalan, kini nga mando nagbag-o sa ngalan sa mga file. Ang pagbag-o sa ngalan mag-usab sa ngalan sa piho nga mga file pinaagi sa pag-ilis sa unang panghitabo gikan sa ngalan sa file.
Give the file names a1, a2, a3, a4.....1213
I-type lang ang command.
rename a1 a0 a? rename a1 a0 a??
52. Sugo: ibabaw
Nagpakita sa mga proseso sa CPU. Awtomatiko nga gi-refresh kini nga command, pinaagi sa default ug nagpadayon sa pagpakita sa mga proseso sa CPU gawas kung gihatag ang interrupt-instruction.
[[email ~]$ top top - 14:06:45 up 10 days, 20:57, 2 users, load average: 0.10, 0.16, 0.21 Tasks: 240 total, 1 running, 235 sleeping, 0 stopped, 4 zombie %Cpu(s): 2.0 us, 0.5 sy, 0.0 ni, 97.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 2028240 total, 1777848 used, 250392 free, 81804 buffers KiB Swap: 3905532 total, 156748 used, 3748784 free, 381456 cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 23768 ravisaiv 20 0 1428m 571m 41m S 2.3 28.9 14:27.52 firefox 24182 ravisaiv 20 0 511m 132m 25m S 1.7 6.7 2:45.94 plugin-containe 26929 ravisaiv 20 0 5344 1432 972 R 0.7 0.1 0:00.07 top 24875 ravisaiv 20 0 263m 14m 10m S 0.3 0.7 0:02.76 lxterminal 1 root 20 0 3896 1928 1228 S 0.0 0.1 0:01.62 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.06 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 0:17.28 ksoftirqd/0 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H 7 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u:0H 8 root rt 0 0 0 0 S 0.0 0.0 0:00.12 migration/0 9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 10 root 20 0 0 0 0 S 0.0 0.0 0:26.94 rcu_sched 11 root rt 0 0 0 0 S 0.0 0.0 0:01.95 watchdog/0 12 root rt 0 0 0 0 S 0.0 0.0 0:02.00 watchdog/1 13 root 20 0 0 0 0 S 0.0 0.0 0:17.80 ksoftirqd/1 14 root rt 0 0 0 0 S 0.0 0.0 0:00.12 migration/1 16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H 17 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 cpuset 18 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 khelper 19 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs 20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns 21 root 20 0 0 0 0 S 0.0 0.0 0:00.04 bdi-default 22 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd 23 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd 24 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ata_sff
Basaha Usab: 12 TOP Command Ehemplo
53. Sugo: mkfs.ext4
Kini nga mando maghimo usa ka bag-ong ext4 file system sa gitakda nga aparato, kung ang sayup nga aparato gisunod pagkahuman niini nga mando, ang tibuuk nga bloke mapapas ug ma-format, busa gisugyot nga dili ipadagan kini nga mando gawas kung ug hangtod nga masabtan nimo kung unsa ang imong gibuhat.
Mkfs.ext4 /dev/sda1 (sda1 block will be formatted) mkfs.ext4 /dev/sdb1 (sdb1 block will be formatted)
Basaha ang Dugang: Unsa ang Ext4 ug Giunsa Paghimo ug Pag-convert
54. Sugo: vi/emacs/nano
vi (visual), emacs, nano mao ang pipila sa kasagarang gigamit nga mga editor sa Linux. Kanunay silang gigamit sa pag-edit sa teksto, pag-configure,… mga file. Ang usa ka dali nga giya sa pagtrabaho sa palibot sa vi ug nano mao, ang emacs usa ka.
[[email ~]$ touch a.txt (creates a text file a.txt) [[email ~]$ vi a.txt (open a.txt with vi editor)
[i-press ang 'i' aron mosulod sa insert mode, o dili ka maka-type-in bisan unsa]
echo "Hello" (your text here for the file)
- alt+x (exit insert mode, hinumdomi nga magbilin ug space tali sa kataposang letra.
- ctrl+x nga sugo o ang imong kataposang pulong mapapas).
- :wq! (nagtipig sa file, uban sa kasamtangan nga teksto, hinumdomi ang '!' mao ang pag-override).
[[email ~]$ nano a.txt (open a.txt file to be edited with nano)
edit, with the content, required
ctrl +x (aron isira ang editor). Kini magpakita sa output sama sa:
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? Y Yes N No ^C Cancel
I-klik ang 'y' sa oo ug isulod ang ngalan sa file, ug nahuman ka.
55. Sugo: rsync
Ang Rsync nagkopya sa mga file ug adunay -P switch alang sa progress bar. Mao nga kung na-install nimo ang rsync, mahimo nimong gamiton ang usa ka yano nga alias.
alias cp='rsync -aP'
Karon sulayi pagkopya ang usa ka dako nga file sa terminal ug tan-awa ang output nga adunay nahabilin nga mga butang, susama sa usa ka progress bar.
Dugang pa, ang Pagtipig ug Pagmentinar sa backup usa sa labing hinungdanon ug makalaay nga trabaho nga kinahanglan buhaton sa usa ka tagdumala sa sistema. Ang Rsync usa ka nindot kaayo nga himan (adunay naglungtad, daghan pa) aron paghimo ug pagpadayon sa backup, sa terminal.
[[email ~]$ rsync -zvr IMG_5267\ copy\=33\ copy\=ok.jpg ~/Desktop/ sending incremental file list IMG_5267 copy=33 copy=ok.jpg sent 2883830 bytes received 31 bytes 5767722.00 bytes/sec total size is 2882771 speedup is 1.00
Matikdi: -z alang sa compression, -v alang sa verbose ug -r alang sa recursive.
56. Sugo: libre
Ang pagsubay sa memorya ug mga kahinguhaan sama ka hinungdanon, sama sa bisan unsang buluhaton nga gihimo sa usa ka tagdumala, ug ang 'libre' nga mando moabut aron maluwas dinhi.
[[email ~]$ free total used free shared buffers cached Mem: 2028240 1788272 239968 0 69468 363716 -/+ buffers/cache: 1355088 673152 Swap: 3905532 157076 3748456
[[email ~]$ free -b total used free shared buffers cached Mem: 2076917760 1838272512 238645248 0 71348224 372670464 -/+ buffers/cache: 1394253824 682663936 Swap: 3999264768 160845824 3838418944
[[email ~]$ free -k total used free shared buffers cached Mem: 2028240 1801484 226756 0 69948 363704 -/+ buffers/cache: 1367832 660408 Swap: 3905532 157076 3748456
[[email ~]$ free -m total used free shared buffers cached Mem: 1980 1762 218 0 68 355 -/+ buffers/cache: 1338 641 Swap: 3813 153 3660
[[email ~]$ free -g total used free shared buffers cached Mem: 1 1 0 0 0 0 -/+ buffers/cache: 1 0 Swap: 3 0 3
[[email ~]$ free -h total used free shared buffers cached Mem: 1.9G 1.7G 208M 0B 68M 355M -/+ buffers/cache: 1.3G 632M Swap: 3.7G 153M 3.6G
[[email ~]$ free -s 3 total used free shared buffers cached Mem: 2028240 1824096 204144 0 70708 364180 -/+ buffers/cache: 1389208 639032 Swap: 3905532 157076 3748456 total used free shared buffers cached Mem: 2028240 1824192 204048 0 70716 364212 -/+ buffers/cache: 1389264 638976 Swap: 3905532 157076 3748456
57. Sugo: mysqldump
Ok hangtod karon nasabtan na nimo kung unsa gyud ang gipasabut niini nga command, gikan sa ngalan niini nga command.mysqldump commands dumps (backups) tanan o usa ka partikular nga database data ngadto sa gihatag nga file.Pananglitan,
[[email ~]$ mysqldump -u root -p --all-databases > /home/server/Desktop/backupfile.sql
Hinumdomi: ang mysqldump nagkinahanglan sa mysql nga modagan ug husto nga password alang sa pagtugot. Gitabonan namo ang pipila ka mapuslanon nga mysqldump nga mga sugo sa Database Backup uban ang mysqldump Command
58. Sugo: mkpasswd
Paghimo og lisud-tag-an, random nga password sa gitas-on sama sa gipiho.
[[email ~]$ mkpasswd -l 10 zI4+Ybqfx9
[[email ~]$ mkpasswd -l 20 w0Pr7aqKk&hmbmqdrlmk
Mubo nga sulat: -l 10 makamugna og usa ka random nga password sa 10 ka karakter samtang -l 20 makamugna sa usa ka password sa karakter 20, kini mahimong ibutang sa bisan unsa aron makuha ang gitinguha nga resulta. Kini nga sugo mapuslanon kaayo ug gipatuman sa scripting language kanunay aron makamugna ug random nga mga password. Tingali kinahanglan nimo nga yum o apt ang 'pagpaabut' nga pakete aron magamit kini nga mando.
yum install expect OR apt-get install expect
59. Sugo: idikit
Paghiusa sa duha o daghan pa nga mga text file sa mga linya nga gigamit. Pananglitan. Kung ang sulod sa file1 kay:
1 2 3 and file2 was: a b c d the resulting file3 would be: 1 a 2 b 3 c d
60. Sugo: lsof
Ang lsof nagpasabut sa \listahan ang mga bukas nga mga file ug gipakita ang tanan nga mga file nga giablihan karon sa imong sistema. Mapuslanon kaayo nga mahibal-an kung unsang mga proseso ang naggamit sa usa ka file, o aron ipakita ang tanan nga mga file alang sa usa ka proseso. Pipila ka mapuslanon nga 10 lsof Command mga pananglitan, tingali interesado ka sa pagbasa.
[[email ~]$ lsof COMMAND PID TID USER FD TYPE DEVICE SIZE/OFF NODE NAME init 1 root cwd DIR 8,1 4096 2 / init 1 root rtd DIR 8,1 4096 2 / init 1 root txt REG 8,1 227432 395571 /sbin/init init 1 root mem REG 8,1 47080 263023 /lib/i386-linux-gnu/libnss_files-2.17.so init 1 root mem REG 8,1 42672 270178 /lib/i386-linux-gnu/libnss_nis-2.17.so init 1 root mem REG 8,1 87940 270187 /lib/i386-linux-gnu/libnsl-2.17.so init 1 root mem REG 8,1 30560 263021 /lib/i386-linux-gnu/libnss_compat-2.17.so init 1 root mem REG 8,1 124637 270176 /lib/i386-linux-gnu/libpthread-2.17.so init 1 root mem REG 8,1 1770984 266166 /lib/i386-linux-gnu/libc-2.17.so init 1 root mem REG 8,1 30696 262824 /lib/i386-linux-gnu/librt-2.17.so init 1 root mem REG 8,1 34392 262867 /lib/i386-linux-gnu/libjson.so.0.1.0 init 1 root mem REG 8,1 296792 262889 /lib/i386-linux-gnu/libdbus-1.so.3.7.2 init 1 root mem REG 8,1 34168 262840 /lib/i386-linux-gnu/libnih-dbus.so.1.0.0 init 1 root mem REG 8,1 95616 262848 /lib/i386-linux-gnu/libnih.so.1.0.0 init 1 root mem REG 8,1 134376 270186 /lib/i386-linux-gnu/ld-2.17.so init 1 root 0u CHR 1,3 0t0 1035 /dev/null init 1 root 1u CHR 1,3 0t0 1035 /dev/null init 1 root 2u CHR 1,3 0t0 1035 /dev/null init 1 root 3r FIFO 0,8 0t0 1714 pipe init 1 root 4w FIFO 0,8 0t0 1714 pipe init 1 root 5r 0000 0,9 0 6245 anon_inode init 1 root 6r 0000 0,9 0 6245 anon_inode init 1 root 7u unix 0xf5e91f80 0t0 8192 @/com/ubuntu/upstart init 1 root 8w REG 8,1 3916 394 /var/log/upstart/teamviewerd.log.1 (deleted)
Dili kini ang katapusan, ang usa ka System Administrator naghimo og daghang mga butang, aron mahatagan ka usa ka nindot nga interface, diin ikaw nagtrabaho. Ang Pagdumala sa Sistema sa tinuud usa ka arte sa pagkat-on ug pagpatuman sa labi ka perpekto nga paagi. Kami mosulay sa pagkuha kanimo sa tanan nga uban pang mga kinahanglanon nga butang nga kinahanglan mahibal-an sa usa ka propesyonal sa linux, ang linux sa sukaranan niini mismo, usa ka proseso sa pagkat-on ug pagkat-on. Ang imong maayong mga pulong kanunay nga gipangita, nga nag-awhag kanamo nga maningkamot sa paghatag kanimo usa ka kahibalo nga artikulo. \I-like ug i-share Kami, aron matabangan Kami nga Mokaylap.