commit dd0b3e23f828c05f07c911c98d9ffc9737b3519e parent 687b24265f3f5f4b40d4d92b5e363d6985b27643 Author: pyratebeard <root@pyratebeard.net> Date: Fri, 11 Mar 2022 14:51:31 +0000 make_me_a_sandwich Diffstat:
A | entry/make_me_a_sandwich.md | | | 29 | +++++++++++++++++++++++++++++ |
1 file changed, 29 insertions(+), 0 deletions(-)
diff --git a/entry/make_me_a_sandwich.md b/entry/make_me_a_sandwich.md @@ -0,0 +1,29 @@ +#### TL;DR +Alias to allow aliases with `sudo` +``` +alias sudo='sudo ' +``` + +--- + +I am a big fan of using command aliases on my Linux systems. If you are too you may have also been hit by the `command not found` error when attempting to run `sudo <alias>`. + +As an example I have an alias for `ls`, which is based on the `ll` alias common on Red Hat systems +``` +alias ll='ls -lahF --color=auto' +``` + +If you try to run as sudo it won't work +``` +sudo ll +sudo: ll: command not found +``` + +We can change that by adding another alias +``` +alias sudo='sudo ' +``` + +Now we can run our aliases as sudo. + +Do you have any fun alias hacks?