Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Here are a list of my commonly used Alias's. I always use alias once I get a command to work correctly! Some of these are just improvements like for example alias cp="rysnc ...." overrides the systems use of cp but rysnc is way better!

[Updated] Rsync is not Always better :-P, turns out rsync over NFS doesn't work well unless you use rsync 192.168.1.42:/files instead of just using rsync over the nfs mounts.

Note: Some of these are "customized", like preptemplate, you may not use postfix and xymon-client

nano ~/.bashrc && source ~/.bashrc && sudo nano /root/.bashrc
#SystemCTL Firewall Alias's
#FirewallD Alias
alias firewallddisable="systemctl disable firewalld"
alias firewalldenable="systemctl enable firewalld"
alias firewalldstart="systemctl start firewalld"
alias firewalldstop="systemctl stop firewalld"
alias firewalldreload="systemctl reload firewalld"
alias firewalldstatus="systemctl status firewalld"
#IPTables Alias
alias iptablesdisable="systemctl disable iptables"
alias iptablesenable="systemctl enable iptables"
alias iptablesstart="systemctl start iptables"
alias iptablesstop="systemctl stop iptables"
alias iptablesrestart="systemctl restart iptables"
alias iptablesreload="systemctl reload iptables"
alias iptablesstatus="systemctl status iptables"
alias iptablessavenew="service iptables save"
#CentOS Specific Alias's
alias install="sudo yum -y install"
alias upgrade="sudo yum -y update"
alias update="sudo yum check-update"
alias networkscripts="cd /etc/sysconfig/network-scripts" 
#CentOS 7 Specific Alias's
alias preptemplate="sudo nano /etc/hostname  && sudo nano /etc/hosts && sudo nano /etc/postfix/main.cf && sudo nano /etc/postfix/header_checks ; sudo nano /etc/default/xymon-client && sudo nmtui && sudo reboot"
alias netgui="sudo  nmtui && service network restart"
alias netinf="sudo nmtui && service network restart"
alias hostname="sudo nano /etc/hostname"
#CentOS 5/6 Specific Alias's
alias netinf="sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0 && service network restart"
alias hostname="sudo nano /etc/sysconfig/network && sudo reboot"
alias preptemplate="sudo nano /etc/sysconfig/network && sudo nano /etc/default/xymon-client && sudo nano /etc/postfix/main.cf && sudo nano /etc/postfix/header_checks ; sudo nano /etc/hosts && sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0 && sudo rm /etc/udev/rules.d/70-persistent-net.rules && sudo reboot"
#Cluster Alias's
alias clusterstart="pcs cluster start --all"
alias clusterstop="pcs cluster stop --all"
alias clusterstatus="pcs status"
alias clusterresourcestatus="pcs status resources"
alias clusterdc='pcs status | grep "Current DC\|virtual_ip"'
alias clusterconstraints="pcs constraint --full"
alias drbdstatus="drbd-overview"
alias watchdrbd="watch drbd-overview"
alias catdrbd="drbd-overview"
alias node1standby="pcs cluster standby node1"
alias node1unstandby="pcs cluster unstandby node1"
alias node1stop="pcs cluster stop node1"
alias node1start="pcs cluster start node1"
alias node2standby="pcs cluster standby node2"
alias node2unstandby="pcs cluster unstandby node2"
alias node2stop="pcs cluster stop node2"
alias node2start="pcs cluster start node2"
alias watchclustermon="watch ls -la /usr/local/bin/"
alias watchpcsstatus="watch pcs status" 
#Ubuntu Specific Alias's

alias install="sudo apt-get update && echo y | sudo apt-get install"
alias upgrade="sudo apt-get update && echo y | sudo apt-get upgrade && echo y | sudo apt-get autoremove && sudo reboot"
alias netintf="sudo nano /etc/network/interfaces && sudo reboot"
alias remastersysbackup="sudo remastersys clean && sudo remastersys backup"
alias fixdepends="echo y | sudo apt-get install -f"
alias preptemplate="sudo nano /etc/hostname  && sudo nano /etc/hosts && sudo nano /etc/network/interfaces && sudo nano /etc/default/xymon-client && sudo nano /etc/postfix/main.cf && sudo nano /etc/postfix/header_checks ; sudo postmap /etc/postfix/sasl/sasl_passwd && sudo postmap /etc/postfix/canonical && sudo newaliases && sudo /etc/init.d/postfix restart ; sudo reboot"
alias hostname="sudo nano /etc/hostname  && sudo nano /etc/hosts && sudo reboot"
alias displaysize="xrandr --output Virtual1 --mode 1360x768" 
#Universal Alias's

alias bashrc="nano ~/.bashrc && source ~/.bashrc"
alias samba="sudo nano /etc/samba/smb.conf"
alias mountall="sudo mount -a"
alias hosts="sudo nano /etc/hosts"
alias rm="sudo rm"
alias rmdir="sudo rm -r"
alias cp="sudo cp"
alias mv="sudo mv"
alias shutdown="sudo shutdown -h now"
alias reboot="sudo reboot"
alias apache="cd /var/www/html"
alias symlink="sudo ln -s"
alias apachelog="sudo tail -f /var/log/apache2/error.log"
alias nginxlog="sudo tail -f /var/log/nginx/error.log"
alias root="sudo -sH"
alias fstab="sudo nano -Bw /etc/fstab"
alias disks="df -T -H"
alias f2blog="sudo nano /var/log/fail2ban.log"
alias f2blogd="sudo rm /var/log/fail2ban.log"
alias unpack="tar -zxvf"
alias exportnfs="sudo exportfs -ra"
alias nfsrestart="sudo service nfs-kernel-server restart"
alias exports="sudo nano /etc/exports"
alias rootcron="sudo crontab -e"
alias dirsize="du -sh"
alias 7="sudo chmod 777"
alias nohups="> nohup.log &"
alias cgrub="sudo nano /etc/grub.d/40_custom"
alias ugrub="sudo update-grub2"
alias ftp="cd /srv/ftp"
alias ftprules="sudo nano /etc/vsftpd.conf"
alias apacheconfig="sudo nano /etc/apache2/apache2.conf && sudo service apache2 restart"
alias processes="ps -ef"
alias apachesavailalble="cd /etc/apache2/sites-available"
alias nginxsavailalble="cd /etc/nginx/sites-available"
alias ram="free -m"
alias prepreboot="sudo chown root /etc/rc.local && sudo chmod 755 /etc/rc.local && sudo nano /etc/rc.local && sudo touch /root/.reboot.sh && sudo sh -c 'echo "#!/bin/bash" >> /root/.reboot.sh' && sudo chmod 755 /root/.reboot.sh"
alias rebcmd="sudo nano /root/.reboot.sh && sudo reboot"
alias tarball="sudo tar -cvzf"
alias untar="sudo tar -xzvf"
alias liveiso="mkdir /tmp/mnt > sudo mount -o loop live.iso /tmp/mnt && sudo find /tmp/mnt \( -name '*.squashfs' -o -name "*.SQFS" \) -exec unsquashfs -d /tmp/squashfs-root/ {} \; && sudo umount /tmp/mnt && sudo rm /tmp/mnt -R"
alias mkfsiso="sudo mksquashfs /tmp/squashfs-root filesystem.squashfs && sudo rm /tmp/squashfs-root -R"
alias wpconfig="sudo nano /var/www/html/wp-config.php && sudo service apache2 restart"
alias dnsmasqconfig="sudo nano /etc/dnsmasq && sudo service dnsmasq restart"
alias catdhcp="cat /var/lib/misc/dnsmasq.leases"
alias httpdconf="sudo nano /etc/httpd/conf/httpd.conf"
alias createpassword="dd if=/dev/urandom bs=9 count=1 | base64" 
  • No labels