小编Fox*_*Fox的帖子

如何列出邮箱中的邮件?

使用该mail命令,它会显示我拥有的消息并将我放入提示中,但我无法弄清楚如何列出这些消息。这是邮件的帮助屏幕:

Mail Command                    Description
-------------------------       ---------------------------------------------
t [message list]                type messages(s).
more [message list]             read message(s), through the $PAGER
n                               goto and type next message.
e [message list]                edit message(s)
f [message list]                give head lines of messages.
d [message list]                delete message(s).
s [message list] <file>         append message(s) to file.
u [message list]                undelete message(s).
R [message list]                reply to message sender(s).
r [message list]                reply to message sender(s) and all recipients.
p [message list]                print message …
Run Code Online (Sandbox Code Playgroud)

mail-command

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

如何授予用户更改目录中文件/目录所有权的权限

如何授予特定用户更改特定目录中文件和目录的用户和组所有权的权限?

我做了一个谷歌搜索,看到有这样的东西setfacl,它允许授予用户更改文件和目录权限的特定权限。但是,从我读到的内容来看,此命令不允许授予 chown 权限。

所以,说一个文件有

user1 user1 theFile1
user1 user1 theDirectory1
Run Code Online (Sandbox Code Playgroud)

发出以下命令将失败。

[user1@THEcomputer]$ chown user2 theFile
Run Code Online (Sandbox Code Playgroud)

我确实在计算机上具有 root 访问权限。有没有办法授权用户chown在目录内发出命令?

更新:如何将用户添加到组。

下面是文章是我用来添加datamoverhts组。

[root@Venus ~]# usermod -a -G datamover hts
[root@Venus ~]# exit
logout
[hts@Venus Receive]$ groups
hts wireshark datamover
[hts@Venus Receive]$ 
Run Code Online (Sandbox Code Playgroud)

更新(RuiFRibeiro 的地址评论):

将目录的所有权更改为目录不起作用,请参见屏幕截图。

[datamover@Venus root]$ ls -la
total 311514624
drwxrwxrwx. 6 datamover datamover         4096 Oct 14 14:05 .
drwxr-xr-x  4 root      root              4096 Aug 20 16:52 ..
-rwxrwxrwx. 1 …
Run Code Online (Sandbox Code Playgroud)

permissions files chown

5
推荐指数
1
解决办法
8823
查看次数

BASH:并行运行

我有一个 bash 脚本,它接受三个长度相等的数组作为输入:METHODSINFILESOUTFILES

该脚本将解决所有索引( ) 的METHODS[i]问题INFILES[i]并将结果保存到。OUTFILES[i]i0 <= i <= length-1

中的每个元素METHODS都是以下形式的字符串:

$HOME/program/solver -a <method>
Run Code Online (Sandbox Code Playgroud)

其中solver是一个程序,可以按如下方式调用:

$HOME/program/solver -a <method> -m <input file> -o <output file> --timeout <timeout in seconds>

该脚本并行解决所有问题,并将每个实例的运行时间限制设置为 1 小时(但有些方法可以很快解决某些问题),如下所示:

#!/bin/bash
source METHODS
source INFILES
source OUTFILES

start=`date +%s`

## Solve in PARALLEL
for index in ${!OUTFILES[*]}; do 
    (alg=${METHODS[$index]}
    infile=${INFILES[$index]}
    outfile=${OUTFILES[$index]}

    ${!alg}  -m $infile -o $outfile --timeout 3600) &
done
wait


end=`date +%s` …
Run Code Online (Sandbox Code Playgroud)

bash parallelism gnu-parallel

5
推荐指数
1
解决办法
1251
查看次数

未启用 Intel Turbo Boost

我正在尝试在我的服务器上启用 Turbo Boost。根据英特尔的产品页面,我使用的是英特尔至强 E5 2630 v3,它应该支持高达 3.2Ghz 的 Turbo Boost 。

问题是处理器没有超频,并且使用 2.4 GHz 作为最大频率。为了测试操作系统是否是问题所在(我已经测试了 Linux Mint 和 Debian),我将 SSD 安装在我的计算机中,并且配备了 i7 3770,Turbo Boost 运行得非常好。

这是“cpupower”命令的输出:

mint@mint ~ $ cpupower frequency-info
analyzing CPU 0:
  driver: pcc-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  hardware limits: 1.20 GHz - 2.40 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance
  current policy: frequency should be within 1.20 …
Run Code Online (Sandbox Code Playgroud)

linux kernel debian intel turbo-core

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

用 c 编写的程序在 windows 中双击运行,但不在 linux 中运行

我在OS,Linux(Ubuntu和CentOS)和Windows 7上用相同的源代码用C语言做了一个简单的加法程序,如下:

#include <stdio.h>
int main(){
int a,s,d;

printf("type the values u want to add and give tab between them\n");

scanf("%d %d",&a,&s);

d=a+s;

printf("addition is %d",d);

return 0;

system("read -p 'Press Enter to EXIT...' var");
}
Run Code Online (Sandbox Code Playgroud)

在 Windows 中,它在我双击时运行,addition.exe但在 Ubuntu(也在 CentOS)中,当我单击可执行文件时addition,什么也没有发生。它不会运行或打开终端。但是,当我输入./addition终端时它会运行。

但我想通过双击它来运行它。我该怎么办?

该文件的属性在此图像中:

“添加”可执行文件的属性

在属性的打开部分中​​也没有像“在终端中打开”这样的选项。

我也尝试创建.desktop如下文件:

[Desktop Entry]
Name=addition
Type=Application
Exec=/media/smit/D/smits programs of c/projects by code blocks/02U/addition/bin/Debug/addition
Terminal=true
Run Code Online (Sandbox Code Playgroud)

当我点击addition.desktop然后它说启动应用程序时发生错误。

我还尝试通过将此桌面文件复制到/usr/share/applications.

gui terminal executable

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

从标志中分离命令参数

假设我有一个带有标志和参数的命令,如下所示:

mycommand --foo bar arg1 arg2
Run Code Online (Sandbox Code Playgroud)

(该foo标志的值为"bar"。)

但是如果foo可以选择不带参数提供标志怎么办?

mycommand --foo arg1 arg2
Run Code Online (Sandbox Code Playgroud)

如何防止arg1被视为foo标志的价值?

command-line shell arguments

2
推荐指数
1
解决办法
1025
查看次数

/Library: 以 root 用户身份登录时不允许操作

我正在尝试在 El Capitan 上安装 Jekyll,但是我确实遇到了权限错误,如下所示。我以 root 用户身份登录。

Linards:~ Berzins$ sudo gem install jekyll
Password:
Ignoring psych-2.0.15 because its extensions are not built.  Try: gem pristine psych --version 2.0.15
Ignoring json-1.8.3 because its extensions are not built.  Try: gem pristine json --version 1.8.3
Fetching: jekyll-3.1.6.gem (100%)
ERROR:  While exexcuting gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/jekyll
Linards:~ Berzins$ gem pristine psych --version 2.0.15
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Linards:~ Berzins$ …
Run Code Online (Sandbox Code Playgroud)

osx users terminal not-root-user

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