天天看点

常用代码

vim /etc/sysconfig/network-scripts/ifcfg-eth0

修改静态动态密码 dhcp static

[pub]

comment=pub

 path=/mnt

 writable=yes

  public=yes

 [share]

 comment=share

path=/usr/local/apache2/htdocs

"/etc/samba/smb.conf" 2

修改smb配置文件

smbpasswd -a root

增加smb配置文件

setup 修改设置

init.d 6重启linux

 <button id="foo"  点击事件

service network restart启动网络

/etc/samba/smb.conf   smb 配置文件

/etc/vsftpd/vsftpd.conf ftp配置

ls 显示 cd进入  pwd显示路径

rm-rf删除

ls 显示文件

ls-l查看权限

ls-a查看隐藏

网络端口

# advanced micro devices, inc. [amd] 79c970 [pcnet32 lance]

device=eth0

bootproto=static

hwaddr=00:0c:29:c9:56:8d

onboot=yes

#ipaddr=192.168.1.129

netmask=255.255.255.0

gateway=192.168.1.1

在静态方法不可以调用动态,在普通可以调用静态

linux文件一切皆文件1.常规文件(文本 二进制)2.目录 3.设备文件 4.管道文件 5.套接字 6.链接

shell脚本

b 向后移动一个单词 2b 向后移动2个单词

e,同w,只不过是光标停在单词尾部

ge,同b,光标停在单词尾部。

^ 移动到本行第一个非空白字符上。

0(数字0)移动到本行第一个字符上,

<home> 移动到本行第一个字符。同0健。

$ 移动到行尾 3$ 移动到下面3行的行尾

gg 移动到文件头。 = [[

g(shift + g) 移动到文件尾。 = ]]

f(find)命令也可以用于移动,fx将找到光标后第一个为x的字符,3fd将找到第三个为d的字符。

f 同f,反向查找。

x 删除当前字符

3x 删除当前光标开始向后三个字符

x 删除当前字符的前一个字符。x=dh

dl 删除当前字符, dl=x

dh 删除前一个字符

dd 删除当前行

dj 删除上一行

dk 删除下一行

10d 删除当前行开始的10行。

d 删除当前字符至行尾。d=d$

d$ 删除当前字符之后的所有字符(本行)

kdgg 删除当前行之前所有行(不包括当前行)

jdg(jd shift + g)   删除当前行之后所有行(不包括当前行)

:1,10d 删除1-10行

:11,$d 删除11行及以后所有的行

:1,$d 删除所有行

j(shift + j)  删除两行之间的空行,实际上是合并两行

mysql   删掉行用drop    进入过程1.show databases 2.show tables

3.select*from db 4.desc db  5.drop table db

mysql> create table myclass(

    > id int(4) not null primary key auto_increment,

    > name char(20) not null,

    > sex int(4) not null default '0',

    > degree double(16,2));

create database建立库 desc stuinfo显示空表

 linux 修改需要返回上一级