Contents
linux 实用命令
linux bash 清除history
vim ~/.bash_history
linux mysql 查看 query history
cat ~/.mysql_history
或者(需mysql > 5.1.11)
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';
然后查询 mysql.general_log 表就可以了;
如果想输出到 log 文件:
SET GLOBAL log_output = "FILE";
SET GLOBAL general_log_file = "/path/to/your/logfile.log"
SET GLOBAL general_log = 'ON';
这样就可以使用:
tail -f /path/to/your/logfile.log
来查看日志了。
ps:需要注意的是,这里的 /path/to/your/logfile.log 需要修改 用户及组
另外,如果可以的话,也可以通过修改 /etc/mysql/my.cnf 然后重启 MySQL 来实现。
MAC 实用命令
mac zsh 清除history
echo "" > $HISTFILE & exec $SHELL -l
另外,如果常用来清除的话,可以加一个别名,像这样:
vim ~/.zshrc
alias hc='echo "" > $HISTFILE & exec $SHELL -l'
不能安装未知来源的软件
$ sudo spctl --master-disable
MAC OS查看端口占用情况及杀死进程
sudo lsof -i :端口号
显示/隐藏 隐藏文件
defaults write com.apple.finder AppleShowAllFiles -bool true;
KillAll Finder
command+shift+.
设置 Launchpad 的展示方式
defaults write com.apple.dock springboard-columns -int 9;
defaults write com.apple.dock springboard-rows -int 6;
defaults write com.apple.dock ResetLaunchPad -bool TRUE;
killall Dock
前往指定目录
command + shift + G
xxx 程序缓存目录
~/Library/Caches/