如何在启动时运行命令?

编程入门 行业动态 更新时间:2024-10-27 16:35:44
本文介绍了如何在启动时运行命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图弄清楚如何在启动时运行命令,就像我在控制台中键入命令一样.我在我的Raspberry Pi上使用了Rasbian,但我认为这个问题对于Debian来说通常是相同的.我要运行的命令是:

I'm trying to figure out how to run a command at boot, like I would type it into the console. I'm using Rasbian with my Raspberry Pi, but I think this question is the same for Debian in general. The command I'm trying to run is:

sudo screen mono server.exe

我尝试了以下解决方案,但是由于我刚开始使用Linux,所以不确定是否正确.

I tried the following solution, but since I just started with Linux, I'm not sure if this is correct.

#! /bin/sh # /etc/init.d/server ### BEGIN INIT INFO # Provides: server # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Simple script to start a program at boot # Description: .. ### END INIT INFO # If you want a command to always run, put it here sudo screen mono server.exe exit 0

推荐答案

简单 运行cd ~ 然后编辑.profile 在底部,放任何您想要的东西.

Simple Run cd ~ Then edit .profile At the bottom, put whatever you would like.

更多推荐

如何在启动时运行命令?

本文发布于:2023-11-05 06:24:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560143.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:启动时   命令   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!