Ls
ls -rthl (时间反排序) ls -lrSh (按大小反排序) ls -ld dir1 (只列出dir1的属性,而非内容)
Rm
touch -- -test rm -f -- -test or ls -i find / -inum inum_value -exec rm -f {} \;
Rpm
rpm -qa |grep ls (查看ls 包有没安装) rpm -qf `which tree` (查看tree 命令属于哪个包) rpm -ql firefox (查看 Firfox 安装目录) rpm -ivh --aid tar.rpm (安装时解决包的依赖)
Cp
连目录拷隐藏文件可以拷贝的,比如tmp里如有个".test", $ cp -av tmp/* /destination/path ".test"拷不过去,但 $ cp -av tmp /destination/path 便可以。
Shutdown
shutdown -h now 立即关机 shutdown -h -t 1800 (3m) 3m后关机 shutdown -h 12:30 12:30关机
Diff
diff longname* 对比两个文件 diff -r dir1 dir2 diff -a file1 file2 (ascii)
Tar
find .. -type f -maxdepth 2|xargs tar czf - |openssl des3 -salt -k passwd123 |dd of=bbb.tgz dd if=bbb.tgz |openssl des3 -d -k passwd123| tar zxf -
Ssh
ssh-keygen -t rsa ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.42.163 ssh 总是自动登陆不上 1. chmod 644 /home/test/.ssh/authorized_keys 2. .ssh 700 id_rsa 600 root etc 目录777 时,ssh要输入密码 3. chmod go-w /root ssh ok!