Streamline your Workflow: Automate project startup on Linux

Streamline your Workflow: Automate project startup on Linux

In Linux, you can automate the opening of your development environments using the rc.local file. This means that at startup, you can run all the necessary commands without having to click anything! ??

How to use rc.local to automate startup:


1- Open the terminal and edit (or create) the file with the follow command:

sudo nano /etc/rc.local        

Here I'm using nano, which is a simple text editor, but it needs to be installed (if it's not, use sudo apt install nano or switch to another editor like vi or gedit):


2- Add your commands. For example, to open Android Studio and projects in VS Code:

#!/bin/bash

# run android studio

/opt/android-studio/bin/studio.sh &

# open my apps on VSCode

cd ~/portfolio/my-first-saas

code . &

cd ~/portfolio/HostelApp

code . &

What does each part mean?

  • &: Puts the command in the background, allowing the script to continue executing the next commands without waiting for the previous one to finish.
  • cd: Changes the directory to where the project is located.
  • code . : Opens Visual Studio Code in the current directory (the . represents the directory you are in).


3- Make the rc.local file executable:

sudo chmod +x /etc/rc.local        


4- Restart the system

And that's it! The next time you boot up, all these commands will be executed automatically, saving you time and eliminating repetitive tasks. ??



Other automation options:

If you need more control, you can also use:

  • Cron with @reboot for simpler commands;
  • Systemd to set up custom services.

Who else is automating their workflow? Let’s share ideas! ??


#Automation #Linux #Ubuntu #Productivity #DevLife #DevTips #rcLocal #Development #VSCode #AndroidStudio

要查看或添加评论,请登录

社区洞察

其他会员也浏览了