Skip to main content
1. including the comment into the answer; 2. suggesting an acronym
Source Link
sudodus
  • 6.5k
  • 15
  • 27

I'm describing what to do in bash. I don't know zsh well enough to describe what to do there.

I think your problem is on the left side of the equal sign. Use a unique, short and easy to remember name for the alias (no spaces). Also there should be no spaces around the equal sign.

Otherwise it is easy to include sudo into an alias, just put it in the definition of the alias. I can show an example from my aliases in ~/.bashrc,

alias uc='sudo umount /dev/sdc*'

(to unmount all partitions on the drive /dev/sdc)


I might have suggested sv as the name of the alias, but there is a standard tool with that name, so maybe sev, acronym for 'sudo -E nvim', will work better.

I'm describing what to do in bash. I don't know zsh well enough to describe what to do there.

I think your problem is on the left side of the equal sign. Use a unique, short and easy to remember name for the alias (no spaces). Also there should be no spaces around the equal sign.

Otherwise it is easy to include sudo into an alias, just put it in the definition of the alias. I can show an example from my aliases in ~/.bashrc,

alias uc='sudo umount /dev/sdc*'

(to unmount all partitions on the drive /dev/sdc)

I'm describing what to do in bash. I don't know zsh well enough to describe what to do there.

I think your problem is on the left side of the equal sign. Use a unique, short and easy to remember name for the alias (no spaces). Also there should be no spaces around the equal sign.

Otherwise it is easy to include sudo into an alias, just put it in the definition of the alias. I can show an example from my aliases in ~/.bashrc,

alias uc='sudo umount /dev/sdc*'

(to unmount all partitions on the drive /dev/sdc)


I might have suggested sv as the name of the alias, but there is a standard tool with that name, so maybe sev, acronym for 'sudo -E nvim', will work better.

added 328 characters in body
Source Link
sudodus
  • 6.5k
  • 15
  • 27

ItI'm describing what to do in bash. I don't know zsh well enough to describe what to do there.

I think your problem is easyon the left side of the equal sign. Use a unique, just putshort and easy to remember name for the alias (no spaces). Also there should be no spaces around the equal sign.

Otherwise it is easy to include sudo into an alias, just put it in the definition of the alias. I can show an example from my aliases in ~/.bashrc,

alias uc='sudo umount /dev/sdc*'

(to unmount all partitions on the drive /dev/sdc)

It is easy, just put sudo in the definition of the alias. I can show an example from my aliases in ~/.bashrc

alias uc='sudo umount /dev/sdc*'

(to unmount all partitions on the drive /dev/sdc)

I'm describing what to do in bash. I don't know zsh well enough to describe what to do there.

I think your problem is on the left side of the equal sign. Use a unique, short and easy to remember name for the alias (no spaces). Also there should be no spaces around the equal sign.

Otherwise it is easy to include sudo into an alias, just put it in the definition of the alias. I can show an example from my aliases in ~/.bashrc,

alias uc='sudo umount /dev/sdc*'

(to unmount all partitions on the drive /dev/sdc)

edited body
Source Link
sudodus
  • 6.5k
  • 15
  • 27

It is easy, just put sudo in the definition of the alias. I can show an example from my aliases in ~/.bashrc

alias uc='sudo umount /dev/sdc?'sdc*'

(to unmount all partitions on the drive /dev/sdc)

It is easy, just put sudo in the definition of the alias. I can show an example from my aliases in ~/.bashrc

alias uc='sudo umount /dev/sdc?'

(to unmount all partitions on the drive /dev/sdc)

It is easy, just put sudo in the definition of the alias. I can show an example from my aliases in ~/.bashrc

alias uc='sudo umount /dev/sdc*'

(to unmount all partitions on the drive /dev/sdc)

Source Link
sudodus
  • 6.5k
  • 15
  • 27
Loading