Shell Aliases Every Linux User Needs

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ส.ค. 2024
  • One of the most common questions I get from new-to-Linux users is, "How can I become a power user?" Well, learning the terminal and the terminal commands is the best thing you can do. And big part of becoming more proficient at the command line is creating your own Bash aliases. So today, I'm taking a fresh install of Ubuntu and adding aliases to it's bashrc. These are aliases that I think most, if not all, Ubuntu users would find helpful.
    REFERENCED:
    ► gitlab.com/dwt1/dotfiles/-/bl... - DT's personal bashrc
    WANT TO SUPPORT THE CHANNEL?
    💰 Patreon: / distrotube
    💳 Paypal: www.paypal.com/cgi-bin/webscr...
    🛍️ Amazon: amzn.to/2RotFFi
    👕 Teespring: teespring.com/stores/distrotube
    DONATE CRYPTO:
    💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
    🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
    📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ
    SOCIAL PLATFORMS:
    🗨️ Mastodon: distrotoot.com/@derek
    👫 Reddit: / distrotube
    📽️ LBRY/Odysee: odysee.com/$/invite/@DistroTu...
    DT ON THE WEB:
    🕸️ Website: distrotube.com/
    🐿️ Gemini Capsule: gemini://distro.tube
    📁 GitLab: gitlab.com/dwt1
    FREE AND OPEN SOURCE SOFTWARE THAT I USE:
    🌐 Brave Browser - brave.com/dis872
    📽️ Open Broadcaster Software: obsproject.com/
    🎬 Kdenlive: kdenlive.org
    🎨 GIMP: www.gimp.org/
    🎵 Ardour: ardour.org/
    💻 VirtualBox: www.virtualbox.org/
    🗒️ Doom Emacs: github.com/hlissner/doom-emacs
    Your support is very much appreciated. Thanks, guys!
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 217

  • @megaman6710
    @megaman6710 2 ปีที่แล้ว +182

    I always make sure to alias please='sudo !!' in all of my .bashrc files

    • @flatiron235
      @flatiron235 2 ปีที่แล้ว +5

      Just added. 😁

    • @yuvvrajkperson
      @yuvvrajkperson 2 ปีที่แล้ว +31

      I have that as DIDIFKINGSTUTTER

    • @jordanh9520
      @jordanh9520 2 ปีที่แล้ว +1

      So good

    • @holycheeseduck4729
      @holycheeseduck4729 2 ปีที่แล้ว +1

      @@yuvvrajkperson that is such a blessed alias XD

    • @benemerald
      @benemerald 2 ปีที่แล้ว +4

      sudo: !!: command not found
      bruh

  • @wikingagresor
    @wikingagresor 2 ปีที่แล้ว +31

    The important thing to remember is when you forget your aliases, then type alias in the command prompt and it will print them all to you.

    • @teyathebirb8922
      @teyathebirb8922 7 หลายเดือนก่อน

      what would be the command to do this?

    • @wikingagresor
      @wikingagresor 7 หลายเดือนก่อน

      @@teyathebirb8922 you literally type 'alias' in the prompt to find what your shell aliases are...

    • @lucipher4082
      @lucipher4082 หลายเดือนก่อน

      alias

  • @alexsen3957
    @alexsen3957 2 ปีที่แล้ว +36

    As a new user to Linux for about 4 months, I've never actually thought about aliases. It's so interesting and saves a bunch of time. Thanks for the great content as always DT.

    • @folksurvival
      @folksurvival 2 ปีที่แล้ว +9

      It will make you less likely to learn and remember the actual commands.

    • @nyanates
      @nyanates 2 ปีที่แล้ว +5

      Y I’d only add aliases after getting proficient in using/understanding the actual commands.

    • @alexsen3957
      @alexsen3957 2 ปีที่แล้ว +2

      ​@@nyanates Yep, absolutelly. Which I already am. It's rather easy for me to pick up new stuff.

    • @alexsen3957
      @alexsen3957 2 ปีที่แล้ว +2

      ​@@folksurvival That's true, for a first day user. At this point I've completely mastered the shown commands already so it's not a big of a prob.

    • @folksurvival
      @folksurvival 2 ปีที่แล้ว +1

      @@alexsen3957 Fair enough.

  • @dkosmari
    @dkosmari 2 ปีที่แล้ว +40

    I prefer to keep the aliases in a dedicated file, `.bash_aliases`. In my `.bashrc` I have:
    if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
    fi
    Then in said `.bash_alises` I have all the alias lines.

    • @Phydoux2112
      @Phydoux2112 2 ปีที่แล้ว +7

      Those lines were plainly visible within the first couple minutes of the video. I'm surprised DT didn't go a little deeper into that in this video.

    • @guyboisvert66
      @guyboisvert66 2 ปีที่แล้ว +5

      Short form:
      [ -f ~/.bash_aliases ] && source ~/.bash_aliases
      [ -f ~/.bash_functions ] && source ~/.bash_functions
      [ -f ~/.fzf.bash ] && source ~/.fzf.bash

    • @maksimmuruev423
      @maksimmuruev423 2 ปีที่แล้ว +1

      @@Phydoux2112 yes you need just create a file .bash_aliases in home dir without touhcing package generated files. Which will be a good style

    • @SwitchxA
      @SwitchxA 2 ปีที่แล้ว +1

      It is the UNIX way.

    • @jim7smith
      @jim7smith 2 ปีที่แล้ว +2

      Yes, the biggest advantage is that you can cp .bash_aliases to multiple systems where you want them without duplicating the entire .bashrc file.

  • @caldersheagren
    @caldersheagren 2 ปีที่แล้ว +8

    You can do alias open="xdg-open" to open any file in its proper program in at least Ubuntu

  • @DarkBloodLP
    @DarkBloodLP 2 ปีที่แล้ว +6

    Seeing Ubuntu gnome makes me smile every time. I startet with ubuntu 11.04 because my pc back in the day sucked, but i wanted to play minecraft. It made the difference if i could run it or not. After a short while, i wanted to play with friends, so i started using the shell to setup the server.
    I was 11 back then, but my uncle (system admin) gave me all the informations i needed, to help myself.
    10 years later i‘m a successful software dev running arch. I would never ever use ubuntu on a desktop again, but still use it on some server. The nostalgia seeing the desktop environment is still overwhelming

  • @cluesagi
    @cluesagi 2 ปีที่แล้ว +28

    Something to watch out for when using the -h flag with ls is that it puts the human readable numbers in KiB, MiB etc. (units of 1024) instead of the KB, MB (units of 1000) you'll find elsewhere on the system. So a file's size will look different in the terminal with ls -h than it will in a graphical file manager

    • @mrkitty777
      @mrkitty777 2 ปีที่แล้ว +1

      free -h or df -h probably are equally so.

    • @user-ut9ln4vd5m
      @user-ut9ln4vd5m 2 ปีที่แล้ว +20

      KiB's (1024) are actually the standard, only hard drive manufacturers like using units of 1000, makes their drives look bigger than the actually are

    • @orisphera
      @orisphera 2 ปีที่แล้ว +1

      It's kB, not KB

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 2 ปีที่แล้ว +3

      That’s what --si is for.

  • @Phydoux2112
    @Phydoux2112 2 ปีที่แล้ว +70

    Since it's already there in the .bashrc, there's a much better way to organize the aliases by putting them into their own file altogether... ~/.bash_aliases. About 15 lines up in the video it's already directing .bashrc to use a .bash_aliases file. That's usually where I have my aliases and I don't have to disturb my .bashrc file with a bunch of aliases. I'm sure it loads the same way but the .bash_aliases is just really nice to have.
    New users will have to create that .bash_aliases file, I just checked to see if it comes with Ubuntu and it does not. I would think it would since it's already directed in the .bashrc file. But it isn't, so "touch .bash_aliases" in the /home directory would create that file from the command line. Just make sure you're in your home directory before you do that. Then just add the aliases into that .bash_aliases file instead of .bashrc and they'll work exactly the same. Seems kind of silly to have that directed in the .bashrc file and there's no .bash_aliases file there. I would think that for new users that would cause a mad hunt for .bash_aliases. Gotta LOVE Ubuntu!
    Great video BTW! I love the up directory stuff. I still learn things from watching your channel DT.

    • @cunjoz
      @cunjoz 2 ปีที่แล้ว +2

      @@AbueloDelTiempo why isn't it a good practice?

    • @anormalnix
      @anormalnix 2 ปีที่แล้ว +1

      @@cunjoz New users can easily mess up something. I think good practice is to backup file just before editing. I wrote scripts for backup files or folders on my own.

    • @cunjoz
      @cunjoz 2 ปีที่แล้ว +2

      @@anormalnix i was asking why wasn't it a good practice to store aliases in the bashrc rather than a separate file. if you're talking about backing files up, then that doesn't bear on that issue.

    • @anormalnix
      @anormalnix 2 ปีที่แล้ว +1

      @@cunjoz Answer for your question is in the first sentence. New users can completely accidentally change something in the .bashrc file, causing it to malfunction. This is the main reason why aliases should be kept in a separate file

    • @cunjoz
      @cunjoz 2 ปีที่แล้ว +1

      @@anormalnix but doesn't making backups obviate this concern?

  • @stephan6530
    @stephan6530 2 ปีที่แล้ว +46

    Confirmation aliases with the interactive flag (-i) is not a good idea if you often work with other Linux systems. It will cause you to become so accustomed to expecting an interactive prompt that once you do a 'rm' on a system without the confirmation alias, you will risk data loss. It is better to just get into the habit of specifying the '-i' flag explicitly for important files.

    • @Danielddiniz
      @Danielddiniz 2 ปีที่แล้ว +1

      Good point 👍🏼

    • @rbettsx
      @rbettsx 2 ปีที่แล้ว +1

      I'm probably missing something.. but if you have remembered to type 'i', you must just have asked yourself the same question as rm is about to ask you, again?

    • @leroyjs222
      @leroyjs222 2 ปีที่แล้ว

      Maybe just remember that you set an -i flag on those in your own bashrc and that’s not going to be the case when moving to other systems? Like Robin said, if you remember to type an interactive flag, you don’t really need it.

    • @kychemclass5850
      @kychemclass5850 2 ปีที่แล้ว +2

      This is one reason why I have avoided aliases so far as I know I will begin to forget some of the original commands and flags causing problems when I move to another linux computer. Of course I could just use the same aliases lists but maintenance of it all - would be more effort than just typing in a command when I need to run it.

    • @filipelqj
      @filipelqj 2 ปีที่แล้ว +2

      I once deleted an entire home folder of a university group cluster because on my home machine I had that alias. Not anymore. :-)

  • @MitchBavonos
    @MitchBavonos 2 ปีที่แล้ว +1

    Not aliases, but this is my favourite:
    bind '"\e[A": history-search-backward'
    bind '"\e[B": history-search-forward'
    -> type a few chars of a recent command, and then up arrow to get it pop up instantly.

  • @richardmelville5973
    @richardmelville5973 2 ปีที่แล้ว +2

    Very helpful video for those of us new to Linux. Thanks.

  • @yuvvrajkperson
    @yuvvrajkperson 2 ปีที่แล้ว +5

    One of my personal favorite ones is :wq and :q to exit. It makes you a better vim user

    • @tylerdean980
      @tylerdean980 2 ปีที่แล้ว +3

      You can do ZZ as well

  • @danidotexe_
    @danidotexe_ 2 ปีที่แล้ว +10

    just a heads up, dt: for ls, you can specify the -A flag *instead* of the -a flag to get all the files, but exclude the . and .. at the top. useful if you want to get a quick count of files in say nl

  • @ringoschubert4966
    @ringoschubert4966 2 ปีที่แล้ว +5

    I think a really useful feature is to open a graphical file manager in your current directory. My alias for this usecase is:
    alias fm='pcmanfm --new-win . 1>/dev/null 2>/dev/null &'

    • @Zedoy
      @Zedoy 2 ปีที่แล้ว +3

      my alias is: dir-open = "xdg-open ."

    • @folksurvival
      @folksurvival 2 ปีที่แล้ว +1

      Good idea.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 2 ปีที่แล้ว +1

      KDE Konsole has an “Open File Manager” command for this precise purpose.

  • @cyrus7822
    @cyrus7822 2 ปีที่แล้ว +1

    Love learning interesting things like this. Thanks DT!

  • @semikolondev
    @semikolondev 2 ปีที่แล้ว +4

    Really nice! Thank you from a new Linux user. Really useful indeed.

  • @12Q46HPRN
    @12Q46HPRN 2 ปีที่แล้ว +1

    Great video as always, thank you!
    I'll be adding the apt aliases. Thanks for that tip.

  • @alankjohn9263
    @alankjohn9263 2 ปีที่แล้ว +2

    i love these kind of videos!! I still remember downloading the noob to pro linux mint video it was the best thing I saw at that time I run arch with dwm now btw but you're the one who encourage to try everything in the first place demystified you could say..

  • @scuffedcoding3814
    @scuffedcoding3814 2 ปีที่แล้ว +2

    Gnome in background : "yes, good yes, good, ur using gnome"

  • @lydellmitchell4217
    @lydellmitchell4217 2 ปีที่แล้ว

    Thank you Derek, this was very helpful to me getting an Alias setup for Rofi

  • @lithuanian_guy
    @lithuanian_guy 2 ปีที่แล้ว +5

    Awesome video, thank you! Although aliases have their dedicated file: ".bash_aliases". Some of the "ls" variants get "aliased" in Ubuntu there too. Cheers!

  • @gutierrebraga8312
    @gutierrebraga8312 2 ปีที่แล้ว +3

    The awesome video DT, Hello from Brazil, great job!

  • @redbusters1460
    @redbusters1460 2 ปีที่แล้ว +1

    The perfect timing of TH-cam ads...
    DT : playmp4
    TH-cam, instantly: well, my ads are MP4 ...

  • @janAkaliKilo
    @janAkaliKilo 2 ปีที่แล้ว +3

    I think autocomplete is more important than aliases. 99% of commands I type is the commands I already typed before. With zsh or fish shell I could easily pull any long commands from history by just typing beginning of line + couple "UP" presses.

  • @BinaHejazi
    @BinaHejazi 2 ปีที่แล้ว

    Fantastic tutorial mate, much appriciate it!!

  • @kalifornia909
    @kalifornia909 2 ปีที่แล้ว

    creating an alias file changed how i used linux forever. thanks for covering this DT

  • @tuxpowerpc
    @tuxpowerpc 2 ปีที่แล้ว +1

    I absolutely love and appreciated this video Derek. I am now going down a bit of a rabit hole, but that's ok. This will certainly help me remember a lot less to perform the same functions being has I suffer from memory issues. hanks so much!

  • @abuosaidaltamimy4057
    @abuosaidaltamimy4057 2 ปีที่แล้ว +1

    this is one of the greatest linux videos .

  • @brunoais
    @brunoais 2 ปีที่แล้ว +1

    I don't often use aliases. More often I use bash functions (short ones but functions). I see them as more flexible, even if I have to type a little more.

  • @DrSteveMorreale
    @DrSteveMorreale 2 ปีที่แล้ว

    This is GOLD! Thank you!

  • @tanaybhomia2784
    @tanaybhomia2784 2 ปีที่แล้ว

    Thank you DT for such a great tutorial.

  • @pctlc
    @pctlc 2 ปีที่แล้ว

    That's a great video mate! thanks for sharing!!

  • @linuxrant
    @linuxrant ปีที่แล้ว +1

    I never wanted to learn not universal commands, but you showed that this could be really useful and fun (and by using my own bashrc I can make it "universal" for my system). I suppose at first I will alias all those xrandr commands I often use, like this:
    alias am='xrandr --auto'
    alias 1m='xrandr --output eDP1 --off'
    alias smirnoff='poweroff'
    alias romanoff='poweroff'
    alias davidoff='poweroff'
    alias shutthefuckup='poweroff'
    alias fu='poweroff'

  • @mrchristoph5674
    @mrchristoph5674 2 ปีที่แล้ว +4

    Really, saying nano is "rather confusing," is very misleading. Just because VIM is muscle memory doesn't make Nano difficult.

  • @dhruvagrawal8836
    @dhruvagrawal8836 2 ปีที่แล้ว +1

    Loved this one , need more of these kind of videos,,❤️❤️

  • @rbettsx
    @rbettsx 2 ปีที่แล้ว +18

    Personally, I don't think it's a great idea to cover ls, or other commands, with flags you just might want to vary.. I use ' ll ' for ls with my favorite flags. All the UNIX folks I worked with did the same.. almost a standard.

    • @Phydoux2112
      @Phydoux2112 2 ปีที่แล้ว +2

      I installed exa and I use - alias ls='exa -al --color=always --group-directories-first'. It really makes a nice and organized looking directory listing.

    • @wizard19891989
      @wizard19891989 2 ปีที่แล้ว

      @@Phydoux2112 I do allmost the same with exa. I have also aliased ext to exa with modified date sorting.

    • @joschafinger126
      @joschafinger126 2 ปีที่แล้ว

      @@Phydoux2112 Looks nice. However, I do think that replacing an existing command with a customised one in that way might indeed lead to confusion and breakage. Inventing your own commands this way might be wiser.

    • @folksurvival
      @folksurvival 2 ปีที่แล้ว

      The standard ls is one of the most useful commands so I definitely wouldn't want to alias it with a bunch of flags.

    • @kychemclass5850
      @kychemclass5850 2 ปีที่แล้ว +1

      The thing about that is, 'll' a NEW command, For noobs, remembering is the issue and remembering a new 'll' command is pretty much the same as remembering the switch on top of an already likely known command such as 'ls' What DT does here is quite clever as it uses the already remembered command command ls but just puts it into the more user friendly way with the common flags, although I personally wouldn't recommend this for noobs, but instead for those quite experienced with terminal commands.

  • @muddyexport5639
    @muddyexport5639 2 ปีที่แล้ว

    Great vid. Love the power of Aliases.
    My personal use:
    There was a reference in my .bashrc file for an .aliasesrc file that, if found, would execute the creation for all the aliases within that file. So all I had to do was modify that file without having to change the .bashrc file. I also have an alias for standard packages that will load all standard packages for Kubernetes, pycharm, bashtop, etc., etc. If I add another worker to my Kubernetes system the stdpkg alias will get that distro in operational agreement with the other workers with one command. Keeps my houses in order.
    Additionally, from my decades of coding on commercial iron, I find myself, out of habit, initially typing the command I used at work to do the task then stopping, erasing, and re-entering using the Linux command (old dog; new tricks syndrome). So I aliased my old commercial commands to use the Linux version. While this practice may aggravate the Linux purest -- I don't care. :~))
    Again, thanks and keep up the good work.

  • @burning_KFC
    @burning_KFC 2 ปีที่แล้ว

    Very helpful video, thanks a lot!

  • @kennystrawnmusic
    @kennystrawnmusic 2 ปีที่แล้ว +1

    My favorite has got to be “alias pacman=‘sudo pacman --noconfirm’ ” - yes, I actually have an alias to A, force the Arch/EndeavourOS package manager to run as root all the time, and B, make it always install stuff without confirmation, because, well, many times when you’re installing software you just want to get it over with.
    Making a video about systemd timers would be helpful as far as updates go, because that makes even the aliases for updating the system that you mentioned unnecessary by automatically running update commands in the background at specified intervals.

  • @rmcellig
    @rmcellig 2 ปีที่แล้ว

    Excellent Derek!!!😊👍

  • @name1355_0ne
    @name1355_0ne 2 ปีที่แล้ว

    The most commonly used:
    alias ls='ls --color=auto'
    alias ll='ls -alFX --group-directories-first --time-style=long-iso'
    alias saulu='sudo apt update && apt list --upgradable && sudo apt upgrade'
    alias untar='tar xvf'

  • @WilliamLDeRieuxIV
    @WilliamLDeRieuxIV 2 ปีที่แล้ว +2

    2:33 *nano is too confusing* ???
    I think it is more striaght forward than vim....all of the command-shortcuts are listed at the bottom of the terminal.
    ^K = Ctrl+K (cut line)
    ^U = Ctrl+U (uncut line)
    Both of those can be used to copy/paste multiple lines.
    Also two of the biggest ones (which is easier than vim):
    ^O = ctrl+O (write/save file)
    ^X = ctrl+X (exit)

    • @ribosomerocker
      @ribosomerocker 2 ปีที่แล้ว +1

      he finds it rather confusing - he is much more accustomed to vim keys and has built up muscle memory for them. it is going to be 1000 times easier for him just to use vim because of that

  • @SB-qm5wg
    @SB-qm5wg 2 ปีที่แล้ว

    I didn't know about the bashrc funcs. Cool

  • @matthieujoly
    @matthieujoly 2 ปีที่แล้ว +1

    first thing first : an alias to source the .bashrc.. per example : alias src='source ~/.bashrc' use it quite often..

  • @keithmiller9665
    @keithmiller9665 2 ปีที่แล้ว +1

    Nice video, thank you.

  • @do0nv
    @do0nv 2 ปีที่แล้ว +2

    Missed opportunity to call "sudo apt update" aptdate

  • @anormalnix
    @anormalnix 2 ปีที่แล้ว +2

    My favourite alias is for make dir and cd into it right away. I'm not using verbose (-v) flag when mkdir is used, but you can if you want to
    alias mcd='function _mcd(){ mkdir -p "$1"; cd "$1"; };_mcd'

  • @rafalg87
    @rafalg87 2 ปีที่แล้ว +1

    alias clip='xclip -sel clip'
    Used with piping to copy command output to clipboard.
    `sudo apt install xclip` might be needed first.

  • @Lukevapeur
    @Lukevapeur 2 ปีที่แล้ว

    I've been daily driving desktop linux on and off for years and never looked into aliasing. Thanks!

  • @GuntarFeldmann
    @GuntarFeldmann ปีที่แล้ว

    Great Video! Thank You very much! Greetings from Germany.

  • @hidragon91
    @hidragon91 2 ปีที่แล้ว +1

    Good video. Thanks.

  • @GiorgioBeltrammi
    @GiorgioBeltrammi 2 ปีที่แล้ว

    Thanks a lot 🙂

  • @killistan
    @killistan 2 ปีที่แล้ว +5

    I keep aliases in a separate file, ~/.localrc, and source from ~/.bashrc, ~/.zshrc, etc. Of course, if an alias only applies to a particular shell I still put it in the appropriate .*rc... Most of my aliases own are system specific, too; so I don't just overwrite my ~/.localrc when I update the rest of my *rc files. Some manual intervention required, but not enough to annoy me.

    • @TiagoJoaoSilva
      @TiagoJoaoSilva 2 ปีที่แล้ว

      It's on screen inside .bashrc! If there's a .bash_aliases source .bash_aliases! It's part of the default .bashrc!. Just put your aliases inside .bash_aliases.

  • @MrNicKO81
    @MrNicKO81 2 ปีที่แล้ว

    cool, real handy, thx

  • @send2gl
    @send2gl 2 ปีที่แล้ว +1

    Interesting video. Can't believe nano confuses you 😎

  • @jpberes
    @jpberes ปีที่แล้ว +1

    another useful alias could be alias shutdown='sudo shutdown now'

  • @knutblaise9437
    @knutblaise9437 2 ปีที่แล้ว

    Great Topic!!!!!

  • @thalhas9760
    @thalhas9760 2 ปีที่แล้ว

    Thank you

  • @yodabyte
    @yodabyte 2 ปีที่แล้ว +2

    A quicker exit out of vim with save is shift ZZ rather than :wq

  • @berinloritsch
    @berinloritsch 2 ปีที่แล้ว +1

    At 2:52 you see that the Ubuntu team has a reference to load aliases from a ~/.bash_aliases file. That will be loaded it exists and also keeps it nice and tidy. Just another way of handling that. I incorporated some of your aliases that way. I'm running Pop! OS, which we know is based on Ubuntu.

  • @arturmeinild2461
    @arturmeinild2461 2 ปีที่แล้ว +1

    3 minutes in you say it doesn't matter if you use single or double quotes. It DOES in fact matter, as the normal rules for single and double quotes apply. If there is a variable in the alias, double quotes will expand the variable when the alias is set. On the other hand, single quotes will preserve the variable name, and expand when the alias is run.

  • @QuarKSonTV
    @QuarKSonTV 2 ปีที่แล้ว

    good examples

  • @Klej0aka0Klej
    @Klej0aka0Klej 2 ปีที่แล้ว +1

    Good video, please do it for arch too :)

  • @3rdrealm94
    @3rdrealm94 2 ปีที่แล้ว +1

    Hey DT, can you take a look at the Penrose X11 library? It's basically a template to create a window manager, written in Rust.

  • @PabloRubio
    @PabloRubio 2 ปีที่แล้ว +1

    M A E S T R O!!!!!!!!!! muchas gracias!!!

  • @joschafinger126
    @joschafinger126 2 ปีที่แล้ว

    I used to use 'forph' and 'rorph' to find and remove orphans -gotta put those back in.

  • @qedqubit
    @qedqubit 2 ปีที่แล้ว

    THANKS :-D !

  • @phonewithoutquestion80
    @phonewithoutquestion80 2 ปีที่แล้ว

    I always have aliases as lazy shortcuts for config files, I call this act "summoning the figs" and it makes my life easier.

    • @folksurvival
      @folksurvival 2 ปีที่แล้ว

      What are your aliases?

  • @YannMetalhead
    @YannMetalhead 2 ปีที่แล้ว

    Good video.

  • @bahathir_
    @bahathir_ 2 ปีที่แล้ว

    I prefer to add any aliases or environment variables in ~/.profile .
    It is much easier to backup/restore settings/configurations. IMHO.
    Thank you.

  • @rayanmazouz9542
    @rayanmazouz9542 2 ปีที่แล้ว +1

    Hey i realized you never made a video about clear Linux, it would be cool to take a look at it, I really like the stateless design. I'm using it for my home server, it sucks that it's made by intel though

  • @chudchadanstud
    @chudchadanstud 2 ปีที่แล้ว +1

    >finds nano confusing
    >installs vim instead
    old man, you've lost more than just your hair

  • @mikechappell4156
    @mikechappell4156 2 ปีที่แล้ว

    If you are going to have an excessive amount of aliases, I'd create a separate file. It also makes it easier to share among different shells. I use ~/.aliases, and include in my .bashrc:
    [ -f ~/.aliases ] && source .aliases # I prefer ". aliases", but I'm not sure how well that will post.
    Some may prefer to bury it under ~/.local/config, but I started using Linux before FHS 3.0 was adopted.
    It also has the benefit of not duplicating items in my PATH, greetings or other things I may include in my .bashrc by simply typing ". aliases" as opposed to ". .bashrc".
    If you want to create the .aliases file easily you can simply type "alias>.aliases" to create it.

  • @cosmo_4785
    @cosmo_4785 2 ปีที่แล้ว +1

    alias ls='exa -a --icons --group-directories-first'

  • @gwgux
    @gwgux 2 ปีที่แล้ว

    An alias I recommend all new Linux users use while they are learning the terminal:
    empdir='rm -ir ./*'
    To empty out the current directory of any files and sub directories, but don't ever run it while you're at root (/). It's a safeguard to make sure you put the leading . before the / under a different name so you avoid running rm -rf /* when you're tired late at night working on something and not seeing straight. At work it can be a resume generating event. At home, all your precious "educational videos" will be done with your PC. ;)
    I personally mostly use aliases for some safeguards, customizing the format of command output (like the ls='ls-lah' example), and for calling scripts with some of the required arguments filled in from my dedicated script directory on the system (I generally try to avoid updating the PATH variable when I can).

  • @jonspoonamore3721
    @jonspoonamore3721 2 ปีที่แล้ว +2

    Old System/Network Admin here..... I live and die by Aliases!!!! In fact.... I do most of my Bash Scripting via Aliases. I only create normal scripts for system events. I keep most of my Scripts in 1 Aliases File and that file is activated in every terminal via the ".bashrc" file. Over the years, my Aliases File has gotten pretty big. I just find it extremely easy to maintain my Bash Scripts via 1 file instead of 100's of individual script files. I keep a copy of this file in a Cloud Account in case I need it on another system.

  • @davidcucek9072
    @davidcucek9072 2 ปีที่แล้ว

    Not just aliases! In bashrc you can define bash function which behaves the same as alias!

  • @itsfish8672
    @itsfish8672 2 ปีที่แล้ว

    Hi Dt, I even alias my aliases so i have a list on hand.

  • @gingered
    @gingered 2 ปีที่แล้ว +1

    alias _=sudo is great, I wouldn't do the systemctl alias as you may want to systemctl enable foo.service --user if you want it to not run as root.

  • @bedtime285
    @bedtime285 2 ปีที่แล้ว +1

    nice

  • @tetoni
    @tetoni 2 ปีที่แล้ว +1

    how about speeding up the alias creation process?
    alias c='vim ~/.bashrc'
    alias s='source ~/.bashrc'

  • @kychemclass5850
    @kychemclass5850 2 ปีที่แล้ว

    Thanks DT. This touches on something I'd love to do but I'm still a bit to new to Linux to know how to do it.
    Hardware device variants I have to swap out frequently change their "xrandr" name and their "xinput" id number.
    To get them to work properly, I have to manually run the command...
    xinput map-to-output
    Anyone know how I can automate the process via an alias triggered by a user alias, say, "gset"
    which runs xrandr, reads the name of the HDMI device, then runs the xinput command and reads the relevant id number
    then proceeds to run the command xinput map-to-output

  • @keithpowersOvid-NY
    @keithpowersOvid-NY 2 ปีที่แล้ว

    While watching I opened up my .bashrc file and discovered this if statement
    # if [ -f ~/.bash_aliases ]; then
    # . ~/.bash_aliases
    # fi
    # I added the comment hashtags
    So I created a .bash_aliases file. The advantages are I don't modify the original, and my aliases are portable and if necessary temporarily.
    While playing with this I discovered the double quote >"< does not always work. when I changed it to a single quote >'< the syntax error was fixed so I would recommend using the single quote.

  • @terracottalite
    @terracottalite 2 ปีที่แล้ว +2

    20:30 Is it just me that always uses the -fr flags when doing rm.

    • @TomeOfKnowledge74
      @TomeOfKnowledge74 2 ปีที่แล้ว

      I'd say that's the opposite of responsible.

    • @DarkBloodLP
      @DarkBloodLP 2 ปีที่แล้ว

      Don‘t know, if i would alias that, but i fell you ^^

  • @scuffedcoding3814
    @scuffedcoding3814 2 ปีที่แล้ว

    Hey DT! Could we have a gnome shell 42 video soon?

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 2 ปีที่แล้ว

    I keep an Emacs session running all the time, and use the following alias to edit files:
    alias e='emacsclient -n'
    That lets me type, in any terminal window
    e «filename›
    to open «filename» in my Emacs session.

  • @brunoais
    @brunoais 2 ปีที่แล้ว

    What I have for apt update and apt upgrade is a compiled C program with setuid so I don't need to type my password for a routine work.

  • @billfarley9015
    @billfarley9015 2 ปีที่แล้ว

    I use Linux Mint and use the Update Manager instead of the terminal so I presume I don't need it. Is there any reason to use the terminal command for update and upgrade? I do have plans for other aliases though.

  • @brunoais
    @brunoais 2 ปีที่แล้ว

    3:06 I usually just type me aliases in the ~/.bash_aliases instead. If the source for that file isn't in the ~/.bashrc, I make one.

  • @FalcoGer
    @FalcoGer 2 ปีที่แล้ว

    You think of commands you often run in the terminal and you come up with "using the package manager"? I do that once a day to do an update. Do you know how often I run "ls", "cd", "rm", "mkdir" or "vim"? Besides that I just write "sudo apt" and my shell proposes autocomplete "sudo apt update && sudo apt upgrade"

  • @sonupandey977
    @sonupandey977 2 ปีที่แล้ว

    Can someone help me with the Xrandr problem in arch linux I always have to do it again and again when I start my system isn't there any way to do it automatically in startup ??

  • @ashleymavericks
    @ashleymavericks 2 ปีที่แล้ว

    Using "please" as an alias for adding sudo to previous commands is neat, but 'sudo !!' might not work as expected, shell can take !! literally, thus try using, alias please='sudo "$BASH" -c "$(history -p !!)"'

  • @WilliamLDeRieuxIV
    @WilliamLDeRieuxIV 2 ปีที่แล้ว +1

    12:04 Changing to parent directories....
    Could use the *bd* command with custom aliases (or shell functions) for this to allow
    chaning into a parent directory just by giving one or more characters and will it change into the first parent directory starting with 'h'.
    Need to instal bd via $ sudo apt-get install bd
    I also have a custom action scrpt used with thunar (using bd) to change into sub-directories of a parent folder.
    #### put in ..bashrc
    function bd() {
    bd_dir=$(/usr/bin/bd -si $@)
    if [ "$bd_dir" != "No such occurrence." ] ; then
    echo "$bd_dir"
    fi
    }
    function bdc() {
    bd_dir=$(bd $@)
    if [ "$bd_dir" != "" ] ; then
    cd "$bd_dir"
    fi
    }
    ####
    # a primitive example (but you can imagine being 10 directories in and instanstly going to a parent with a single letter)
    user@host:~$ bdc h
    user@host:/home$

  • @blogattacker
    @blogattacker 2 ปีที่แล้ว

    Sometimes I think DT does all his things in a Virtual Machine, even Ubuntu?, don't you have a spare computer to install clean linux distros?. Four screens and just one computer?, come on DT, we need the full experience

    • @DarkBloodLP
      @DarkBloodLP 2 ปีที่แล้ว

      I think, there are two main reasons for his approach:
      1. setting up a vm is faster
      2. recording of the vm is easier, his recording software and audio equipment is already set up on the host, he can simply record the spice session

  • @ArizonaJewell
    @ArizonaJewell 2 ปีที่แล้ว

    I always alias “yeet” to the command to remove a package and all its dependencies, lol. I use the paru AUR helper, so on my machine it’s:
    alias yeet=‘paru -Rns’

  • @HoldFastFilms
    @HoldFastFilms 2 ปีที่แล้ว

    Only hard requirement for me is clr=‘clear’. Can’t use bash without it.

    • @PlutoniumJesus
      @PlutoniumJesus 2 ปีที่แล้ว

      For bash you can use ctrl+l (lowercase L) instead. Faster to type and no need for an alias!

  • @juri7323
    @juri7323 2 ปีที่แล้ว +1

    EASY: alias cd='rm -rf '

  • @marconiandcheese7258
    @marconiandcheese7258 2 ปีที่แล้ว

    I actually make a second file .bash_aliases which is where all my aliases are at and reference it in my bashrc

  • @enissay9950
    @enissay9950 2 ปีที่แล้ว +1

    Man, awesome video as usual, BUT it is irresponsible to send us to your repo which contains million aliases unguided!! Please make a follow up video, maybe to discuss comments here and go through your own bachrc, no need to try all commands, but explain all
    Thanks again

  • @rishirajsaikia1323
    @rishirajsaikia1323 2 ปีที่แล้ว +1

    When will Canonical add systemd to WSL Ubuntu ?