Tag: 执行命令

添加到路径只有sh文件而不是dir

我有一个包含一堆sh文件的bin文件夹。 例如“server-run.sh”,“server-stop.sh”,“server-do-something.sh”。 我想从任何地方运行文件“server-stop.sh”。 我可以将这个bin文件夹添加到路径,但“run”和“do-something”文件也将可用,我不想污染我的控制台。 此外,我不想将此文件添加到/ bin文件夹,因为它可能会更改。 也许链接。 我可以以某种方式只添加“server-stop.sh”到路径?

暂停终端中长时间运行的程序?

是否有键盘组合键可用于暂停在终端中运行的程序? 如果它很重要,我不打算在程序暂停时在该终端内运行任何其他内容。 我只想暂停程序执行,稍后再恢复。 我怎样才能做到这一点?

“chmod + x ”做什么以及如何使用它?

我想写一个“批处理文件”(shell脚本)的Ubuntu模拟。 但我不知道如何使用chmod +x filename命令来使脚本运行。 我也不知道在哪里使用它。

什么是命令:`command`?

最近我发现命令: command没有手动输入,但帮助显示如下: $ help command command: command [-pVv] command [arg …] Execute a simple command or display information about commands. Runs COMMAND with ARGS suppressing shell function lookup, or display information about the specified COMMANDs. Can be used to invoke commands on disk when a function with the same name exists. Options: -p use a […]

在另一个(新)终端窗口上运行命令

如何在另一个终端窗口中运行任何命令? 示例:我打开了一个终端窗口,如果我像apropos editor那样运行命令,那么它就会在该窗口上运行和输出。 但我想在另一个终端窗口(新窗口)上运行相同的命令,而不是从第一个终端的当前窗口。 进一步澄清 : 我需要suggest-command 打开新的终端窗口并在那个(新打开的)窗口中运行提到的 。 (其中suggest-command是命令建议的例子。) 怎么做?

为什么rc.local不运行我的所有命令,我该怎么办呢?

我有以下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. # # […]

我该如何运行命令?

我是一个刚刚被告知要运行/执行命令的新用户。 答案有一些带有灰色背景的文字,就像this text here一样 sometimes this text here. 但是,我不知道“运行”或“命令”对Ubuntu的意义。 我该怎么做呢? 当您告诉某人运行命令时,这可用作您可以链接的问答。

如何在Nautilus中运行可执行脚本?

当我双击Nautilus中的脚本来运行它时,脚本只在我的文本编辑器中打开,没有选项来运行它。 使用Nautilus,如何运行可执行文本文件和/或脚本?