Member-only story
Re-Setup Your New Linux Or Mac System Just Like the Old One With a Single Command
Suppose you had a system with lots of software installed and many settings through the terminal (like Environment variables, .profile, .bashrc files, etc.). And, for some reason, you need to have the same environment in a new laptop or PC. In this article, we will see how you can create a single executable file for the same.
The executable file for the Linux
Every Linux terminal has bash, so you can create a file that uses bash to execute and ends with a “.sh” extension. Of course, there are other alternatives for bash, but let’s stick with it for now.
touch setup.sh
This will create the setup.sh file.
Now, let’s assume a scenario where you have to install the following programs:
- Python3
- chromium-browser
- vim
There can be some complicated settings like you have a .bashrc file saved somewhere, and you want to download it and place it in your home directory, which might look something like this.
wget "the/url/to/your/file"
mv fileYouJustDownloaded ~/
Then your setup.sh file will look like the following