This tutorial shows how to add aliases permanently to your bash shell.
alias poweroff='sudo /sbin/poweroff'
alias iptlistfw='sudo /sbin/iptables -L FORWARD -n -v --line-numbers' Keep ’em coming!Any alias of rm is a very stupid idea (except maybe alias rm=echo fool).A co-worker had such an alias. *) ;; Also, we can have a separate file for all aliases (~/.bash_aliases) but to make this file to work we must append the following lines at the end of the ~/.bashrc file, using any text editor:Also we can use the following command to add alias without opening the ~/.bash_aliases filethis alias can help us to connect to our vps server via a three-letter commandHere are some examples of permanent aliases that can help in daily workAll created aliases will work next time we log in to via ssh or open new terminal. Can you please explain?A more explicit version of that alias (that I use) would look like:Basically, it runs `source` for you once you save&exit the file. # Only print actual code/configuration "curl -u 'admin:my-super-password' 'http://192.168.1.2/setup.cgi?todo=reboot'"'sync && sleep 2 && /etc/init.d/httpd stop && umount netapp2:/exports/http && sleep 2 && mount -o rw,sync,rsize=32768,wsize=32768,intr,hard,proto=tcp,fsc natapp2:/exports /http/var/www/html && /etc/init.d/httpd start''/usr/bin/memcached-tool 10.10.27.11:11211 display'## Remove assets quickly from Akamai / Amazon cdn ##'/home/scripts/admin/cdn/purge_cdn_cache --profile akamai''/home/scripts/admin/cdn/purge_cdn_cache --profile amazon''/home/scripts/admin/cdn/purge_cdn_cache --profile akamai --stdin''/home/scripts/admin/cdn/purge_cdn_cache --profile amazon --stdin'40 Linux Server Hardening Security Tips [2019 edition]Linux 25 PHP Security Best Practices For Sys Admins30 Best Sources For Linux / *BSD / Unix Documentation On the Web30 Linux System Monitoring Tools Every SysAdmin Should Know'avconv -f x11grab -r 25 -s 1900x1000 -i :0.0+0,24 -vcodec libx264 -threads 0''avconv -f x11grab -r 25 -s 1900x1000 -i :0.0+0,24 -vcodec libx264 -threads 0 -f alsa -i hw:0 '# pastebin from the command line, use it like this :'curl -F "clbin=<-" "https://clbin.com"'
This overwrites the existing alias with that name.If you have created permanent alias than open that file again and remove alias entry from configuration file.For example you frequently need to go in directory which have long path. This tutorial explains linux alias command with syntax and options in details including how to list, set, add, remove, create and delete alias in Linux temporary and permanently step by step with practical examples.
alias ....='cd ../../../../' Works with all commands; I use it constantly.Don’t forget… sl=”ls”.
\c Then type: myusbAnd if you have zsh, you may want to give oh-my-zsh a try. I use ‘aa’ for “add alias.” It is always the first alias I create. # Only print actual code/configuration You can create an alias for that directory and use it. With these alias and some shell scripting I’m really starting to cut down on wasted time!I use this one when I need to find the files that has been added/modified most recently:a little mistake, not really important if you don’t copy/paste like a dumbass alias iptlistfw=’sudo /sbin/iptables -L FORWORD -n -v –line-numbers’In “Task: Disable an alias temporarily (bash syntax)”True, but unless you have a program called ‘c’, this doesn’t do anything useful. ## use /bin/ls command and avoid ls alias ## Hint: edit the config file with “sudo visudo”, not “sudo vim /etc/sudoers”. Learn how to customize the Linux environment with local and global alias in detail.Some of the aliases listed are likely to be system-wide aliases that apply to all users and are created automatically for each new user for a particular shell. Doing update on Mageia linux. AFAIK It’s not an universal solution but it worths a try.I have been using this concept for many years and still trying to perfect the methodology.