局部.nanorc设置
// /home/senking// .nanorcset autoindentset mouseset smarthome
全局.nanorc设置
// /etc/nanorc// sudo nano /etc/nanorcset mouseset autoindentset smarthome
配置终端.bashrc
/* // 局部.bashrc /home/senking/.bashrc // 全局.bashrc /etc/bashrc*/
profile配置文件
// 全局/etc/profile//局部/home/senking/.profile//立即生效命令source .bashrcsource .profile
修改服务器地址
// nano /etc/yum.repos.d/CentOS-Base.repo1.//备份原文件mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup2.//下载新文件替换wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo3.//运行生成缓存yum makecache
yum 包管理器
//都是升级命令yum update //不删除旧包yum upgrade //删除旧包//搜索包yum search wget//安装yum install wget//删除包yum remove wget
安装手册(man,apropos)
yum install -y man-pagesmandbman mkdir //NAME 里面的就是名字,和简单描述。//SYNOPSIS 用法。 粗体文字表示原封不动的输入,下划线的文字表示要用的实际内容替换apropos sound
补充(cp):
//单项cpcp file file.txt//多项cpcp file1 file2 demofile/
查找文件(locate)
//1 locate 命令是搜索包含关键字的所有文件和目录// locate 新建的文件找不到,解决方法是更新文件数据库sudo updatedb // 更新文件数据库//2 find 查找文件的命令find 何处 何物 做什么// 何处: 指定在那个目录查找// 何物: 必须!查找什么,可是 文件,大小,近访问时间// 做什么:默认,只会显示找到的文件// 按照文件名查找find -name "list"//按照文件名在规定的目录查找find /home/senking/ -name 'list_ls*'或find /home/senking/ -name '*ls_1'或find /home/senking/ -name '*ls_*'// 全硬盘查找find / -name '*ls_1'//2.1 find 按照文件大小查找(Ko,Mo,Go , 千字节,兆字节,千兆字节)find /var -size +10M// 查找小于50Ko的文件find /var -size -50k// 2.2 find 按照文件访问时间查找 -atime -7(单位是天,-号是小于)find -name '*.txt' -atime -7// 2.3 find 按照文件类型查找 -type d (d,目录。f,文件)find . -name "demo1" -type d////操作查找结果////// -printf 打印// -printf "%p - %n\n" (%p:文件名, %n:用户名)find -name '*.txt' -printf "%p - %n\n"// -delete 删除find -name ".png" -delete// -exec 执行一个命令 / -ok 执行命令,并提示是否继续// {} 会用查找到的每个文件来替换// \; 是必须的结尾find one -name '.txt' -exec chmod 600{}\;
Permission denied 没有权限