up-5p3llb00k

up-5p3llb00k

Simple Script to automate the updating process on Kali Linux

ยท

2 min read

Hello, my dear Nerd! Are you just starting to use Kali Linux and are feeling a bit tired already of having to be writing "sudo apt install" and all that jazz every single day? Wondering how the senior nerds manage every day without losing their minds?

Maybe is time to start automating your way before you get infected by not updating your system!

To domain the path of the Linux user first you need to learn to make laziness work for you. Why do you think nerds are so proud of being Linux users? Because they own their systems. Enough talk now, it's time to Bash๐Ÿฅ๐ŸŽต

Bash, short for "Bourne Again SHell" is a scripting language primarily used in Unix-like operating systems, including Linux. It provides a way to interact with the computer system through a text-based interface, executing commands and running scripts. With Bash, you can write small scripts to automate repetitive tasks in your daily computer usage. These scripts are essentially a series of commands and instructions that can be executed sequentially. By automating tasks, you can save time and effort.

They always start with a shebang ๐Ÿ’ฅ (or hashbang ๐Ÿ’ฅ๐Ÿ’ฅ )

bash #!/bin/bash

This line tells the system that the script should be interpreted and executed using the Bash shell, even if the default shell on the system is different. Including the shebang(๐Ÿ’ฅ) line is crucial because it allows you to execute the script directly, without explicitly specifying the interpreter. So now that you know all of this it's time for you to write your first script (it's very exciting, I know.)

Let's take those annoyers apt f****kers and bash them ๐Ÿฅ๐ŸŽต

Hit control+alt+t and type nano up.sh to open the BEST text editor (stay away from Vim users) and copy this.

#!/bin/bash
sudo apt update
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo apt autoclean -y && sudo apt autoremove -y

Control+X, save it and you are good to go. Now you want to give it executable permissions, for this, we are going to type chmod +x, and then you are going to bash your path, I'm not kidding.

Type $PATH to see the current value of your path and copy this beauty in one of the directories, for example:

sudo mv up.sh /usr/local/bin/up

And there you go! Now you don't have any excuse to don't update your system!

This is just a tiny example of what you can do, think about how you can apply this to your daily use, experiment and have fun!

ย