小编use*_*888的帖子

终止每个后台进程

我有几个Stopped后台进程。

kill $(jobs -p)并且kill `jobs -p`没有效果

kill %1, kill %2, 等成功终止个别进程

如何使用一个命令杀死每个后台进程?

另外,为什么前两个命令对我不起作用?

我正在运行 Linux Mint 15、64 位

shell kill background-process

10
推荐指数
1
解决办法
3863
查看次数

scp 到别名

要将文件夹从本地主机传输到远程主机,我通常会执行以下操作:

$ scp -r myFolder user@host:destFolder/
Run Code Online (Sandbox Code Playgroud)

为了让这更容易,我给远程主机目的地取了别名:

$ alias remoteHost user@host:destFolder/
Run Code Online (Sandbox Code Playgroud)

但是,对别名进行 scping 不起作用:

$ scp -r myFolder `remoteHost`
bash: user@host:destFolder/: No such file or directory
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2
Run Code Online (Sandbox Code Playgroud)

bash alias arguments

4
推荐指数
1
解决办法
2781
查看次数

.bashrc 和 .bash_profile 未执行

我正在运行 RHEL5。我将简单的别名命令添加到~/.bashrc. 当我启动一个新终端时,没有任何反应,但source ~/.bashrc可以正常工作,所以我知道语法是正确的。我还进行了修改/源代码测试~/.bash_profile,但它也不会在终端启动时执行。 ~/.bash_login并且~/.profile在我的系统上不存在。

这是我的~/.bashrc

# .bashrc

# Source global definitions if [ -f /etc/bashrc ]; then
        . /etc/bashrc fi

# User specific aliases and functions
alias hi=hello
Run Code Online (Sandbox Code Playgroud)

和我的~/.bash_profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
Run Code Online (Sandbox Code Playgroud)

bash rhel bashrc

4
推荐指数
1
解决办法
1万
查看次数

终端启动时出现“没有此类文件”警告

我对丢失的文件运行了一个源命令。我忘记了,但后来注意到每次我打开一个新终端时,第一行都是关于丢失文件的警告

bash: /software/intel-composer-2011u5-x86_64/bin/compilervars.sh: No such file or directory
~ $
Run Code Online (Sandbox Code Playgroud)

我如何摆脱这个警告?

shell bash profile

3
推荐指数
1
解决办法
1467
查看次数

标签 统计

bash ×3

shell ×2

alias ×1

arguments ×1

background-process ×1

bashrc ×1

kill ×1

profile ×1

rhel ×1