No such file or directory 没有这样的文件或目录
用vim打开该sh文件,输入:
:set ff //回车,显示fileformat=dos
:set ff=unix //重新设置下文件格式
:wq //保存退出
再执行,就不会再提示No such file or directory这个问题了。
Permission denied 权限被拒绝
一: 改变一下当前的登录用户,@前面的字符代表当前登录用户
二: $ sudo chmod -R 777 某一目录
其中-R 是指级联应用到目录里的所有子目录和文件
777 是所有用户都拥有最高权限
查找1天以前的文件,并把查找到的文件删除
find . / -mtime +1 -type f -exec rm -rf {} ;
在{}和\之间必须要有空格,否则会报错:
find:missing argument to `-exec’
[root@localhost ~]# tree
-bash: tree: command not found
[root@localhost ~]#
tree未安装:直接解决方法 yum -y install tree
[root@localhost ~]# yum -y install tree
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
- base: ap.stykers.moe
- extras: ap.stykers.moe
- updates: ap.stykers.moe
Resolving Dependencies
–> Running transaction check
—> Package tree.x86_64 0:1.5.3-3.el6 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================
Package Arch Version Repository Size
Installing:
tree x86_64 1.5.3-3.el6 base 36 k
Transaction Summary
Install 1 Package(s)
Total download size: 36 k
Installed size: 65 k
Downloading Packages:
tree-1.5.3-3.el6.x86_64.rpm | 36 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) centos-6-key@centos.org
Package: centos-release-6-10.el6.centos.12.3.x86_64 (@anaconda-CentOS-201806291108.x86_64/6.10)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : tree-1.5.3-3.el6.x86_64 1/1
Verifying : tree-1.5.3-3.el6.x86_64 1/1
Installed:
tree.x86_64 0:1.5.3-3.el6
Complete!
这就说明下载成功了