1

I need to make a script that on every login creates folder and subfolder, I have the script written but I don't know how to add it to /etc/profile.d I have tried to write in /etc/profile.d source /home/user1/script1.sh but don't know if this is correct.

  • Does this help you? https://askubuntu.com/questions/48321/how-do-i-start-applications-automatically-on-login – Umbertones Jan 04 '21 at 20:55

1 Answers1

3

Just drop the script in /etc/profile.d/. You can use mv: sudo mv ~/script.sh /etc/profile.d/

** Make sure the file ends with .sh

gorgo
  • 228
  • I use nano /etc/profile.d/ and then type mv ~/script.sh /etc/profile.d/ but when I try to save it, it says that /etc/profile.d/ is a directory that i cant write in it. Is this wrong what Im doing? – FancyPants General Jan 05 '21 at 20:29
  • You don't use nano. You enter the above commands as sudo in a shell. /etc/profile.d/ is a directory, not a file – gorgo Jan 06 '21 at 23:14
  • If this works, please select this as the awnser – gorgo Jan 08 '21 at 17:36