怎样实现开机自动运行某些命令

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
ahlai
帖子: 141
注册时间: 2006-05-03 9:10

怎样实现开机自动运行某些命令

#1

帖子 ahlai » 2007-11-28 9:32

我想开机自动运行如下的命令
mkfs.ext3 /dev/ram0
mount /dev/ram0 /media/ramdisk
要怎么实现,谢谢
todaypuzzleme
帖子: 79
注册时间: 2007-06-08 22:43

#2

帖子 todaypuzzleme » 2007-11-28 10:23

以我用的dapper为例:
在/etc下找到rc.local,
vi rc.local显示默认内容如下:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
~

在exit 0 前面添加你要执行的命令,一行一个命令,在系统多用户级别启动完成后会执行该文件的内容
头像
arsui
帖子: 889
注册时间: 2007-05-06 2:01
来自: 特麓村->浦北->五山->罗湖

#3

帖子 arsui » 2007-11-28 10:25

system/Admini.../session
系统、管理,会话
添加启动项,输入命令就是了,你这么聪明一定知道的
Ubuntu 9.04 & Win Xp
------------------------------------------------------
Company: http://www.mazingtech.com
HomePage: http://www.arsui.com
ahlai
帖子: 141
注册时间: 2006-05-03 9:10

#4

帖子 ahlai » 2007-11-28 10:59

todaypuzzleme 写了:以我用的dapper为例:
在/etc下找到rc.local,
vi rc.local显示默认内容如下:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
~

在exit 0 前面添加你要执行的命令,一行一个命令,在系统多用户级别启动完成后会执行该文件的内容
非常感谢,此方法成功
回复