File Archive
归档 1 天前的文件,并将原文件删除。
#!/bin/bash |
Author: Sakura Yumeno
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Related Articles

2023-05-20
echo_color
echo_color #!/usr/bin/env bashecred='\033[0;31m'ecyellow='\033[0;33m'ecgreen='\033[32m'ecend='\033[0m'echo_red() { echo -e "${ecred}$@${ecend}"}echo_yellow() { echo -e "${ecyellow}$@${ecend}"}echo_green() {echo -e "${ecgreen}$@${ecend}"} 格式解析 Colors Reference 字颜色:30—–37 echo -e “\033[30m 黑色字 \033[0m” echo -e “\033[31m 红色字 \033[0m” echo -e “\033[32m 绿色字 \033[0m” echo -e “\033[33m 黄色字 \033[0m” echo -e “\033[34m 蓝色字 \033[0m” echo -e “\033[35m 紫色字 \033[0m” echo -e “\033[36m 天蓝字 \033[...

2023-05-20
oracle_11g_setup
oracle_11g_setup #! /usr/bin/env bash# set -e Exit immediately if a command exits with a non-zero status.set -esource /assets/colorechotrap "echo_red '******* ERROR: Something went wrong.'; exit 1" SIGTERMtrap "echo_red '******* Caught SIGINT signal. Stopping...'; exit 2" SIGINT#Install prerequisites directly without virtual packagedeps () { echo "Installing dependencies" yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 \ ksh elfutils-libelf elfutils-libelf-devel glib...

2023-09-22
Find and Remove Trash Files
Find and Remove Trash Files #!/bin/bashPATH=$PATH:.:/etc; export PATHALERT_TRACE=/u01/app/oracle/diag/rdbms/orcl/orcl/trace; export ALERT_TRACELI_TRACE=/u01/app/logs/diag/tnslsnr/pacemaker-1/listener_orcl/trace; export LI_TRACEORACLE_SID=orcl; export ORACLE_SID[[ -d "/u01/app/logs" ]] || echo "No trace directory!!!" && exit 0echo "Deleting: $ORACLE_SID - trace log files"# Copy current trace filecp -p $ALERT_TRACE/alert_$ORACLE_SID.log $ALERT_TRACE/alert_$ORACLE_SID."$(date +%y%m%d)"c...

2023-05-20
lsb_functions
lsb_functions ## Use LSB init script functions for printing messages, if possible#lsb_functions="/lib/lsb/init-functions"if test -f $lsb_functions ; then . $lsb_functionselse # Include non-LSB Redhat init functions to make systemctl redirect work init_functions="/etc/init.d/functions" if test -f $init_functions; then . $init_functions fi log_success_msg() { echo " SUCCESS! $@" } log_failure_msg() { echo " ERROR! $@" }fi

2023-05-20
Linux Quick Commands
Linux Quick Commands PS1 PS1="┌──\u@\h:\w\n└─\$ "┌──ubuntu@instance-20260728-0031:~└─$ Manufacturer information: dmidecode -t memory Temporarily allow the required algorithms directly in your SSH command: ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa user@hostname Convert line break CRLF to LF. sed -i 's/\r//g' a.txt Convert file encoding. file input.txticonv -f UTF-16 -t UTF-8 input.txt -o output.txt Rename files. find . -name "* *.md" -exec rename -f 's/ /-/g...
Contents