Say you have a bunch of files and you want to quickly change or remove the file extension of all of them. Turns out that’s very simple to do with the command-line in Windows. I had no idea…
Will change all files with ‘old’ file extension to have the ‘new’ file extension.
Will remove the ‘old’ file extension.
Keep forgetting how to do this, so here it is. How to do a quick and simple, recursive search for text using
grep. Hint: It’s very simple.
That’s all there is to it!
grep is the command,
r makes the search recursive (i.e. in the target folder and all its sub-folders),
l means it will list the name of all the files where it finds the text,
"some text" is the string to search for, and finally, the dot at the end means to start the search in the current directory. And just to clarify, this searches for text inside of files, in the content of the files; not the filenames.
There, now I know where to find it when I forget it next time. And perhaps I have helped someone else too 🙂
Was on a Linux box today and I found the command prompt rather useless. It looked like this:
I know I’m using bash, and I don’t really care about the version. Or that I’m using bash actually… But anyways, to make it more useful you can run this:
You will then get a prompt which contains your username, hostname and current working directory. Much more useful in my opinion. If you have a different opinion, please share 🙂
You can find more stuff to put in your prompt by reading the prompting section of the bash man page.
This is just a little step-by-step guide for how you can open up an open an elevated Command Prompt under Windows 7 (and Windows Vista I think). That is, a Command Prompt with Administrator privileges which allows you to do more stuff than you usually can.
Continue reading How to open an elevated Command Prompt window
I’m a curious guy, so I wanted to see if there was anything interesting happening behind the Apple logo when the Mac I use at work boots up.
Turned out it was quite simple to enable and disable this feature. To enable it, just open up a Terminal and run the following command:
$ sudo nvram boot-args="-v"
When you reboot the next time, you will see all the fun stuff happening during the boot up. If you get tired of it, you can disable it again by running:
Had a tiny fight with Mac OS X the other day, like I often do. This time it was color labels. You probably know (if you have used Mac OS X at all) that you can color label your files. You simply right-click them in the Finder and select a color label.
This can be quite a handy feature, but not so much when it doesn’t work. My problem was that I would give a bunch of files color labels, but then shortly after that the label simply disappeared. I could look at the file in the Finder, it had its label, I’d click on it, and the label disappeared. In fact the color label was already gone, it was just that the Finder is kind of slow to update itself… O’ how I miss F5 sometimes…
Continue reading Disappearing color labels in Mac OS X
I am for the most part a Windows user. I was kind of moving towards Linux, Ubuntu in particular, but that ship pretty much sailed when I got my hands on Windows 7. Awesome, awesome operating system. But, I still have to use some Unix and Mac systems once in a while. And then there are certain commands that I often use, but always forget since it usually goes a bit of time between times I do it. So, what follows is basically just a list of commands that I keep forgetting, but keep having to look up again.
Continue reading Helpful Unix and Mac commands