#!/bin/bash # log -c 清除日志 # log -t 即tail -f -n 5000日志 # log -l 即less 日志 # log 直接回车或 -h,则打印使用方法 if [ "$1" = "-c" ]; then echo "clear log..." > storage/logs/laravel.log exit 0 fi if [ "$1" = "-t" ]; then tail -f -n 5000 storage/logs/laravel.log exit 0 fi if [ "$1" = "-l" ]; then shift less storage/logs/laravel.log exit 0 fi echo "usage: log [-c|-t|-l|-h]" exit 0