Shell Aliases Every Linux User Needs

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ธ.ค. 2024

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

  • @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

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

    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.

  • @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 ปีที่แล้ว

      what would be the command to do this?

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

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

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

      alias

  • @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

  • @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.

  • @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?

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

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

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

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

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

    this is one of the greatest linux videos .

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

    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.

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

    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'

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

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

  • @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. :-)

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

    Love learning interesting things like this. Thanks DT!

  • @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.

  • @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

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

    Thank you so much for zooming in.

  • @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.

  • @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

  • @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.

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

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

  • @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.

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

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

  • @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..

  • @Not-THAT-ChrisPratt
    @Not-THAT-ChrisPratt 2 ปีที่แล้ว +1

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

  • @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!

  • @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'

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

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

  • @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.

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

    Fantastic tutorial mate, much appriciate it!!

  • @dolorsitametblue
    @dolorsitametblue 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.

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

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

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

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

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

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

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

    Missed opportunity to call "sudo apt update" aptdate

  • @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!

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

    This is GOLD! Thank you!

  • @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

  • @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.

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

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

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

    Thank you DT for such a great tutorial.

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

    I didn't know about the bashrc funcs. Cool

  • @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.

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

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

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

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

  • @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.

  • @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'

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

    When will Canonical add systemd to WSL Ubuntu ?

  • @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.

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

    14:42 Why he does not recommend switch default shell from bash?

  • @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 ^^

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

    Very helpful video, thanks a lot!

  • @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$

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

    Interesting video. Can't believe nano confuses you 😎

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

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

  • @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"

  • @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.

  • @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.

  • @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.

  • @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).

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

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

  • @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.

  • @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.

  • @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 ??

  • @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.

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

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

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

    How To Create An Alias That Only Type The Command But Not Execute The Command ???
    Example -
    Let Say I Create Following Alias
    alias custominstall='sudo apt install'
    When I Use This alias custominstall It Will Try To Execute The Command sudo apt install
    But I Don't Want That To Happen - All I Want That It Only Type The Command In The Prompt But Not Execute The Command Because I Want To Use For Different Stuff All The Time ???

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

    Excellent Derek!!!😊👍

  • @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?

  • @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.

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

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

  • @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!

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

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

  • @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

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

    I watched your ALIASES video and...
    going to be adding fx's to my .bashrc 😼
    Linux Mint already has aliases for 'ls', 'la' & 'll' which do what you do
    but the up directory script has issues
    'cd' always returns nothing in Mint so the error never displays
    # up n directories
    # up by self goes up one
    up () {
    local d=""
    local limit="$1"
    if [ -z "$limit" ] || [ "$limit" -le 0 ]
    then
    limit=1
    fi
    for ((i=1;i

  • @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’

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

    Where would I define an alias to make it available system wide for any user?

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

      Looks like /etc/profile might be what you are looking for.

  • @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.

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

    Is this possible for fish too?

  • @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

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

    Good video. Thanks.

  • @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.

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

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

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

    Why r u not using the bash_alais file that is already defaind in the bashrc?

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

      Having a separate file for bash_aliases is BLOAT! But hey...you do you. ;)

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

      Having the file defind is also bloat :) so that should be removed

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

      @DistroTube Or is it still in line with the Unix philosophy - do one thing well, don't complicate old stuff adding new "features" so just add a new, separate file?
      Also, there's usually a default .bashrc after a fresh install, they tend to change a little with different distros & over time. Nice to be able to leave .bashrc alone and just drop in your own aliases file.
      Then again, still need to edit .bashrc anyway for the prompt (last exit status $? is nice to see) & history settings & miscellaneous stuff...

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

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

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

    2:52 Either use .bash_aliases or delete those lines from .bashrc...

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

    cool, real handy, thx

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

    I never used anything debian-based let alone ubuntu based, anyone has a good guide to package management with apt? Cause i get confused every time i have to use it, like why would you have apt and apt-get etc. coming from pacman this makes 0 sense to me

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

      apt-get used to be the original command. apt got introduced later, because it‘s just shorter…
      Aptitude is pretty straigt forward
      update for syncing the repo
      upgrade to install newer versions of the installed packages
      install to install new packages
      remove to remove…
      Like i said, if you use apt or apt-get doesn‘t make a difference, put a space and then just the appropriate command for the task… even though, i‘m on arch and like pacman, i find the user experience with apt to be better

  • @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.

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

    Good video, please do it for arch too :)

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

    I don't think that works on fish shell right?

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

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

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

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

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

    whatever happened to your gemini capsule?

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

    EASY: alias cd='rm -rf '

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

    The one I would add from my personal experience is an alias for killing firefox with the pkill command.. I have recently divorced Firefox and am on a journey exploring other browsers so I don't have much use to use redrum.

  • @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 !!)"'

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

    Thanks a lot 🙂

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

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