Você está na página 1de 5

1. mkdir /media/CentOS 2.

mount /dev/cdrom /media/CentOS (note: a CD phi connected)

Yum disablerepo=\* --enablerepo=c6-media groupinstall Development Tools Yum disablerepo=\* --enablerepo=c6-media groupinstall X Window System Yum disablerepo=\* --enablerepo=c6-media groupinstall Desktop Yum disablerepo=\* --enablerepo=c6-media groupinstall Desktop Platform (nhm phn mm ch u vit hoa) Vi /etc/yum.repos.d/CenOS-Media.repo

(ci t a cd)

rpm ivp /media/CentOS/Packages/man-1.6 rpm evp nodeps man cd /software/rpm -qa | grep tn phn mm

(ci t man bng rpm,ng dn) (g b man)

cai dat soft ware: rpm : rpm -ivh <...> yum : ket noi internet yum install <...> yum remove <...>

source : giai nen, di chuyen vao thu muc chua

/.bt yum instal gcc cat>bt.c #include<stdio> main() {printf"\n Hello"); } ctrl +D

2) chuong trinh: Nhap a,b. Tinh T=a+b #include <stdio.h> main() { int a,b,c; printf ("nhap a: "); scanf ("%d",&a); prinf("nhap b: "); scanf("%d",&b); c=a+b; printf("tong a va b= %d",c); } gcc bt2.c -o bt2 (dat ten lai laf bt2) ./bt2 (chay chtr bt2)

ifconfig ( xem ip tren linux)

Search: how to install <package> on CentOS (huong dan cai dat chi tiet)

#service network restart Nn file .gz #Gzip/etc/passwd Gii nn .gz #Gzip d /etc/passwd #Gunzip /etc/passwd Nn file .tar #Tar cvf /home/admin/nbackup.tar /home/abc (a ch th mc or file) #Tar czf/home/ Nn file .tar.gz

Nn file tar.gzz #tar cjf backup/ Gii nn Tar zxvf < tn file nn > File t.gzz Nn: tar cjf <tn tar.gzz> <th mc/file cn nn>

Gii nn: tar xjf <tn file.tar.gzz> Nn: c ch c , c tar th k c z C tar dng vf C zip dung zf Gii nn: c ch x, j, f

ng ng pipe | ls l /etc |more ls l /etc |less ( xem th mc (xem ln xung dc)

nhm lnh bng du (;) (2 lnh ring bit) #(cal 2009;cal 2012) |less Chuyn hng nhp t file #tr a-z A-Z <baitap1.txt > baitap2.txt Chuyn tt c cc k t thng thnh k t hoa trong file baitap1.txt m s dng trong vn bn #wc l /etc/passwd #ls l /etc |wc

Tm theo keyword trong 1 file #grep root /etc/passwd

Lc d liu theo ct Ly ct th 1 trong /etc/paswd #cut d: -f1 /etc/passwd Ly nhiu ct : -f1,2 Ly 10 k t u tin 5 dng cui cng file /etc/passwd #tail -5 /etc/passwd |cut c1-10 Tm tt c cc file (find /etc/ -name *.conf|wc l;find /etc/ -name *.conf)>ketqua.txt

T6, 25/11 To user bng cch them 1 dng vo trong file /etc/passdwd Vd: teo:x:600:600:teo:/home/teo:/bin/bash To passwd cho user mi

/etc/passwd /etc/shadow /etc/group

(to user (ni lu passwd ca ngi dung) (nhm)

Userdel r thienminh (xa user thienminh trong passwd v shadow; -r xa c th mc home) Usermod useradd groupmod groupadd

t6, 30/11 xem ia ch DNS: xem trong /etc/resolv.conf

Você também pode gostar