Unix & Linux

Linux,FreeBSD和其他类似Un * x的操作系统用户的问答

4
在CentOS上安装MongoDB时出现Yum错误?
我正在使用Centos 6.6(x86_64),试图安装最稳定的mongodb版本。但我被这个错误困住了(可能会重复出现,但以前的答案对我都不起作用) [root@localhost home]# sudo yum install -y mongodb-org Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Install Process Loading mirror speeds from cached hostfile * base: ftp.iitm.ac.in * extras: ftp.iitm.ac.in * updates: centos.01link.hk http://repo.mongodb.org/yum/redhat/%24releaserver/mongodb-org/3.0/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" Trying other …
8 linux  centos  yum  mongodb 


2
对括号中带整数且无空格的文件进行排序
我正在尝试对这样的文件进行排序(这是子例程名称的列表) cfn=(1370) __lib_file_MOD_file_open fn=(1368) __universe_MOD_general_boot fn=(916) __universe_MOD_general_main fn=(6142) __grid_var_MOD_get_overlap ... 根据括号内的整数。我首先尝试排序命令为 sort -t '=' -k 2 routine_list.txt 但随后fn =(916)出现在输出的末尾。 fn=(1368) __universe_MOD_general_boot cfn=(1370) __lib_file_MOD_file_open fn=(6142) __grid_var_MOD_get_overlap ... fn=(916) __universe_MOD_general_main 但我希望数字按升序排序(916-> 1368-> 1370-> ...)是否可以使用几个命令或选项相对简单地完成此操作?
8 files  sort 

1
`xdotool`不发送密钥
我正在尝试通过发送按键xdotool。但是,发送无法正常工作。 以下是脚本的日志,该脚本应选择Gedit中的所有文本并进行复制(但不执行任何操作)及其输出(通过重定向stdout和stderr捕获): + xdotool getwindowname 29360262 *Unsaved Document 1 - gedit + xdotool key --window 29360262 ctrl+a + sleep 1 + xdotool key --window 29360262 ctrl+c + sleep 1 我已经尝试过Thunderbird,并且脚本确实发送了密钥,但是没有修饰符(即没有Control)。顺便说一句,在脚本中,键由包围",例如"ctrl+a"。 Gedit和Thunderbird之间的区别可能是Gedit是GTK3应用程序,而Thunderbird似乎是GTK2应用程序(但是Firefox,它似乎是GTK3应用程序,其行为类似于Thunderbird)。 xdotool版本3.20141006.1 操作系统:Debian GNU / Linux 8.1(Linux内核3.16.0-4-amd64) 桌面管理器:GNOME Shell 3.14.4
8 x11  xdotool  events 


1
用通配符分配的变量中的参数扩展
我的当前文件夹(MA502)中有两个文件,它们的名称是- MA502_TAAGGCGA-TCGCAGG_L001_R1_001.at.fastq MA502_TAAGGCGA-TCGCAGG_L001_R2_001.at.fastq 我有很多这样的文件夹-例如MA503,MA504等,我想遍历这些文件夹。 我使用通配符分配变量名- Forward=*R1*.at.fastq Reverse=*R2*.at.fastq 我想在脚本中处理这些文件,并希望将输出替换.at为.atqt,以便最终名称看起来像- MA502_TAAGGCGA-TCGCAGG_L001_R1_001.atqt.fastq MA502_TAAGGCGA-TCGCAGG_L001_R2_001.atqt.fastq 我试过了 awk 'script' $Forward > ${Forward/.at/.atqt} 我的最终文件名看起来像- *R1*.atqt.fastq 而不是我的期望 MA502_TAAGGCGA-TCGCAGG_L001_R1_001.atqt.fastq 我已经根据需要在UNIX上学到了所有东西,所以我不确定如何处理变量名。任何帮助表示赞赏!

2
sudo rm -rf在root拥有的空目录上返回“无法删除目录”
我的Debian系统上有一个目录。目录是: root@debian:/3/20150626# stat 00 File: `00' Size: 6 Blocks: 0 IO Block: 4096 directory Device: fe00h/65024d Inode: 4392587948 Links: 3 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2015-06-25 20:00:00.086150791 -0400 Modify: 2015-07-07 12:39:04.174903234 -0400 Change: 2015-07-07 12:39:04.174903234 -0400 Birth: - 目录为空: root@debian:/3/20150626# ls -al 00 total …
8 linux  directory  rm 



3
不输入密码就无法设置ssh登录
我通过以下方式自动设置了ssh登录,而无需在服务器上输入密码: cd ~/.ssh ssh-keygen ssh-copy-id -i ~/.ssh/id_rsa.pub tim@server1 它可以在服务器上运行。 后来我在另一台服务器上做了同样的事情。 ssh-copy-id -i ~/.ssh/id_rsa.pub tim@server2 立即我ssh tim@server2,但仍然需要我的密码。我做错了什么吗?我没有在第二台服务器上成功设置的一些可能原因是什么?(请注意,第二台服务器运行kerberos和Andrew文件系统) $ ssh -v tim@server2 OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to server2 [...] port 22. debug1: Connection established. debug1: …
8 ssh 

3
如何用另一个文件中的一部分文本替换文件中两个标记之间的文本?
假设我在中有一段文字~/.bashrc: #~/.bashrc # ...some commands... # aliases alias suicide='sudo rm -rf /' # end aliases # other commands 我希望将该文本块替换为另一个文件中两个标记之间包含的一些其他文本: stuff-to-place-in-bashrc.txt # stuff-to-place-in-bashrc.txt # ...stuff... # aliases alias ldir='ls * -d' alias ithinklifeisworthliving='echo all good' # end aliases # ...more stuff... 我试过了 sed -ne 's/# aliases\s+\(.*\)\s+# end aliases/\1/' stuff-to-place-in-bashrc.txt 但是我真的在黑暗中摇摆。有人可以帮我吗? 如何从中提取文本stuff-to-place-in-bashrc.txt? …

1
无法在Centos 7中启动NFS:无法发出方法调用:没有这样的文件或目录
我无法在CentOS7中启动NFS服务器。 下载的软件包: yum -y install nfs-utils yum -y install nfs-utils-lib 启用/启动服务 systemctl enable/start rpcbind systemctl enable/start nfs-server systemctl enable/start nfs-lock systemctl enable/start nfs-idmap 这导致 : systemctl enable nfs-lock Failed to issue method call: No such file or directory systemctl enable nfs-idmap Failed to issue method call: No such file or …
8 centos  nfs 


3
取消所有与_PROXY匹配的ENV变量
我正在尝试取消匹配的所有环境变量_PROXY: env | grep -i _proxy | column -t -s '=' | awk '{ print $1 }' | grep -iv 'no_proxy' | xargs -0 -I variable unset variable 却失败了xargs: unset: No such file or directory。 但是,如果尝试更改unset为echo,那么一切似乎都可以按预期进行:我得到了一组已设置的变量。 env | grep -i _proxy | column -t -s '=' | awk '{ print …

3
OpenVPN,resolvconf和DNS域解析
在site1时,我需要通过OpenVPN连接到site2。连接后,OpenVPN站点2将推送DNS名称服务器和域搜索选项。这将导致site1的所有名称解析失败。 例: DHCP物理连接到site1,DHCP推送DNS选项,然后resolvconf对其进行管理。 /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 172.16.1.101 nameserver 172.16.1.102 search site1.internal.domain 打开到站点2的OpenVPN隧道,OpenVPN将dhcp-option DNS和DOMAIN /etc/openvpn/update-resolv-conf推送到站点2,并将它们推送到resolvconf。 /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.