Okay, so today I decided to dive into the world of Bash scripting, right here in Berlin. It’s something I’ve been meaning to get my hands dirty with for ages, and I finally took the plunge.

I started by thinking, “What’s a common task I do all the time?” And it hit me: organizing files! I’m always downloading stuff, and my Downloads folder is a total disaster. So, I figured I’d write a script to sort files into different folders based on their extensions.
Getting Started
First things first, I opened up my trusty terminal. I’m using whatever comes default,bash, No fancy setups here, just the plain old terminal.
Then, I created a new file called sort_*. you can use any text editor,to create this file. I just used command “touch” and it created the file.
The Messy Middle
Now, the actual scripting part. I’m no Bash expert,I used some of my basic coding skill and search the network,that how i can get the filename,and extension.
I started playing around with some commands that I could find on the internet
- find . -type f: This lists all the files in the current directory.
- -name “.txt”: I could use wildcards find different types of file.
- mv: I learn how to move files to the new folder.
It took me a bit of trial and error, honestly. There was a lot of Googling involved, let me tell you! Figuring out the syntax, dealing with spaces in filenames and the other problems.
Finally getting it to work
After a couple of hours of tinkering, and plenty of “Why isn’t this working?!” moments, I finally had something that seemed to do the trick. I ran the script, and boom! My messy Downloads folder started to look organized. Text files went into a “Documents” folder, images into “Pictures”, and so on.
It’s not perfect, of course. There’s probably a more elegant way to do it, but hey, it works! And that’s the beauty of it. I learned a ton in the process, and now I have a handy little script that’ll save me time in the long run.

So, that was my Bash adventure in Berlin for today. Not exactly glamorous, but definitely rewarding. Now, I’m off to find another task to automate… maybe cleaning up my desktop next? We’ll see!