creating an alias in ubuntu , in .profile

2019-04-14 12:24发布

I can't figure out why this simple alias isn't work. I've read online an example on creating it and don't know where I'm going wrong...

I've added the following to my .profile file at the bottom:

alias profile='sudo nano ~/.profile'

When I type in 'profile' in the terminal it says command not found...

I have a feeling this is a very very simple error I'm making.

Thanks everyone!

2条回答
小情绪 Triste *
2楼-- · 2019-04-14 12:29

What happens if you log out and back in?

Alternatively you could just type

source .profile

and that should activate your alias. Many people using bash set their aliases up in the .bashrc file.

查看更多
劳资没心,怎么记你
3楼-- · 2019-04-14 12:53

to add alias permanent you can edit ~/.bashrc and add alias to it

gedit ~/.bashrc

add alias at the end

alias update_linux='sudo apt-get update'

dont forget to refresh bashrc configuration.

source ~/.bashrc

for more details on creating alias you can read following blog: Codebucket

查看更多
登录 后发表回答