0

I want to create an alias like cp, mv, and rm commands then somehow prompts the user for confirmation and store the commands in the bashrc file. how would I do this? do I just create an alias and then copy them or append them into the ~/.bashrc file?

1 Answers1

1

Yes, just copy the exact alias command like it was in the console, into the ~/.basrc file.

Remember that the new alias will take effect after you relaunch the terminal emulator (strictly speaking, the bash process).

Edit:

The obligatory link to the high-rated SO question on the topic.

Community
  • 1
  • 1
iksemyonov
  • 4,106
  • 1
  • 22
  • 42
  • tyvm, i have another question, how do i confirm that the aliases are exist in a console? I was able to use an aliases in gui mode, but in console, and it doesn't exist there.... – user5508084 Feb 08 '16 at 04:47
  • Issue the `alias` command without arguments to list all the existing aliases. – iksemyonov Feb 08 '16 at 04:50