angela 发表于 2018-5-20 14:21:09

LINUX命令报错

  1、find: paths must precede expression
  

  # find /u01/app/diag/tnslsnr/fossdb/listener/alert -name log_*.xml
  find: paths must precede expression
  Usage: find [-H] [-L] [-P]
  #
  # find /u01/app/diag/tnslsnr/fossdb/listener/alert -name 'log_*.xml'
  进行查找资料,多文件的查找的时候需要增加单引号
  #find /u01/app/diag/tnslsnr/fossdb/listener/alert -name 'log_*.xml'
  2、find: missing argument to `-exec’ 或 find: 遗漏“-exec”的参数
  #find /u01/app/diag/tnslsnr/fossdb/listener/alert -name 'log_*.xml' -exec rm -rf {}\;

  find: missing argument to `-exec’

  要这样
  find /u01/app/diag/tnslsnr/fossdb/listener/alert -name 'log_*.xml' -exec rm -rf {} \;--这里要加空格

  3、# scp
  -bash: scp: command not found
  新搭建的服务器上没有scp命令
  在一台正常的服务器上运行如下命令
  # which scp
/usr/bin/scp

# rpm -qf /usr/bin/scp
openssh-clients-4.3p2-72.el5
  在有问题的服务器上运行如下命令
  # yum install openssh-clients
或者从光盘上安装
# rpm -ivh libedit-2.11-4.20080712cvs.1.el6.x86_64
# rpm -ivh openssh-clients-5.3p1-20.el6.x86_64
  4、sudo: sorry, you must have a tty to run sudo
  

  使用不同账户,执行执行脚本时候sudo经常会碰到 sudo: sorry, you must have a tty to run sudo这个情况,其实修改一下sudo的配置就好了
  

  vi /etc/sudoers (最好用visudo命令)
  

  注释掉 Default requiretty 一行
  

  #Default requiretty
  

  意思就是sudo默认需要tty终端。注释掉就可以在后台执行了。
  5、can't get address for localhost
X11TransSocketINETConnect() can't get address for localhost:6010: Name or service not known






# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1localhost.localdomain localhost
::1localhost6.localdomain6 localhost6
#127.0.0.1esbserver54
#10.230.13.54esbserver54
#10.230.13.54 SANTAO_ESB_10
#10.230.13.54 SANTAO_ESB_10.230.13.54
10.230.21.133 esbserver54
  
页: [1]
查看完整版本: LINUX命令报错