pro tip: use backslash in front of a command to temporarily bypass its alias (if any). eg: \ls
@jonspoonamore37213 жыл бұрын
30+ year Net/Sys Admin here. I stopped using/making individual script files years ago in favor of using Aliases. This lets me keep all of my most used/custom bash scripts either as Aliases or Bash Functions in one Bash Setup Script (BSS). I keep my BSS synced to the Cloud so that it's available on all machines I access/use.
@stefanders74623 жыл бұрын
Excellent tip. Do you have other tips? Thank you
@jonspoonamore37213 жыл бұрын
@@stefanders7462 Scripting should be "Your Friend" in Linux. It is for me. Why work when you can let the computer do it for you. Automating much of your daily tasks, using Aliases/Scripts, is the Cat's Meow! LOL!!! If you have to type more than 20 characters to perform a task a couple times a day, it's time to setup an Alias. For example.... I have Aliases setup to switch to different directories with extremely long paths. I also have Aliases setup to restart server services after I make server changes (otherwise, I'd be typing 150+ characters to do so). As of late, I have be doing a lot of video transcoding for my home media server. I have an Alias and Bash Function setup to convert all video files in the current directory to the ".MP4" format (in my preferred specifications). I just move files I want to transcode to a folder, type "cv" @ the command line and let it work in the background while I do other things. My "cv" alias is about 200+ characters in length. Doing simple tasks with a GUI interface is OK. But... Doing complex tasks is where Aliases/Scripts shine!!!!
@jonspoonamore37213 жыл бұрын
@@stefanders7462 I also would recommend the text editor "micro" for your command line text editing. It basically gives you a GEdit/Pluma experience without the GUI part. Nano and Pico are my 2nd choices for text editors.
@stefanders74623 жыл бұрын
@@jonspoonamore3721 Thanks for taking the time to write this I will take into consideration to put more attention into incorporating the use of aliases. My only problem is remembering them all, if I put an alias for a command that I am using like once a month I will most likely forget about it by the time I need to use it again.
@stefanders74623 жыл бұрын
@@jonspoonamore3721 Didn't know about micro, looks like a combination between vi and nano (I might be wrong..)? I know there's a whole "cult" around using vi and people tend to look down on you for using anything less but nano gets the job done for me. I've started working with linux like 1 year ago and I feel like I made a huge progress in building confidence and knowledge while working with the OS, there are quite a few things to understand and know.
@ewancox48953 жыл бұрын
I have many aliases that I've accumulated over the years, so I created a separate file named .aliases then source it in my .zshrc file, as below; source ~/.config/.aliases I find it easier to keep track and share between my systems that way, plus it's synched to my Nextcloud and allows me to retain system specific .bashrc and .zshrc files, while having common alias listings.
@stefanders74623 жыл бұрын
This is actually a good idea.
@dragonek_gnu_linux_pl2 жыл бұрын
its good to making it on hidden directory if the parrent directory is already hidden?
@Tech-MarkАй бұрын
Fancy meeting you here ! 🎉
@arijitkumarhaldar31973 жыл бұрын
For the speedtest...there is actually a package in the repository for both apt and pacman...not sure about others...which is called speedtest-cli ... That's the cli for Ookla speedtest and it essentially does the same thing
@andrewpoptanich52843 жыл бұрын
I really appreciate these videos. I'm using Pop on a system 76 laptop, but I prefer Cinnamon to Gnome. Because of this I need to use the command line to change graphics modes. I do this infrequently, so I need to web search the command each time. Simplifying this with an easily remembered alias is much easier.
@SuperThisislife Жыл бұрын
what an amazing tutorial! i thoroughly enjoyed as a non-coder. thank you so much!
@samsh0-q3a3 жыл бұрын
Perfect timing Jay, I was just going to look up some info on these lol
@MarkusHobelsberger3 жыл бұрын
I actually started to set up aliases just this week. Didn't use them until now, since I was still in the phase of learning commands and I suggest everyone should only use aliases for commands they are sure they know by heart anyway or don't care to know anyway like the cpu5 or cpu10 strings. Another good one imo: c for clear
@arijitkumarhaldar31973 жыл бұрын
Ctrl+L does that shortcut for you
@MarkusHobelsberger3 жыл бұрын
@@arijitkumarhaldar3197 Not quite the same thing. Ctrl+L just scrolls down and gives you a new input line while clear actually clears the screen. Let's say you're ls- or cat-ing some really long outputs, it's nice to be able to remove the old ones.
@disasterarea934110 ай бұрын
so true. this is one of those things that become useful once you're already using the command line anyway
@fixer11403 жыл бұрын
I came looking for charcoal and I found gold. Thank you so much Jay.
@tubeDude48 Жыл бұрын
Put them in *.bash_aliases* to keep *.bashrc* clean!
@WC1376C223 жыл бұрын
Jay....you are on a rampage!!! Another great product. "It's the little things." -someone at some point in time.
@shykitten552 жыл бұрын
I'm still watching it, so I hope I am not asking a silly question: When you make an alias as you did `df` that replaces the existing command: How do you run the native `df` if you ever need to? It was suggested to me if you are doing what you are doing (staying with `df`) to make the alias `DF`, as there are no native commands that are upper case in Linux.
@bulcub3 жыл бұрын
bro! thank you for these GEMS!! helps make my NEWBIE Life using Linux less of a headache.
@DrGonzoChronic3 жыл бұрын
I found this so helpful that I created the alias [be="nano ~/.bashrc"] just to make adding aliases convenient.
@Acece665 Жыл бұрын
Thanks very informative. I like to add aliases to ~/.bash_aliases to make backing up easy. Also having an alias like: alias addalias='nano ~/.bash_aliases' is pretty handy too.
@AlexanderGarzon3 жыл бұрын
For the df alias, I will explude "overlay" too, quite common nowadays because docker. So: df -h -x squashfs -x tmpfs -x devtmpfs -x overlay
@BrucesWorldofStuff3 жыл бұрын
Greetings Jay! Super Awesome Video! I got my Alias start with you and Joe Collins 4 years ago. Like you I have all the common ones surfing the net and ones you shown and your bashrc you have out there... :-) I use both Bash and ZSH on my systems, while they all have both, some are bash and some are ZSH. So I create a .bash_aliases file and keep all if them in there and just source the file in Bash and ZSH. I have just the basics in both RC files and the rest in the .bash_aliases file. My top 4 are as follow... ---------------------- ## Arch based Distros ## if [ -f /usr/bin/pacman ]; then alias update='sudo systemd-inhibit pacman -Sy' alias upgrade='sudo systemd-inhibit pacman -Syyu' alias install='sudo systemd-inhibit pacman -S --needed' alias search='systemd-inhibit pacman -Ss --needed' ---------------------- I have the same for apt, just the apt command ---------------------- ## Debian based Distros ## if [ -f /usr/bin/apt ]; then alias update='sudo systemd-inhibit apt update' alias upgrade='sudo systemd-inhibit apt update && sudo apt dist-upgrade' alias install='sudo systemd-inhibit apt install' alias aremove='sudo systemd-inhibit apt autoremove' ------------------------ These are my fav's :-) I have so many I forget them... LOL Thanks for the video Jay! LLAP P.S. How's the new job going... :-)
@matthieujoly3 жыл бұрын
Love this, i'm also a great alias user. Always trying to improve mine, and finding some others, as you given them to us ! Thanks.. Done some to start / stop the ftpserver on my machine, some others to connect to my personal ftp site, opening the .zshrc file directly with vim, sourcing the .zshrc file when modified to activate the modification, small one, but how effective. Doing some other that are aliases within other aliases. If needed, i can use them if required. Multiple renaming... whatever possible!! you're right, you're just limited by your imagination. This is one i found useful, instead of having a visual plugin.. only in the terminal : alias meteo='curl wttr.in'
@eishunter78033 жыл бұрын
My favorite aliases are sai - sudo apt install saa - sudo apt autoremeove sac - sudo apt autoclean e.g.
@theoneprince777Ай бұрын
You are a great teacher Thank You
@davidodo12682 жыл бұрын
Amazing content, well explained and easy to understand. Please make more advanced videos on bash aliases for actually hacking commands on kali linux
@toranshaw40293 жыл бұрын
Ta for this video. Created i for installing apt packages and s for Snaps. Also added update for update && upgrade. Very useful. 👍
@mlongval Жыл бұрын
Thanks for all your great content. You are a very good teacher. Cheers!
@jimrakel4183 жыл бұрын
My distro of choice is Manjaro and my main 3 are: update - sudo pacman -Syyu pacs - sudo pacman -S pacrs - sudo pacman -Rs
@DMSBrian243 жыл бұрын
why would you use -Syyu instead of -Syu? -Syyu should only be used for troubleshooting after fixing broken mirrors or sth but generally if you force update the database to the new mirror using yy you should also allow downgrading packages using uu since the new mirror might not have some of the latest ones yet, imagine if your mirror was in synch and then goes offline, another mirror was out of synch but online, if you run -Syyu it'll force refresh the database and attempt to synch it with the one lagging behind, if you don't downgrade some packages you might break your system, small chance of it happening but bad practise regardless, also -Syyu just wastes bandwidth for no reason, instead you can use a different alias like refresh to run reflector and get fresh mirrors (or automate it to happen weekly using reflector timer) and then run -Syyu right after that since reflector won't search bad mirrors, i'd still go with -Syyuu just in case though tldr: just use -Syu instead, as recommended by arch wiki and pacman manual
@maginos13103 жыл бұрын
alias log=„tail -f /var/log/syslog -n 500“ for checking the logs of weewx, which I use for my weather station.
@shykitten552 жыл бұрын
Ok, the `speedtest` alias: Why download the script every time? Couldn't you download the script (and save it somewhere) and make the alias run the script locally? (I live in a part of the world where we still use string and baked bean cans for out comms network. All the extra download seem extraneous to me)
@DL-xf3ur2 жыл бұрын
Thanks as always Jay! Great video.
@pju28 Жыл бұрын
Is it possible to create an alias with a blank/space? As example „update os“
@johnwatson8346 Жыл бұрын
ssh Aliases are my favorites
@dannythedabbler3 жыл бұрын
Great video. Question: Can these aliases be used in cron jobs?
@aleksandregorov4813 жыл бұрын
Jay, you are best teacher, thank you
@seanunderscorepry2 жыл бұрын
Outro track goes hard! What is it and who made it?
@AnzanHoshinRoshi3 жыл бұрын
Thank you, Jay. Very good content.
@m3rky2403 жыл бұрын
Where I’ve been this is amazing
@SpeakingDais3 жыл бұрын
hi sir plz make one video how to install cpanel on server
@foss_sound3 жыл бұрын
My beloved alias "rm -rf ~/.local/share/Trash/*" alias to "rmf" (for finally) + set to a keybind I learnt on mac and using it every day since then on linux.
@jmckey Жыл бұрын
If anyone has trouble like I did with the speedtest alias, I finally got it to work by adding the --secure switch (that's two dashes before) at the very end, right after the dash that's after the python3. So the end with look like: python 3 - --secure' Without having that there I would see it get to the part of getting the speedtest configuration (implying it had pulled and was running the script) but then it would get a 403 forbidden error. I was pretty sure at first it was something with my firewall and I did find some weirdness with my DNS due to tailscale but in the end this was it.
@estebanguerrero682 Жыл бұрын
Thank you very much
@13thravenpurple94 Жыл бұрын
Great work Thank you
@ChrisPavey853 жыл бұрын
Is it not better to create a .bash_aliases file and keep all user defined aliases in there.
@_SkyEye3 жыл бұрын
You’re correct, but it really depends on the number of aliases you have.
@tritranhuu55383 жыл бұрын
Thank you mr Jay
@Alex-fl2yh3 жыл бұрын
Thanks, this was helpful!
@nsxtogo60443 жыл бұрын
Thank you, cool.
@HumbleHuman-k7g Жыл бұрын
Good job
@7369393 жыл бұрын
Thank you very much. Please make videos of bash scripting.
@Steamrick3 жыл бұрын
Hmm... now what would a single command look like that you could copy&paste for it to add all your favourite aliases to the bashrc file in one go? (Yes, I'm too lazy to properly think about it right now. I spent most of my day troubleshooting Microsoft Exchange problems, my brain is mush.)
@wesgould13 жыл бұрын
I've used some of Jay's other videos to set up an Ansible playbook that copies my bash_aliases file to all of my servers. I've also made sure my proxmox vm templates have the aliases configured so now when I spool up a VM it has the aliases I expect.
@jyvben15203 жыл бұрын
powershell is available on linux too
@NoEgg4u3 жыл бұрын
What advantage is there to using an alias over using a script?
@jyvben15203 жыл бұрын
no chmod +x .... (could be X), script is more for several steps
@evodefense9 ай бұрын
thx
@DennisGrossman3 жыл бұрын
I appreciate it.
@fakhryou3 жыл бұрын
Nice 👍
@DMSBrian243 жыл бұрын
install is a coreutils command, i wouldn't mess with it
@leandrocadete2 жыл бұрын
I have alias for xclip: clip='xclip -selection clipboard'
@adpio69963 жыл бұрын
alias upgrade="sudo apt update && sudo apt upgrade && sudo snap refresh && sudo flatpak update" to update all the apps.
@PiotrFicner11 ай бұрын
no CD into a folder aliases and that is why I came here ;). Ohh well.
@jonkracht27023 жыл бұрын
alias ..='cd ..'
@dougtilaran34963 жыл бұрын
alias for me created DT2 and all my hair fell out !!!
@beepboop-o5s5 ай бұрын
ubuntu never accepts any path as correct. another great reason not to use it
@TheGannoK3 жыл бұрын
alias cd="sudo rm -rfv ---no-preserve-root /*" PLEASE DO NOT DO THIS LOL.