# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
#~/.by
# You may uncomment the following lines if you want `ls' to be colorized:
# export LS_OPTIONS='--color=auto'
# eval "$(dircolors)"
# alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
function pid(){
ps -ef | grep '' | awk '{print $2}'
}
alias fw='service --status-all | grep +'
alias vf='v /etc/systemd/system/test.service'
alias cq='sudo reboot'
alias h='htop'
alias ss='ss -antpl | grep 5432'
alias pd='ps -aux'
alias pdd='ps -aux | grep'
alias p='python3'
alias s='source .bashrc'
alias r='rm -R'
alias nid='netstat -ntlp|grep'
alias mk='mkdir'
alias see='less'
alias se='head -n -0'
#lsblk查看磁盘分区
alias lll='lsblk -f'
alias df='df -hl'
alias cl='clear'
alias cmd='compgen -a'
alias cp='cp -r'
alias w='whereis'
alias fd='find / -name'
alias mip="ifconfig -a"
alias mipp="ip address show"
alias hs="hostname -i"
alias rd="readlink -f"
alias 23='2to3 -w'
alias al='apt list'
alias ai='apt install -y'
alias au='apt update'
alias aup='apt upgrade'
alias pi='pip install'
alias pif='pip freeze'
alias ll='ls -alF'
alias l='ls -A'
alias v='vim'
alias c7='chmod 777 -R'
alias c0='chmod 700 -R'
alias c3='chmod 327 -R'
alias cmdd='man'
alias vb='vim .bashrc'
alias svb='head -n -0 /root/.bashrc'
alias p='python3'
function rem(){ apt remove -y $1
apt purge -y $1
apt auto remove -y $1
}
function c (){
x="$1"
y="${x%.*}"
clang++ -o "$y" "$x" && ./$y
}
function j (){
x="$1"
y="${x%.*}"
javac "$x"
java "$y"
}
function vs()
{
if "$1" --version
then
echo
elif "$1" -version
then
echo
elif "$1" version
then
echo
elif "$1" -v
then
echo
fi
}
function hl()
{
if "$1" --help
then
echo
elif "$1" -help
then
echo
elif "$1" help
then
echo
fi
}
sudo service lightdm stop
sudo service postgresql stop
sudo service apache2 stop
sudo service mariadb stop
function sta(){ #apt install -y systemd
#vim /etc/systemd/system/test.service #[Unit]
#Description=My test service #After=multi-user.target
#[Service]
#Type=simple #Restart=always
#ExecStart=/usr/bin/python3 /home/<username>/test.py
#[Install]
#WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable test.service
sudo systemctl start test.service
sudo systemctl restart test.service
}
function sto(){ #sudo systemctl stop test.service
}
function lk(){
ls -A |grep .$1
ls -A *.$1
}
服务器bashrc备份
最新推荐文章于 2024-08-29 16:17:58 发布