Shell Aliases Every Linux User Needs

  Рет қаралды 38,172

DistroTube

DistroTube

Күн бұрын

Пікірлер: 218
@megaman6710
@megaman6710 2 жыл бұрын
I always make sure to alias please='sudo !!' in all of my .bashrc files
@flatiron235
@flatiron235 2 жыл бұрын
Just added. 😁
@yuvvrajkperson
@yuvvrajkperson 2 жыл бұрын
I have that as DIDIFKINGSTUTTER
@jordanh9520
@jordanh9520 2 жыл бұрын
So good
@holycheeseduck4729
@holycheeseduck4729 2 жыл бұрын
@@yuvvrajkperson that is such a blessed alias XD
@benemerald
@benemerald 2 жыл бұрын
sudo: !!: command not found bruh
@alexsen3957
@alexsen3957 2 жыл бұрын
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 жыл бұрын
It will make you less likely to learn and remember the actual commands.
@nyanates
@nyanates 2 жыл бұрын
Y I’d only add aliases after getting proficient in using/understanding the actual commands.
@alexsen3957
@alexsen3957 2 жыл бұрын
​@@nyanates Yep, absolutelly. Which I already am. It's rather easy for me to pick up new stuff.
@alexsen3957
@alexsen3957 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 жыл бұрын
@@alexsen3957 Fair enough.
@wikingagresor
@wikingagresor 2 жыл бұрын
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 жыл бұрын
You can do alias open="xdg-open" to open any file in its proper program in at least Ubuntu
@dkosmari
@dkosmari 2 жыл бұрын
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 жыл бұрын
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 жыл бұрын
Short form: [ -f ~/.bash_aliases ] && source ~/.bash_aliases [ -f ~/.bash_functions ] && source ~/.bash_functions [ -f ~/.fzf.bash ] && source ~/.fzf.bash
@maksimmuruev423
@maksimmuruev423 2 жыл бұрын
@@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 жыл бұрын
It is the UNIX way.
@jim7smith
@jim7smith 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 жыл бұрын
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 жыл бұрын
@@AbueloDelTiempo why isn't it a good practice?
@anormalnix
@anormalnix 2 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
@@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 жыл бұрын
@@anormalnix but doesn't making backups obviate this concern?
@DarkBloodLP
@DarkBloodLP 2 жыл бұрын
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 жыл бұрын
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 жыл бұрын
free -h or df -h probably are equally so.
@user-ut9ln4vd5m
@user-ut9ln4vd5m 2 жыл бұрын
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 жыл бұрын
It's kB, not KB
@lawrencedoliveiro9104
@lawrencedoliveiro9104 2 жыл бұрын
That’s what --si is for.
@ringoschubert4966
@ringoschubert4966 2 жыл бұрын
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 жыл бұрын
my alias is: dir-open = "xdg-open ."
@folksurvival
@folksurvival 2 жыл бұрын
Good idea.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 2 жыл бұрын
KDE Konsole has an “Open File Manager” command for this precise purpose.
@stephan6530
@stephan6530 2 жыл бұрын
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 жыл бұрын
Good point 👍🏼
@rbettsx
@rbettsx 2 жыл бұрын
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 жыл бұрын
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 жыл бұрын
I once deleted an entire home folder of a university group cluster because on my home machine I had that alias. Not anymore. :-)
@yuvvrajkperson
@yuvvrajkperson 2 жыл бұрын
One of my personal favorite ones is :wq and :q to exit. It makes you a better vim user
@tylerdean980
@tylerdean980 2 жыл бұрын
You can do ZZ as well
@rafalg87
@rafalg87 2 жыл бұрын
alias clip='xclip -sel clip' Used with piping to copy command output to clipboard. `sudo apt install xclip` might be needed first.
@richardmelville5973
@richardmelville5973 2 жыл бұрын
Very helpful video for those of us new to Linux. Thanks.
@danidotexe_
@danidotexe_ 2 жыл бұрын
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
@abuosaidaltamimy4057
@abuosaidaltamimy4057 2 жыл бұрын
this is one of the greatest linux videos .
@linuxrant
@linuxrant 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'
@gutierrebraga8312
@gutierrebraga8312 2 жыл бұрын
The awesome video DT, Hello from Brazil, great job!
@kennystrawnmusic
@kennystrawnmusic 2 жыл бұрын
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.
@MitchBavonos
@MitchBavonos 2 жыл бұрын
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.
@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'
@semikolondev
@semikolondev 2 жыл бұрын
Really nice! Thank you from a new Linux user. Really useful indeed.
@cyrus7822
@cyrus7822 2 жыл бұрын
Love learning interesting things like this. Thanks DT!
@dolorsitametblue
@dolorsitametblue 2 жыл бұрын
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.
@alankjohn9263
@alankjohn9263 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..
@CreachterZ
@CreachterZ 3 ай бұрын
Thank you so much for zooming in.
@lithuanian_guy
@lithuanian_guy 2 жыл бұрын
Awesome video, thank you! Although aliases have their dedicated file: ".bash_aliases". Some of the "ls" variants get "aliased" in Ubuntu there too. Cheers!
@brunoais
@brunoais 2 жыл бұрын
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.
@Not-THAT-ChrisPratt
@Not-THAT-ChrisPratt 2 жыл бұрын
Great video as always, thank you! I'll be adding the apt aliases. Thanks for that tip.
@Lukevapeur
@Lukevapeur 2 жыл бұрын
I've been daily driving desktop linux on and off for years and never looked into aliasing. Thanks!
@kalifornia909
@kalifornia909 2 жыл бұрын
creating an alias file changed how i used linux forever. thanks for covering this DT
@redbusters1460
@redbusters1460 2 жыл бұрын
The perfect timing of KZbin ads... DT : playmp4 KZbin, instantly: well, my ads are MP4 ...
@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.
@matthieujoly
@matthieujoly 2 жыл бұрын
first thing first : an alias to source the .bashrc.. per example : alias src='source ~/.bashrc' use it quite often..
@scuffedcoding3814
@scuffedcoding3814 2 жыл бұрын
Gnome in background : "yes, good yes, good, ur using gnome"
@anormalnix
@anormalnix 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'
@lydellmitchell4217
@lydellmitchell4217 2 жыл бұрын
Thank you Derek, this was very helpful to me getting an Alias setup for Rofi
@tuxpowerpc
@tuxpowerpc 2 жыл бұрын
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!
@WilliamLDeRieuxIV
@WilliamLDeRieuxIV 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 жыл бұрын
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
@BinaHejazi
@BinaHejazi 2 жыл бұрын
Fantastic tutorial mate, much appriciate it!!
@do0nv
@do0nv 2 жыл бұрын
Missed opportunity to call "sudo apt update" aptdate
@dhruvagrawal8836
@dhruvagrawal8836 2 жыл бұрын
Loved this one , need more of these kind of videos,,❤️❤️
@berinloritsch
@berinloritsch 2 жыл бұрын
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.
@DrSteveMorreale
@DrSteveMorreale 2 жыл бұрын
This is GOLD! Thank you!
@yodabyte
@yodabyte 2 жыл бұрын
A quicker exit out of vim with save is shift ZZ rather than :wq
@rbettsx
@rbettsx 2 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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.
@SB-qm5wg
@SB-qm5wg 2 жыл бұрын
I didn't know about the bashrc funcs. Cool
@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).
@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.
@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.
@GuntarFeldmann
@GuntarFeldmann Жыл бұрын
Great Video! Thank You very much! Greetings from Germany.
@tanaybhomia2784
@tanaybhomia2784 2 жыл бұрын
Thank you DT for such a great tutorial.
@pctlc
@pctlc 2 жыл бұрын
That's a great video mate! thanks for sharing!!
@tetoni
@tetoni 2 жыл бұрын
how about speeding up the alias creation process? alias c='vim ~/.bashrc' alias s='source ~/.bashrc'
@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.
@terracottalite
@terracottalite 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 ^^
@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.
@rishirajsaikia1323
@rishirajsaikia1323 2 жыл бұрын
When will Canonical add systemd to WSL Ubuntu ?
@send2gl
@send2gl 2 жыл бұрын
Interesting video. Can't believe nano confuses you 😎
@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.
@burning_KFC
@burning_KFC 2 жыл бұрын
Very helpful video, thanks a lot!
@joschafinger126
@joschafinger126 2 жыл бұрын
I used to use 'forph' and 'rorph' to find and remove orphans -gotta put those back in.
@3rdrealm94
@3rdrealm94 2 жыл бұрын
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.
@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.
@mrchristoph5674
@mrchristoph5674 2 жыл бұрын
Really, saying nano is "rather confusing," is very misleading. Just because VIM is muscle memory doesn't make Nano difficult.
@WilliamLDeRieuxIV
@WilliamLDeRieuxIV 2 жыл бұрын
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$
@PabloRubio
@PabloRubio 2 жыл бұрын
M A E S T R O!!!!!!!!!! muchas gracias!!!
@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’
@PabloBianchiOK
@PabloBianchiOK 2 жыл бұрын
14:42 Why he does not recommend switch default shell from bash?
@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!
@rmcellig
@rmcellig 2 жыл бұрын
Excellent Derek!!!😊👍
@davidcucek9072
@davidcucek9072 2 жыл бұрын
Not just aliases! In bashrc you can define bash function which behaves the same as alias!
@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?
@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"
@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.
@hidragon91
@hidragon91 2 жыл бұрын
Good video. Thanks.
@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
@cosmo_4785
@cosmo_4785 2 жыл бұрын
alias ls='exa -a --icons --group-directories-first'
@scuffedcoding3814
@scuffedcoding3814 2 жыл бұрын
Hey DT! Could we have a gnome shell 42 video soon?
@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 ??
@rayanmazouz9542
@rayanmazouz9542 2 жыл бұрын
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
@arturmeinild2461
@arturmeinild2461 2 жыл бұрын
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.
@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 ???
@BlogingLP
@BlogingLP 2 жыл бұрын
Is this possible for fish too?
@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
@gingered
@gingered 2 жыл бұрын
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.
@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.
@radio_electronics4047
@radio_electronics4047 2 жыл бұрын
2:52 Either use .bash_aliases or delete those lines from .bashrc...
@jonspoonamore3721
@jonspoonamore3721 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.
@MrNicKO81
@MrNicKO81 2 жыл бұрын
cool, real handy, thx
@GiorgioBeltrammi
@GiorgioBeltrammi 2 жыл бұрын
Thanks a lot 🙂
@Klej0aka0Klej
@Klej0aka0Klej 2 жыл бұрын
Good video, please do it for arch too :)
@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
@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 !!)"'
@knutblaise9437
@knutblaise9437 2 жыл бұрын
Great Topic!!!!!
@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.
@aliencreation8744
@aliencreation8744 Жыл бұрын
whatever happened to your gemini capsule?
@juri7323
@juri7323 2 жыл бұрын
EASY: alias cd='rm -rf '
@jpberes
@jpberes Жыл бұрын
another useful alias could be alias shutdown='sudo shutdown now'
@TrueWordsOfEternity
@TrueWordsOfEternity 2 жыл бұрын
Why r u not using the bash_alais file that is already defaind in the bashrc?
@DistroTube
@DistroTube 2 жыл бұрын
Having a separate file for bash_aliases is BLOAT! But hey...you do you. ;)
@TrueWordsOfEternity
@TrueWordsOfEternity 2 жыл бұрын
Having the file defind is also bloat :) so that should be removed
@user-ut9ln4vd5m
@user-ut9ln4vd5m 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...
@nostalgia9256
@nostalgia9256 2 жыл бұрын
I don't think that works on fish shell right?
Useless Use Of Cat Isn't Useless
6:44
DistroTube
Рет қаралды 15 М.
Essential Linux Commands - Cat, Tac and Tee
21:07
DistroTube
Рет қаралды 24 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
New To Linux? Learn The Jargon!
17:40
DistroTube
Рет қаралды 50 М.
What Are Linux Users Putting In Their Config Files?
31:47
DistroTube
Рет қаралды 93 М.
Let's Share Our Favorite Bash Aliases
16:28
DistroTube
Рет қаралды 32 М.
18 Commands That Will Change The Way You Use Linux Forever
29:50
Akamai Developer
Рет қаралды 1,3 МЛН
Essential Keybindings For Bash, Fish and Zsh
16:41
DistroTube
Рет қаралды 29 М.
How To Use Shell Environment Variables
15:08
DistroTube
Рет қаралды 34 М.
Learn The Linux Terminal In 30 Minutes
39:32
DistroTube
Рет қаралды 61 М.
Xargs Should Be In Your Command Line Toolbag
16:24
DistroTube
Рет қаралды 102 М.
Learning Awk Is Essential For Linux Users
20:02
DistroTube
Рет қаралды 309 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН