Linux Shell Aliases: What You Need to Know

  Рет қаралды 37,981

tutoriaLinux

tutoriaLinux

Күн бұрын

Пікірлер: 36
@tobortine
@tobortine 8 жыл бұрын
Really good, I'd forgotten about alias. Have a safe journey home.
@elnurvalikhanli6783
@elnurvalikhanli6783 2 жыл бұрын
Enjoying your tutorials each and every time ! Good job dude.
@haydenc2742
@haydenc2742 7 жыл бұрын
I ALWAYS add ll="ls -lah" to my aliases...so easy to type ll for ls or dir Great video's LOVE it!
@josephturi
@josephturi 4 жыл бұрын
7:34 "However when I create a new shell it's gonna read that configuration file.. and lr will still not resolve to anything.. because everything must suck. Yep, sums up a typical day working as a software developer. : D
@mihaiprofir7
@mihaiprofir7 4 жыл бұрын
i did alias lr="ls -lra" then made sure that the current shell has the command alias stired with grepo and then did alias >> .bashrc , for kicks, as we learned in the previous videos, then i rememebered that i should be carefull while root
@mihaiprofir7
@mihaiprofir7 4 жыл бұрын
it would have been better to echo a few new lines with echo -e ' ' I think
@code7bit301
@code7bit301 4 жыл бұрын
Nice i was wondering how the command "ll" was always working in Mint distributions :) Thank you!
@juanvaldes7873
@juanvaldes7873 8 жыл бұрын
Thank you very much Dave. So, alias is similar to setting variables in let's say Python?
@tutoriaLinux
@tutoriaLinux 8 жыл бұрын
Essentially the same thing, yes!
@juanvaldes7873
@juanvaldes7873 8 жыл бұрын
Wonderful! Makes sense. Thank you
@ElliyahuRosha
@ElliyahuRosha 5 жыл бұрын
Awesome! Btw, how do u make the grep command to color your search red ? 10x
@mehdizineddine5402
@mehdizineddine5402 3 жыл бұрын
thank you for helping me understanding this cours
@bdf2718
@bdf2718 7 жыл бұрын
So why "alias | grep lr" and not "alias lr"? Your way spawns an extra process and requires more typing for (as far as I know) no gain. In fact your way can give false positives that have to be eliminated by inspection if, for example, you have aliased "balrog" to "xyz" or aliased "xyz" to "balrog".
@rdcpatches0
@rdcpatches0 6 жыл бұрын
This is pretty late, so I hope you sorted it out by now, but the reason he did "alias | grep lr" is beacause he was seeing if there was already an alias that was called lr so he wouldn't overwrite it with something else. What is happening in the command he typed is: "alias" alone will output all alias's created. We are going to take the ouput of "alias" and run through grep (which is what the "|" means) which will search for any instances of the string "lr" and print it below. Since there were no instances of "lr" nothing showed up, which I think is where the confusion came from since it just looks like a command was run.
@bucherregaldomi9084
@bucherregaldomi9084 5 жыл бұрын
@@rdcpatches0 I think you didn't understand what homie said, he means that with "alias" alone you can search, no need to grep tho, but cheers ma dude
@dipi71
@dipi71 7 жыл бұрын
My favorite aliases: ...='cd ../..'; d='cd ~/Desktop'; o='xdg-open'; psf='pstree -hA'; r='ruby -we'; top='htop'; and my longest one, for blanking the display from a console window: x='xlock -nolock -fontset fixed -erasedelay 0 -mode blank'. Cheers!
@sarahpes32
@sarahpes32 3 жыл бұрын
Thank You!!! that was very helpful
@HigherPlanes
@HigherPlanes 8 жыл бұрын
Aliases are a huge timesaver but I use them sparingly becuase I tend to forget my commands when I overdo it. BTW- what are your feeling on using functions which are supposedly better than aliases?
@tutoriaLinux
@tutoriaLinux 8 жыл бұрын
Agreed -- using too many aliases can get complicated. Functions and aliases each have their place -- in my opinion, different tools for different jobs. Aliases are for command shadowing, setting default arguments, and simple one-liners *AT MOST*. Any real logic should be encapsulated by a function.
@HigherPlanes
@HigherPlanes 8 жыл бұрын
I have aliases pretty much mastered lol, and eventhough I can't think of an immediate reason for using functions at the moment, I'd still like to learn more about them and how to use them. Maybe in future videos if you're feeling up to it you can do a tutorial =)
@qp2036
@qp2036 8 жыл бұрын
are you gone or will it be more videos coming?
@tutoriaLinux
@tutoriaLinux 8 жыл бұрын
Your wish is my command :-D kzbin.info/www/bejne/qH3Kg56ggpyUo9E -- it's been a crazy few months (big move, big new job, etc.) but things are a bit calmer now. More videos (and some podcasts) will be on the way in the next few weeks!
@qp2036
@qp2036 8 жыл бұрын
tutoriaLinux Oh wow thats great! thanks for the quality content
@charissebulan4298
@charissebulan4298 4 жыл бұрын
Thank you so much! ❤️
@nickyeoman
@nickyeoman 8 жыл бұрын
why did you do it in bashrc and not bash_aliases ?
@TaeruAlethea
@TaeruAlethea 8 жыл бұрын
Its probably because not all shells will have an alias file made. There was a comment in the bashrc file explaining how to make an alias file.
@tutoriaLinux
@tutoriaLinux 8 жыл бұрын
Couple of reasons: rc files are a lot more generic -- almost all shells have them, so teaching people to 'just use the shell rc file' is a case of 'minimal learning for maximum effectiveness in real life.' You can absolutely use the bash aliases file (which is specified in the bash rc file) -- it's not a bad idea or anything. However it's nice to confine all environment changes to as few files as possible, especially if you are working on a system with other sysadmins. Also, since for e.g. zsh I already split out zshenv, zshrc and zshrc.pre, I feel like if I have any more shell config files cluttering up my home directory, I'm going to lose my grip on sanity. Again, bash_aliases (or whatever aliases filepath you define in .bashrc) is fine. If you're just dealing with bash, it's perfectly fine to use that file.
@tutoriaLinux
@tutoriaLinux 8 жыл бұрын
Bingo! Nice.
@nickyeoman
@nickyeoman 8 жыл бұрын
Cool thanks.
@alextorres9408
@alextorres9408 7 жыл бұрын
trying to go to tutorialinux.com and getting "your connection is not secure". "SEC_ERROR_EXPIRED_CERTIFICATE"
@tutoriaLinux
@tutoriaLinux 7 жыл бұрын
Hey, thanks for letting me know! Looks like the letsencrypt cert renewal didn't work; should be all set now :-D. Whew! Appreciate that.
@tubeDude48
@tubeDude48 2 жыл бұрын
Aliases should be put in *.bash_aliases* "NOT" .bashrc !!
@tutoriaLinux
@tutoriaLinux 2 жыл бұрын
That’s the convention, but I like to keep shell configs (bashrc, zshrc) in git as a single file to make things clean. It hasn’t hurt anything yet, but I could be unintentionally causing a rift in the space time continuum. Is there a downside to using a single file per shell (for all shell config) that I’m not seeing?
@gravelman5789
@gravelman5789 6 жыл бұрын
Dude!!!! EVERYTHING MUST SUCK!!!! 😆😆😆😆 im makin a tee shirt !!!!! it will say that in the Front and the Back will say rm -R/.... 🤔🤔😉😉😆😆😂😂
@Steeldragon92
@Steeldragon92 8 жыл бұрын
You are funny, Dave ) I can be the same as you sometimes )
8 Basic lsof Commands Every Sysadmin Needs to Know
15:21
tutoriaLinux
Рет қаралды 168 М.
Everything You Need to Know About $PATH in Bash
9:31
tutoriaLinux
Рет қаралды 114 М.
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 48 МЛН
Seja Gentil com os Pequenos Animais 😿
00:20
Los Wagners
Рет қаралды 50 МЛН
Кәсіпқой бокс | Жәнібек Әлімханұлы - Андрей Михайлович
48:57
Archiving and Compression on Linux - Basic tar Commands
16:11
tutoriaLinux
Рет қаралды 64 М.
Bash Scripting 6 -- 'If' and Testing Explained
20:04
tutoriaLinux
Рет қаралды 58 М.
Linux Sysadmin Basics 04 -- Shell Features -- Pipes and Redirection
17:47
Linux Sysadmin Basics -- 7.1 Filesystem Layout
14:46
tutoriaLinux
Рет қаралды 91 М.
Bash Scripting 7: Functions and Course Review
11:44
tutoriaLinux
Рет қаралды 48 М.
Bash Scripting 5 -- Arguments
7:51
tutoriaLinux
Рет қаралды 74 М.
Bash Scripting 4 -- How Bash Scripts Work
12:00
tutoriaLinux
Рет қаралды 65 М.
Basic tmux Tutorial - Windows, Panes, and Sessions over SSH
11:24
tutoriaLinux
Рет қаралды 505 М.
Bash Scripting 3 -- Variables and Quoting
9:47
tutoriaLinux
Рет қаралды 61 М.
Linux Sysadmin Basics -- User Account Management
15:39
tutoriaLinux
Рет қаралды 176 М.