常用命令:
df -h
du -h
du -h --max-depth=1 /
tail -500f xxx.log
crontab -l
crontab -e
shell
0:命令含命令所在的路径。
#:传递给程序的总的参数数目。
?:Shell程序在Shell中退出的情况,正常退出返回0,反之为非0值。
*:传递给程序的所有参数组成的字符串。
释放cache
to free pagecache, use echo 1 > /proc/sys/vm/drop_caches;
to free dentries and inodes, use echo 2 > /proc/sys/vm/drop_caches;
to free pagecache, dentries and inodes, use echo 3 >/proc/sys/vm/drop_caches
常用第三种
创建快捷方式
ln s /root/xxx tmp (必须用绝对路径)
更改主机名
vim /etc/hosts
vim /etc/sysconfig/network
免密码登录
(值得注意的是,不在root目录下配,要给authorized_keys赋予权限 chmod 600 authorized_keys )必须是600
ssh-keygen -t rsa -P ''
目录~/.ssh目录生成两文件
id_rsa id_rsa.pub
cat id_rsa.pub >> authorized_keys
分别cat所有机器的 id_rsa.pub 到一台机器的authorized_keys,然后把authorized_keys分发到所有机器的/root/.ssh目录下
添加用户
groupadd test
adduser -g test test
echo "test" | passwd --stdin test
授权文件及文件夹给其他用户
chown -R user1 /spark/Java