Want more awesome (imho) Linux content? Follow me on Mastodon: fosstodon.org/@thelinuxcast
@vladimir_fomin90 Жыл бұрын
ctrl + l = clear)))it's default
@joshua_lee732 Жыл бұрын
The best alias is YOLO which calls 'yay -Syyu'
@itsfkf6106 Жыл бұрын
Yeah 🤣
@rishirajsaikia1323 Жыл бұрын
Or just type "yay".
@mat_hmm Жыл бұрын
I once saw a meme or a forum post saying that a guy aliases 'sudo' to 'please' and the relationship with his computer became way more pleasant, so I did the same 😅
@MH_VOID Жыл бұрын
Ha I use 'plz' myself, for the memes and because it's shorter. It was probably like the first (and still probably like the second most used (probably only behind 'xa' - my go-to dir lister) alias I ever made :|
@StupidusMaximusTheFirst Жыл бұрын
hi there, the pwd clipboard trick is really clever and useful. don't fix it later though, it's not broken - it's this way so if for some reason pwd can't run successfully and you get an error, you don't get this into clipboard. you'll see this kind of tricks almost all over the place in configs, they're there for reasons. i liked some of your aliases, really cool, I'd use them myself, thx. and the alias to edit aliases is funny.
@maybeanonymous6846 Жыл бұрын
Here are my fish abbreviations: abbr "clr" "builtin history --clear && clear" abbr "l" "exa -l -a" abbr "la" "exa -a" abbr "ls" "exa" abbr "q" "exit" abbr "pacman" "sudo pacman" abbr "pacmna" "sudo pacman" abbr "pamcna" "sudo pacman" abbr "ga" "git add ." abbr "gcm" "git commit -m" abbr "gpu" "git push" The best things about git abbreviations is that when you actually enter the command they expand to the full command, so if you need to put it somewhere like on a help forum nobody will be confused.
@ringo8410 Жыл бұрын
Veronica Explains made a similar point about using aliases for ls. Exa is nice, but if you really want to learn Linux it can be good muscle memory to have to learn the -lah flags.
@afroceltduck Жыл бұрын
Oh I love aliases! I have one called scl (It's my "superclear"), which simply changes to my home directory and clears the screen. It's useful for when you don't need to be in a particular folder, and you just want a blank slate to make everything look neater. I also have eject aliased to eject -t. I understand why that isn't the default, but 99 percent of the time that's what I want it to do. Yes, I'm the weirdo who still has an optical drive. It's also nice to write little cheat sheets for yourself that you can alias to be viewed with less or whatever viewer you prefer. Speaking of which, I alias curl cheat dot sh to just 'cheat'.
@jamesyoung15111 ай бұрын
For Gentoo, I have an alias that perforrm all of the steps regarding compiling a kernel and modules and rebuild any packages that's needed related to the kernel. I used some of the aliases you listed from my Gentoo days. I also use aliases to shorten commands. I also use them for any custom script files I've written.
@bsdims Жыл бұрын
I have an alias I use to have espeak read my clipboard. I use it beyond a-ton, since I'm visually-impaired, and just prefer hearing over reading, especially longer stuff like articles and messages.
@toranshaw4029 Жыл бұрын
While watching this video I was able to create... uu='sudo apt update && sudo apt upgrade'... so ta for that time saver! 🙂 I also 'borrowed' the install one too!
@linuxdabbler Жыл бұрын
Oh and by the way, your NB video has inspired me to get a handle on all the notes that are littering my home directory... I wrote my own note script and I should have done this a long time ago... So thank you.
@dallenbaldwin3484 Жыл бұрын
i have my custom bash prompt, functions, and aliases saved in a git repo and source those as part of my installation setup script so I rarely go without my favorite alias is `alias \?=custom_functions` which runs a custom function to echo all the functions I've written in that repo. I terminate my bash prompt with `⌨| ?` so if I forget about it, at least I have the `?` to remind me
@anon_y_mousse Жыл бұрын
It's generally recommended for bash to use ~/.bash_aliases for aliases, but it's certainly not required. I put directories in variables so I can reach through them for various purposes, such as my ~/Games folder which is $g and my ~/Downloads folder which is $d. Tab complete through variables with directories is a must for me. I don't know if zsh can do that, but if so it might make it worth a look. For anything that takes more than one line, I like to put those in functions. I've got some directory listing functions that allow me to do more complex listings than `ls` allows which are pretty handy. I've got a function I've named ren5 that renames files with their md5sum but retains existing file extensions. Makes it a lot easier to organize some directories while retaining their ease of browsing from a GUI.
@salazar15545 ай бұрын
My main issue with the install alias despite its obvious convenience is that flatpak install 'name-of-program' would become flatpak sudo dnf install 'name-of-program' and depending on how it registers spaces the reinstall command would be messed up too. The same issue would occur with cargo install and pip install as well.
@JustWhyFFS Жыл бұрын
Oh I'm definitely adding that "cd.." alias. Adding a space to go up a directory usually kills my flow lol.
@matthieujoly Жыл бұрын
No issue with aliases.. As the "how it is build" is just a matter of reading the .whateverrc you are using. I do agree that you're so used to your aliases at the end of the day that to "not to" have them out there is a bit frustrating, still, you have it (in my case, I do) somewhere in the back of your head, that you need them, so… I do reconstruct them, done that at my job… it's also a way to put your memory @work. Furthermore, I also have aliases to gave me list alias that I use in some context.. That's also a way to remember, when you have a bit too much. Last thing : don't forget to save elsewhere your .rc file...
@benjacook3771 Жыл бұрын
Matt please try out the fish shell and its abbreviations (it has aliases too). For example you can type ga press space then it turns into "git add". This stops aliases from getting confusing ie if you change them a lot or forget about them.
@DanCanning Жыл бұрын
As always, thank you for this. Highly useful. I grabbed a few new ones from you. I absolutely love the sprint alias that you use. Termdown was a new package to me. The only change I made to your version was to switch it up to a function rather than an alias so I could vary the time.
@user-xb8lu5ph9o Жыл бұрын
All fedora users: fedora uses older (legacy) version of magick editor. You may install it and use with "convert ...."
@ewancox4895 Жыл бұрын
Some interesting ones listed. I also have all my aliases in a separate file which I source in my .zshrc file, it is indeed a clean way to do it. Similarly, I source another file which I called .ssh-servers which has aliases to ssh to all my web servers and local servers to save me remembering IP addresses and typing the path to the ssh key files (ie. alias ssh-webserver1='ssh -i /path/to/keyfile -p portnum user@12.34.56.78') which is very handy. A few of my favourites are; alias ..='cd ..' alias ...='cd ../..' alias sudo='sudo ' alias rootthunar='sudo thunar .' alias thunarhere='thunar .' alias mount='mount | column -t' alias scs='systemctl status' alias sce='sudo systemctl enable --now' alias scd='sudo systemctl disable --now' alias ipld='sudo ip link set down dev' alias iplu='sudo ip link set up dev'
@ewancox4895 Жыл бұрын
In case anyone is wondering, alias sudo='sudo ' basically enables aliases to work with sudo. There is a space after the sudo
@30p87 Жыл бұрын
python3 as py, it's just quicker sudo rm -rf as just rm, if I want to delete something, I want to have it just gone cp -r as cp, it's annoying to always forget that, and again, it doesn't hurt if it's not needed a little pip-update function sudo pacman as just pacman, i hate to be able to enter some commands as user and some not echo -ne '\033c' as clear, because urxvt doesn't clear srollback properly otherwise neofetch as function that decides between two flags of hyfetch randomly
@patomcio Жыл бұрын
Mine is "alias yes,doasisay!='sudo'". Great video btw
@chairman67 Жыл бұрын
Cool tips to be a terminal power user.. thanx.
@kevinklement2621 Жыл бұрын
The fact that your aliases file isn't alphabetized is setting off my OCD … but thanks for the suggestions!
@janbodnar7815 Жыл бұрын
These are some great tips. I am going to use the xclip and the termdown definitely! My must aliases are cls='clear' (because I use Windows sometimes and it drives me nuts when I use cls accidentally on Unix/Linux and it does not work) & c.='code .' I also use a bunch of devel aliases, for instance dn='_dotnet(){ dotnet new console -o "$1";}; _dotnet' for creating a new project in C#. As for the warning, I am very aware of that; that's why I never use aliases for installing/uninstalling and general OS maintenance.
@JimmyDRoberts Жыл бұрын
An alias for editing the alias file: alias ea='vim ~/.aliases && unalias -a && . ~/.aliases' This will reload your alias file once you close your editor. Change vim and the alias file name according to your preferences.
@OcteractSG Жыл бұрын
My most-used aliases are for yt-dlp to download podcasts. I made /tmp into a RAM disk and let the files download there without creating disk writes, and then I send them to my phone using the VLC app.
@MH_VOID Жыл бұрын
Oh yeah, it's a function for me (my goto is `dlvid() {yt-dlp -N 7 --embed-thumbnail --add-metadata --download-archive DOWNLOADED.txt --write-subs --embed-chapters --embed-info-json --no-clean-info-json --write-info-json --write-description --write-comments --sponsorblock-mark all --progress --console-title "$@" --live-from-start --prefer-free-formats --check-formats --audio-quality 0 --xattrs --embed-subs --write-auto-subs --audio-multistreams --video-multistreams --write-pages --write-link --write-playlist-metafiles --xattr-set-filesize --no-flat-playlist --no-mark-watched --write-thumbnail --format 'bestvideo+bestaudio' 2>&1 | tee -ap --output-error=exit output_log.txt}`). The problem with your approach is when you're downloading stuff that's so large/numerous that it would exhaust both RAM and the swapfile many, many times over
@OcteractSG Жыл бұрын
@@MH_VOID I have 32GB of RAM, and I get rid of the files on my PC once they reach my phone. It's a good system for me, but I recognize that it might not be ideal for everyone.
@omega3fatass61 Жыл бұрын
awesome
@salazar15545 ай бұрын
Yeah same I used it for songs and created alias mus-dl="yt-dlp --extract-audio --audio-format flac --audio-quality 0 --embed-metadata --embed-thumbnail" then I append whatever url I need
@13Wirrlicht42 Жыл бұрын
So c is one less keypress then c🤔 Anyways great video man😃
@topherfungus8424 Жыл бұрын
Your system already has a shortcut for vim, 'vi' ... it's a bit more portable because vi will work on most Unix-like systems
@TheLinuxCast Жыл бұрын
Clever. Would have been funnier if you'd said something about emacs though.
@topherfungus8424 Жыл бұрын
@@tuxdocs4736 Not on most of my systems. On Fedora it is a shell script that launches vim
@topherfungus8424 Жыл бұрын
@@tuxdocs4736 Are you serious? I use to use vi, that's why they made the shortcut, because people were used to using vi and never heard of vim
@TheLinuxCast Жыл бұрын
@@tuxdocs4736 I thought the original commentor was being funny. LOL
@GodIsTheReason Жыл бұрын
The "c" alias is actually not fewer keypresses than Ctrl+L, because you have to hit enter after the c too, haha ;)
@blackbeard3449 Жыл бұрын
For jumping to frequently visited directories, have you checked zoxide?
@BenjaminWheeler0510 Жыл бұрын
I use many of the same (or similar) ones for git, vim, and dnf! I used to use tmux a lot and made some easy keybinds to switch panes and stuff, but I’ve found that Kitty does tmux better than tmux lol
@etopowertwon Жыл бұрын
I've made mcd. (I typed too much of `mkdir foo` and `cd $_` in bash) and realiases ll to `ls -lh`. But other than that it's basically distro defaults. I wouldn't use `install` as it's used by install scripts(sometimes by make install) and I'm afraid one day I decide to debug them manually forgetting to disable aliases.
@MH_VOID Жыл бұрын
I have an "mcd" as well, but I use pushd instead of cd, since I often want to return to the previous directory, and then it becomes as simple as typing "po" (aliased to popd (also, pu is aliased to pushd)) to return there
@dannymendiola Жыл бұрын
For school we have to name all our main java classes "Driver", so I aliased "java" to "Adam" so I can run my code by typing Adam Driver
@vwagenjetta Жыл бұрын
Amazing.
@DarkGladiator Жыл бұрын
In school I dont even have IT :(
@coffeedude Жыл бұрын
Honestly my most used one must be: alias ..="cd .."
@attilasedon9593 Жыл бұрын
I added a few aliases to my setup's nix flake, and I am pretty proud of myself figuring out that you can use the variables given to the config file to be used in an alias with string extrapolation. lsd - similar to exa, nicer ls bat - nicer cat duf - nicer df dust - nicer du programs.zsh = { # ... shellAliases = { update = "sudo nixos-rebuild switch --flake '/home/${user}/Projects/configs-and-other/flake#${host.hostName}'"; ls = "lsd"; cat = "bat"; df = "duf"; du = "dust"; }; };
@stopspyingonme9210 Жыл бұрын
I use an alias called update that basically runs yay and flatpak in the same command
@denizkendirci Жыл бұрын
i have only two. alias l='ls -alF' alias ll='ls -a' damn, you even have aliases for typos.
@ChimeraX0401 Жыл бұрын
I have lots of alias on almost everything that I think are too long to type specially in mpv since most of the commands on mpv are quite long, like mpv-720p to make it output 720p or mpv-mems if I have to watch members only stream in youtube....
@MENTOKz Жыл бұрын
mad respect bro like your work on your zshrc
@ShimmerismYT Жыл бұрын
how do you make zsh have that autocorrect thingy (or command prediction idk what it's called) like how it is on fish?
@peterjantzer4767 Жыл бұрын
We don't "steal".... we "procure".
@gingered Жыл бұрын
I put aliases in $HOME/.aliases and sync it across workstations. Most common alias I use is _=sudo which I got from oh-my-zsh -- their d, 1, 2, 3, 4 and so on aliases are helpful.
@themroc8231 Жыл бұрын
Hey Matt, what Firewall do you use on fedora? You inspired me to try a Fedora minimal install, but I see you can't really install Gufw which is what I am used to unless you install two repos and even then turns out it doesn't build because it can't meet a Python dependency. So either I learn to use UFW on the command line or I learn to use firewalld, and I have been procrastinating ever since because honestly if there is one thing GUFW did right is it allowed me not to have to learn how to set a firewall, which is about the most boring thing I can think of.
@TheLinuxCast Жыл бұрын
Fedora comes with a firewall built in. That's why ufw doesn't work.
@Bruces-Eclectic-World Жыл бұрын
I see your using Tilix... What do you think of it? Is it working for you? For Bash & Zsh I have them both source my ~/.bash_aliases for all my aliases... One file for All! Lol I like to think of most of my aliases as Acquired from other places, stolen is such a strong word... 🤣 Arcolinux, Learn Linux TV, and other YTubers to be sure are a good source for aliases...I have made a bunch of my own too. Lol My fave is a alias functions that I made that reads what distro (Arch, Ubuntu and so on) that I am on and uses the update command for that distro with the alias of "update" " remove" " install"... Thanks Matt! LLAP 🖖
@MH_VOID Жыл бұрын
yeah stolen is incorrect because they're not actually losing it as you gain it - same thing as with people calling piracy theft What does "LLAP" mean, BTW?
@Bruces-Eclectic-World Жыл бұрын
@@MH_VOID I guess that would be right. No monetarily value was missing... 🤣 For many many years Leonard Nimoy signed all his papers, emails, posts with LLAP. Being a Star Trek fan I started using LLAP out of respect for Mr. Nimoy after his death and carry on the tradition. As for what it stand for... "Live Long And Prosper"... That was also Spock's famous saying in all the Tv shows and movies... :-) LLAP 🖖
@itsfkf6106 Жыл бұрын
I personally only use aliases for git, pacman and some alternative tools like exa and bat ....
@linuxdabbler Жыл бұрын
I do the same thing you do Matt. I source the same file in by zshrc and my bashrc. But one of mine is alias dangit='sudo !!' I always say it so why not type it. Lol
@TheLinuxCast Жыл бұрын
That's brilliant! I've thought about just putting in some aliases for commands where I always forget sudo, but that's probably not a good idea.
@linuxdabbler Жыл бұрын
I used to do it... And while it's not a best practice, the biggest drawback I have found is people calling you out on it when they see it in a video. Lol
@patpopov Жыл бұрын
My favourite alias - alias aptup="sudo nala update && sudo nala upgrade -y && flatpak update -y && deb-get update && deb-get upgrade -y"
@eriksiers Жыл бұрын
I don't really use aliases. I have in the past, but I find that I prefer shell scripts instead. And the only one I actually use on any sort of regular basis is a variation of the classic 'll': 'ls -Al --color=always'
@chyldstudios Жыл бұрын
I alias git to "g" and docker to "d".
@SvalbardSleeperDistrict Жыл бұрын
Super useful, thank you.
@ujjwal1800 Жыл бұрын
Nice explanation man.
@arthurpizza Жыл бұрын
People think the terminal is hard to use. I use the terminal because I'm lazy. 😂
@BenjaminWheeler0510 Жыл бұрын
if you don’t use zsh, alias r=!! is amazing
@vwagenjetta Жыл бұрын
I use alias update="yay -Syu --noconfirm && reboot" on my parents' laptop so they have an easy way to update the system when the arrow in the corner has a red dot on it. Much easier way to explain how and when to update the system to a couple of boomers. Do you know if there is a --noconfirm style flag for Flatpak that automatically selects default or Yes to any prompts during a flatpak update?
@patpopov Жыл бұрын
flatpak update -y
@vwagenjetta Жыл бұрын
Awesome, thanks
@gl0sek Жыл бұрын
Ok I have a question about aliases. I have a system with multiple users. I would like to have my aliases or environment variables to work on other users for example root. Is there a simple solution for this or my only option is linking every user account to my bashrc?
@vanadium4167 Жыл бұрын
Everything that goes in the systemwide /etc/bashrc file will be in effect for all users. Other shells than bash will have a similar systemwide config file.
@gl0sek Жыл бұрын
@@vanadium4167 ok that would set my aliases on all users. But what if now some other user would want to have his aliases on root user? I'm looking for a simple solution to export my own aliases to other users and vice versa. Can I switch to root with aliases left from normal user?
@vanadium4167 Жыл бұрын
@@gl0sek That is a different question than the one I answered. One account can have only one set of aliases but one could imagine a script to quickly change them.
@moneyfr Жыл бұрын
alias cat="bat" alias ls2="exa --icons -l -b -h --no-permissions --no-user -L=2 -T" alias ls="exa --icons -l -b -h --no-permissions --no-user" alias grep="rg" alias cd="z" alias fzf='fzf --preview 'bat --color=always --style=numbers --line-range=:500 {} alias hbstop='hblock -S none -D none '
@MH_VOID Жыл бұрын
for the second, I personally have the function "l2d" (nominally stands for "list to depth") as `{exa --binary -FTaL "$@" --color=always | bat --style=full}` - far more versatile and autopages so it doesnt fill many terminal screens
@themroc8231 Жыл бұрын
I think you forgot the most important: replacing "ncmpcpp" with "music", because f... that name.
@TheLinuxCast Жыл бұрын
Yeah I never have to type that out. I have a key binding for it. It just pops it up in a terminal or a scratch pad in my case.
@nnetheratic4440 Жыл бұрын
Wowwwwwwwwwwwwwwwww this is so usefull man..COOL
@allhasread Жыл бұрын
du=du -h yeet=pacman -Rsn ..=cd ..
@youtubealiens336 Жыл бұрын
This is the best video I've ever seen, hands down...🕳👨🦯
@plutorocks1 Жыл бұрын
Did you upgrade to kernel 6.1?
@MichaelWilliams-lr4mb Жыл бұрын
alias please="sudo" :D
@fredericoalves3169 Жыл бұрын
thanks! copied some of those! btw what color scheme is that on the terminal? cheers
@TheLinuxCast Жыл бұрын
Everforest
@keylanoslokj1806 Жыл бұрын
Hi good sir. Does trading on Binance website work in Linux?
@moneyfr Жыл бұрын
Could you teach us LUNARVIM
@Sqwert-g6h Жыл бұрын
It's just a pre-themed vim config.
@zeocamo Жыл бұрын
i alias .. to cd .. and ... to cd ../.. and .... to cd ../../.. and plz to sudo !! and e to $EDITOR a got a lot more, but this is the ones i use all the time
@0diyan Жыл бұрын
c=clear bye=exit sdn=shutdown now
@MH_VOID Жыл бұрын
"kys" > "sdn" :|
@lqlarry Жыл бұрын
I use fclist for "fc-list | rofi -dmenu -i' for finding font names. I don't use it much but when I need it, it;'s there. I like uppy for updating, inny for installing, se for searching. also, ez for 'nvim ~/.zshrc && source ~/.zshrc' Thanks for sharing.
@bitonchen Жыл бұрын
Can you please tell me The name of your terminal and how is it so beautiful
@TheLinuxCast Жыл бұрын
It's tilix and I use the everforest gtk theme.
@m4rt_ Жыл бұрын
ll for ls -lha
@moneyfr Жыл бұрын
**= sudo dnf update
@halamadrid5238 Жыл бұрын
Why is your aliases file a .txt file and not a .sh file?
@TheLinuxCast Жыл бұрын
because it's not a script
@halamadrid5238 Жыл бұрын
@@TheLinuxCast .sh just means it is a bash source file which your aliases are, it doesn't have to be a script. You don't have to make it executable
@TheLinuxCast Жыл бұрын
I'm aware of that, but all the .sh files on my system are scripts. So this one gets the .txt file because it's not a script. It'd just not fit in with the rest of my naming conventions.
@VictorMartins239 Жыл бұрын
You don't need to run "cd .." just ".." works zsh already comes with predefined git aliases pwd | xclip -sel clipboard works for me
@MH_VOID Жыл бұрын
just '..' only works if AUTO_CD is enabled in ZSH
@VictorMartins239 Жыл бұрын
@@MH_VOID never seen that config
@MH_VOID Жыл бұрын
@@VictorMartins239 it might be enabled by default. But you can confirm for yourself that that is what makes it work by doing `unsetopt autocd` (`unsetopt auto_cd` works too. In fact, it seems to take any number of underscores and is case insensitive), then trying `..` and it shouldn't work, then doing `setopt auto_cd` and trying again and now it should work again. You can also check if it's enabled already via `setopt | rg autocd` or similar (setopt without args lists all the enabled ZSH options (`unsetopt` without args lists all the disabled opts). rg (ripgrep) is basically a superior grep for most usecases IME)
@omarmagdy1075 Жыл бұрын
Something useful that I wish I did before is using fuzzy finder to hop between directories in the terminal It's just way better. I used to have an alias for every config file which got messy imho. so instead I have this function in my .zshrc and it finds all the files in my home directory and I can fuzzy find the directory I want to go to here is the function if anyone's interested. fcd() { local dir dir=$(find ~ -type d | fzf) if [[ -n $dir ]]; then cd "$dir" fi }
@MH_VOID Жыл бұрын
I am far more a user of functions than aliases (far more powerful, more correct since I specify in the function how many args (if any) it takes and where), but alias "xa" (=`exa -aF`) is by far my most used command period, "rd" (=`rmdir`) is nice, I also have a section to make sure to use binary and not those horrible horrible should-not-exist SI units (SI's 10^2 vs any sane person using binary's 2^10. BTW, drive manufacturers marketing all their stuff in SI units and therefore cheating you out of often even like 10% (!!!) total capacity of storage you buy is one of the most aggravating and widespread scams out there.) for those programs that unfortunately use SI units by default (this would also be like the only time I might use a global alias (besides truly drop-in replacements for stuff) - I really really hate SI units). I tried rm=`rm -I` and co but zsh automatically prompts me and I merely have to type without needing to press enter afterwards with ZSH's built-in version so I just use that instead of an explicit "-I". I also have and make frequent use of aliases pu=pushd, po=popd, gs=''git status', gp='git pull', gc='git clone', and cat='bat --paging=never' (don't use this much in favor of bat='bat --style=full'). My favorite alias is I guess "plz" (=`sudo` (and sudo itself is aliased to doas)). Those are pretty much all of my notable and commonly used aliases: everything else is (or really should be) a function instead - and boy do I have a lot of those. Oh and how can I forget nano, which is a function currently but was something like `nano -BC '~/BKP/nano_backups/' '-LlS!%_HPZikmqD'` (yes, I use a LOT of flags for it)
@itildude Жыл бұрын
ssh to my servers is a very handy use. Example ssshweb, sshmail, sshnas, etc.
@BenjaminWheeler0510 Жыл бұрын
You should check out ssh config files! They do this for you and more!
@itildude Жыл бұрын
@@BenjaminWheeler0510 Thank you, will do!
@moneyfr Жыл бұрын
key bind for ctrl* = alacritty -e sh -c "sudo paru -Syu --noconfirm && flatpak update -y"
@luizansounds Жыл бұрын
You inspired me to make one similar to this, i use bedrock Linux so updating all package managers+aur packages+ flatpaks is a small but annoying chore