Các Lệnh Cơ bản trong CentOS 6 – phần 3

1.echo – hiển thị  dòng của text

[Cú pháp] echo OPTION STRING
option
-n do not output the trailing newline
-e enable interpretation of backslash escapes

2. dig – DNS lookup utility

[cú phạp] dig OPTION (HOST NAME/IP ADDR)
option
typical invocation

# dig yahoo.com
-x reverse invocation

# dig -x 111.222.333.444

 

3.ls – Liệt kê danh sách nội dung của directory

[Cú pháp] ls OPTION FILE/DIRECTORY
option
-l use a long listing format
-a do not ignore entries starting with
-d list directory entries instead of contents, and do not dereference symbolic links
-r reverse order while sorting
-t sort by modification time
-S sort by file size
-X sort alphabetically by entry extension
-i with -l, print the index number of each file
-R list subdirectories recursively
-F append indicator (one of */=>@|) to entries

4.rndc – Điều khiển server

[cú pháp] rndc COMMAND
command
reload reload config and zones

# rndc reload
status show status of a name server

# rndc status
retransfer zone transfer zones

# rndc retransfer zone

5.Ismod-chương trình cho chép hiển thị trạng thái của modules trong Linux Kernel

[cú pháp] lsmod

6.grep-xuất ra phiên phản của kvm

 

[Cú pháp] grep OPTION PATTERN FILE
opition

-i Ignore case distinctions in both the PATTERN and the input files
-n Prefix each line of output with the 1-based line number within its input file
-v Invert the sense of matching, to select non-matching lines
-w Select only those lines containing matches that form whole words
-r(R) dir Read all files under each directory, recursively; this is equivalent to the -d recurse option

# grep -r ‘word’ dir

7. cd-thay đổi directory

[cú pháp] cd DIRECTORY

8.cp-copy file và directories.

[cú pháp] cp OPTION(SOURCE FILE/DIRECTORY)[DEST FILE/DIRECTORY]

OPTION

-i prompt before overwrite

# cp -i file /etc
-f if an existing destination file cannot be opened, remove it and try again

# cp -f file /etc
-b like –backup but does not accept an argument

# cp -b file /etc
-p preserve the specified attributes (default: mode,ownership,timestamps)

# cp -p file /etc
-r(R) copy directories recursively

# cp -R dir /etc

 

8.mkdir-tạo directories

[cú pháp] mkdir OPTION DIRECTORY

otion

-p no error if existing, make parent directories as needed

# mkdir /home/dir1/dir2
-m set permission mode (as in chmod), not rwxrwxrwx – umask

# mkdir -m 700 dir

9.modprobe-là chương trình dùng để add hay remove một modul từ Linux Kernel

[cú pháp]modprobe OPTION MODULE

option

-a Insert all module names on the command line
-l List all modules matching the given wildcard
-r This option causes modprobe to remove, rather than insert a module