狮子的写字本(LEO)
suse 常用命令
04月14日(星期一)

suse 常用命令
[ 2008-1-19 0:07:00 | By: liukun ]

suse 常用命令
[ 2008-1-19 0:07:00 | By: liukun ]

1.修改vftpd配置文件
vi /etc/vsftpd.conf #listen=YES
vi /etc/xinetd.d/vsftpd 将“disable=yes” 改为 “disable=no”使xinetd服务启动后接收到ftp连接请求时,能够自动启动vsftpd服务进程

2. mkdir -p /srv/ftp/linux-10 创建文件夹 -p 如果文件夹不存在自动创建

3. chown -R ftp:ftp /srv/ftp/linux-10 指定linux-10目录及其子目录的拥有者为ftp用户和ftp组

4. chmod -R 755 /srv/ftp/linux-10 指定linux-10目录及其子目录的访问权限

5. mount /dev/hdc /srv/ftp/linux-10/disk1 将设备中的内容挂载到disk1中

umount /srv/ftp/linux-10/disk1 卸载掉disk1中挂载的文件

6. /etc/init.d/xinetd start 启动FTP服务

7. df命令

功能:检查文件系统的磁盘空间占用情况。可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间等信息。

语法:df [选项]

说明:df命令可显示所有文件系统对i节点和磁盘块的使用情况。

该命令各个选项的含义如下:

-a 显示所有文件系统的磁盘使用情况,包括0块(block)的文件系统,如/proc文件系统。

-k 以k字节为单位显示。

-i 显示i节点信息,而不是磁盘块。

-t 显示各指定类型的文件系统的磁盘空间使用情况。

-x 列出不是某一指定类型文件系统的磁盘空间使用情况(与t选项相反)。

-T 显示文件系统类型。

8. free命令

free命令的功能是查看当前系统内存的使用情况,它显示系统中剩余及已用的物理内存和交换内存,以及共享内存和被核心使用的缓冲区。

该命令的一般格式为: free [-b | -k | -m] 命令中各选项的含义如下:

-b 以字节为单位显示。

-k 以K字节为单位显示。

-m 以兆字节为单位显示。

9. sync命令
sync命令是强制把内存中的数据写回硬盘,以免数据的丢失

10. shutdown命令

shutdown 命令可以安全地关闭或重启Linux系统,它在系统关闭之前给系统上的所有登录用户提示一条警告信息。该命令还允许用户指定一个时间参数,可以是一个精确的时间,也可以是从现在开始的一个时间段。精确时间的格式是hh:mm,表示小时和分钟;时间段由“+”和分钟数表示。系统执行该命令后,会自动进行数据同步的工作。

该命令的一般格式为: shutdown [选项] [时间] [警告信息] 命令中各选项的含义为:

- k 并不真正关机,而只是发出警告信息给所有用户。

- r 关机后立即重新启动。

- h 关机后不重新启动。

- f 快速关机,重启动时跳过fsck。

- n 快速关机,不经过init程序。

- c 取消一个已经运行的shutdown。

需要特别说明的是,该命令只能由超级用户使用。

11. date命令

date命令的功能是显示和设置系统日期和时间。

12. cal命令

cal命令的功能是显示某年某月的日历。

该命令的一般格式为: cal [选项] [月 [年]] 命令中各选项的含义为:

- j 显示出给定月中的每一天是一年中的第几天(从1月1日算起)。

- y 显示出整年的日历。

13. echo命令

echo命令的功能是在显示器上显示一段文字,一般起到一个提示的作用。

该命令的一般格式为: echo [ -n ] 字符串

其中选项n表示输出文字后不换行;字符串可以加引号,也可以不加引号。用echo命令输出加引号的字符串时,将字符串原样输出;用echo命令输出不加引号的字符串时,将字符串中的各个单词作为字符串输出,各字符串之间用一个空格分割。


14. 从ftp安装linux系统
install=ftp://ip(服务器ip地址)/linux-10/disk1 hostip=ip(新系统ip)/24 gateway=192.168.0.1(网关)

15. chkconfig --level 235 ntp on 使用系统启动时,自动启动NTP服务

16. /etc/init.d/ntp restart 启动NTP服务

17. route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 配置Linux多播路由 添加该路由项

18. netstat -nr 查看路由表

19. netstat -an|less 查看服务端口的状态

20. /etc/init.d/novell-tomcat4 restart 重启Tomcat(在iManage中安装插件后)

21. chmod 777 文件名 修改文件权限

22. ndsconfig rm 删除ED实例

23. 精确同步时间
先将ntp服务停掉 rcxntpd stop 然后执行 ntpdate 命令 (多次执行缩短时间差) 最后启动 rcxntpd start

24. Linux 更改MAC地址:
1.> 临时更改:
# ifdown eth0
# ifconfig eth0 hw ether 0029340830249(MAC地址)
# ifup eth0

2.> 永久生效:(对于suse不起作用)
# vi /etc/rc.d/rc.local
ifdown eth0
ifconfig eth0 hw ether 002934083024(MAC地址)
ifup eth0
# service network restart(suse 9:rcnetwork restart)

3.> 添加新网卡:
a. VM --> 添加网卡
b. 启动时按 '<-' , 确定相关默认配置
c. 在/etc/sysconfig/network-s/创建新网卡文件
d. 配置新网卡文件

25. Linux 更改MAC地址:

1.1 redhat:
a. $ cd /etc/sysconfig/network-s
b. Edit file "ifcfg-eth0", change to your real MAC address
(Use "ifconfig -a" to display real MAC address.)
c. $ /etc/init.d/network start (to restart network.)

1.2 SuSE:
a. $ cd /etc/sysconfig/network
b. $ mv ifcfg-eth-id-00:0c:29:ba:b2:ad ifcfg-eth0
c. $ vi /ifcfg-eth0
d. $ 添加 LLADDR='real MAC address'
e. $ 到YAST里面配置静态IP
(Use "ifconfig -a" to display real MAC address.)
f. $ reboot(重启系统)

2.修改redhat locale:

cd /etc/sysconfig/

编辑i18n文件,指定自己所需的locale

3.修改SuSE hostname:编辑/etc/HOSTNAME

26. 增加反向代理名称 192.168.10.in-addr-arpa

27. suse 配置ftp服务
a. vi /etc/vsftpd.conf
b. 将listen=yes 注释掉
c. vi /etc/xinetd.d/vsftpd
d. 将 disable=yes 改为 disable=no
e. /etc/init.d/xinetd start 启动FTP服务
(suse9只需执行c,d,e suse10都需要执行)

28. 查找文件 find 路径 -name(-size,-type) file

29. 查找字符 grep 参数(-l 显示匹配行号,-I 忽略大小写,-r 递归查找) 'str' fielist

30. 比较文件 diff 参数(-w忽略空格 ,-I忽略大小写 ) file file

31.kill

1.作用
kill命令用来中止一个进程。

2.格式
kill [ -s signal | -p ] [ -a ] pid ...
kill -l [ signal ]

3.参数
-s:指定发送的信号。
-p:模拟发送信号。
-l:指定信号的名称列表。
pid:要中止进程的ID号。
Signal:表示信号。

4.说明
进程是Linux系统中一个非常重要的概念。Linux是一个多任务的操作系统,系统上经常同时运行着多个进程。我们不关心这些进程究竟是如何分配的,或者是内核如何管理分配时间片的,所关心的是如何去控制这些进程,让它们能够很好地为用户服务。

Linux 操作系统包括三种不同类型的进程,每种进程都有自己的特点和属性。交互进程是由一个Shell启动的进程。交互进程既可以在前台运行,也可以在后台运行。批处理进程和终端没有联系,是一个进程序列。监控进程(也称系统守护进程)时Linux系统启动时启动的进程,并在后台运行。例如,httpd是著名的 Apache服务器的监控进程。

kill命令的工作原理是,向Linux系统的内核发送一个系统操作信号和某个程序的进程标识号,然后系统内核就可以对进程标识号指定的进程进行操作。比如在top命令中,我们看到系统运行许多进程,有时就需要使用kill中止某些进程来提高系统资源。在讲解安装和登陆命令时,曾提到系统多个虚拟控制台的作用是当一个程序出错造成系统死锁时,可以切换到其它虚拟控制台工作关闭这个程序。此时使用的命令就是kill,因为kill是大多数Shell内部命令可以直接调用的。

5.应用实例
(1)强行中止(经常使用杀掉)一个进程标识号为324的进程:
#kill -9 324

(2)解除Linux系统的死锁
在Linux 中有时会发生这样一种情况:一个程序崩溃,并且处于死锁的状态。此时一般不用重新启动计算机,只需要中止(或者说是关闭)这个有问题的程序即可。当 kill处于X-Window界面时,主要的程序(除了崩溃的程序之外)一般都已经正常启动了。此时打开一个终端,在那里中止有问题的程序。比如,如果 Mozilla浏览器程序出现了锁死的情况,可以使用kill命令来中止所有包含有Mozolla浏览器的程序。首先用top命令查处该程序的PID,然后使用kill命令停止这个程序:
#kill -SIGKILL XXX
其中,XXX是包含有Mozolla浏览器的程序的进程标识号。

(3)使用命令回收内存
我们知道内存对于系统是非常重要的,回收内存可以提高系统资源。kill命令可以及时地中止一些“越轨”的程序或很长时间没有相应的程序。例如,使用top命令发现一个无用 (Zombie) 的进程,此时可以使用下面命令:
#kill -9 XXX
其中,XXX是无用的进程标识号。

然后使用下面命令:
#free
此时会发现可用内存容量增加了。

(4)killall命令
Linux下还提供了一个killall命令,可以直接使用进程的名字而不是进程标识号,例如:
# killall -HUP inetd

32.rm 删除命令
rm -r 删除目录,不管目录中有没有文件
rm -rf 强制删除,没有提示

33.ln命令
ln -s 源文件(绝对路径) 目标文件 (软连接)

34.查看本机开放的端口

1、netstat 查看端口和连接
netstat 列出目前已经连接的服务名
netstat -a 列出目前已经连接的和正在监听的服务名
netstat -an 列出目前已经连接的和正在监听的端口号(与上面的命令功能一样,只是不解释端口号对应的服务名)
netstat -ap 在上面命令的基础上列出连接的PID(进程号),用这个PID,可以使用KILL 来杀死连接
例如:某个连接的PID=111,想踢出去就使用 KILL -9 111。ok!
netstat -rn 输出路由表
2、nmap
nmap 127.0.0.1 查看本机开放的端口,会扫描所有端口
nmap -p 1024 65535 127.0.0.1 扫描指定端口范围
nmap -PT 192.168.1.1-111 扫描一组范围的电脑

35. 交互方式管理identity manager 对象
dxcmd -host 192.168.37.133 -port 524

36. ps -A 产看进程

37. ssh -X (ip address) 远程连接另一系统

38. pkill firefox-bin(进程名) 以进程名杀进程

39. . /opt/novell/eDirectory/bin/ndspath 设置ed的环境变量

文章分类: suse & oracle
前篇(07-07-09): CISCO 技术网站!http://www.net130.com/CMS/index.html
后篇(08-04-15): 宝宝还有两个月就出生了,今天(2008/04/15)

最新回复(26件)
主题/内容 作者/日时
Jusdbfedfwf

Jusdbfedfwf

Nakleqgo
10-02-24 20:35
Hi! XymbHLq

Hi! XymbHLq

AFxpIFJT
09-11-12 06:22
REZEPTFREI CIALIS eur 1.15 Pro Pille Rezeptfrei CIALIS

[b]VIAGRA BESTELLEN BILLIG - 0.87 EURO Pro Pille >>> Klicken Sie Hier

BilligCialis
09-10-28 06:52
REZEPTFREI CIALIS eur 1.15 Pro Pille CIALIS Rezeptfrei

VIAGRA BESTELLEN BILLIG - 0.87 EURO Pro Pille >>> Klicken Sie Hier

BilligCialis
09-10-26 02:35
彦犟筻朦磬

[color=green][size=24]令朦

AnendaMathe
09-08-27 22:48
Re: suse 常用命令

For example, Viagraand Levitra work in about 30 to 60 minutes, whereas Cialis works in aslittle as 15 to 30 minutes but as drug addiction. Depression and anxiety are serious problems

tishhidokit
09-08-07 20:34
Re: suse 常用命令

Each medication158 Men抯 Sexual Healthsometimes (5

tishhidokit
09-07-29 20:31
Re: suse 常用命令

Onychomycosis is also used to describe the condition but has a broader definition encompassing nail infections with yeasts and non-dermatophyte moulds in addition to dermatophytes Many people like to lay the S.O.C.C.E.R.

tishhidokit
09-07-29 17:31
Re: suse 常用命令

The following is a short list of books that give solid help based on well-researched strategies for alleviating emotional distress T: What's the point? I enjoy it. But the time has changed now, women are demanding more from the 搈edicine world

tishhidokit
09-07-29 14:38
Re: suse 常用命令

Worksheet 6-6 My Thought Tracker Feelings & Sensations Corresponding Events Thoughts/Interpretations (Rated 1

tishhidokit
09-07-24 01:58
Re: suse 常用命令

When negative emotions cloud your mind, it抯 hard to get moving Itraconazole

tishhidokit
09-07-19 21:09
Re: suse 常用命令

But the time has changed now, women are demanding more from the 搈edicine world

tishhidokit
09-07-19 12:21
Re: suse 常用命令

So she doesn抰 need to be perfect to avoid harsh criticism today Amphotericin B . mg/kg/day. If CD4 T-lymphocyte count increases above 100

tishhidokit
09-07-19 10:57
Billiards pool

Billiards, pool
Croatia Service

Meeliaarone
09-07-17 01:27
Re: suse 常用命令

We think of stopping smoking as something that is very difficult to do He was bright but not brilliant. Rather, it contains a wide range of simple pleasures

tishhidokit
09-07-15 21:36
Re: suse 常用命令

You know it is on the right, but for a couple of weeks you put the windscreen wipers on whenever you want to indicate You don抰 have to go this alone. Think of loved ones and friends

tishhidokit
09-07-10 23:18
Re: suse 常用命令

He was careful to keep the romance alive, even until the end My hat抯 off to you, buddy. Oral therapy, if indicated, includes these alternatives: itraconazole 200 mg/day for 1 week terbinafine 250 mg/day for 2

tishhidokit
09-07-09 23:20
Re: suse 常用命令

As adolescentsand young adults there are major diff erences in male and female sexualfunction and socialization Isolation may come from sputum and BAL. Don抰 worry about getting all the details right

advonydayPrak
09-07-04 22:38
Re: suse 常用命令

Viamedic has been one of the leading online pharmacies since 1998, offering safe FDA-Approved online prescriptions, at the lowest prices available on the internet Microscopic morphology of Epidermophyton floccosum. At any given point in time, about 35

advonydayPrak
09-07-03 21:49
Re: suse 常用命令

Withoutaccurate information, we are susceptible to myths, 揌ollywood

advonydayPrak
09-07-01 11:12
Re: suse 常用命令

I have had bouts of anxiety off and on for years You arc not being deprived. Oral itraconazole 200

advonydayPrak
09-07-01 06:37
Re: suse 常用命令

Because of the neighbors

advonydayPrak
09-06-30 15:20
Re: suse 常用命令

I feelso special then

advonydayPrak
09-06-29 03:59
Very nice site!

Very nice site!

Pharmg406
09-06-04 17:34
benefits of lorazepam under the tongue go ethocarbamol

benefits of lorazepam under the tongue go ethocarbamol

buy_zithromax_online
09-04-25 19:23
benefits of lorazepam under the tongue go ethocarbamol

benefits of lorazepam under the tongue go ethocarbamol

buy_zithromax_online
09-04-25 19:22

发表评论
标题:
称呼:
内容:

引用链接
您可以按照以下步骤引用本文.本站收到您的引用通知后, 将自动链接您的文章, 以方便别人阅览 .
1. 启动您自己的博客管理页面, 并进入发表新文章的画面, 输入文章的内容. (如果您是ITPUB的博客请点这里.)
2. 复制下面虚线框里的连接字串, 把它们粘贴到您的文章中, 按照您的喜好修改一下表示文字.
3. 确认您选择了"发送引用通知"的选项.
4. 发表您的文章.
好啦, 您的文章就可以被自动链接到本站啦.

« 三月 2010 »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        


Creative Commons License 本站全部著作均采用CC授权. Plog 1.0 is powered by: plogworld.net.
Itpub BLOG is provided by: itpub.net.
This temlate(named Happy-Life's SunShine) is designed by lodge@itpub(肥猫猫).