How to know CPU info
cat /proc/cpuinfo archHow to know memory info:
cat /proc/meminfo or sudo dmidecode -t memory freeHow to know Linux release info
CentOS:
vim /etc/redhat-release
How to check if Mysql running?
sudo netstat -tap | grep mysqlHow to check if one pkg is installed?
dpkg -l | grep mysqlHow to check linux version
redhat: rpm -q redhat-release-serverHow to check free disk space
df -hHow to check size of folder
[mashuai191@instance-1 ~]$ sudo du -h --max-depth=1 /home/
5.6G /home/mashuai191
4.1G /home/rsa-key-20190322mashuai191
9.6G /home/
linux下获取占用CPU资源最多的10个进程,可以使用如下命令组合:
ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|headlinux下获取占用内存资源最多的10个进程,可以使用如下命令组合:
ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head Network config: Config hostname: Redhat: hostname xxx 启动生效,修改 /etc/sysconfig/network extract rpm into one directory rpm2cpio logrotate-1.0-1.i386.rpm | cpio -ivd Add date for created file cp /etc/login.defs /etc/login.defs.`date +"%Y%m%d"` vi 拷贝全部 gg"+yG man 输出到文件乱码,solution 如下 man command | col -b >/home/command.txt CentOS 访问 win7 共享 mount -t cifs -o sec=ntlm, password="" //10.200.78.2/f /home/mashuai/A_B_port/team_share_drive user login history: who /var/log/wtmp last -w full username/domain Find hang process: ps aux|grep -w 'D' Redirect prints- ]$ cmd 2>/dev/null, redirect stderr to null
- ]$ cmd 2>&1 1>/dev/null, Capturing STDERR only
- /etc/profile:这是系统整体的配置,你最好不要修改这个文件;它会call /etc/inputrc, /etc/profile.d/*.sh, /etc/sysconfig/i18n
- ~/.bash_profile 或 ~/.bash_login 或 ~/.profile:属于使用者个人配置,你要改自己的数据,就写入这里! 其实 bash 的 login shell 配置只会读取上面三个文件的其中一个, 而读取的顺序则是依照上面的顺序. 在其中会call ~/.bashrc