Scripting

Using PGrep

I often use grep in Windows and Linux to find text in files. I have noticed that grep only works on traditional text files with .txt, .c, .cpp, .list, etc extensions. It doesn’t work with Markdown and C# text files and I find this frustrating. I have found a parallel grep program in the Microsoft Learn code samples written by David Pine that overcomes the grep limitations. The thing that I really like about this program is that I can use regular expressions in the search text.

Creating a Root Password in Linux

I am used to gaining elevated privileges in Linux by adding sudo to a command e.g. sudo apt-get update I wanted to stay in elevated privileges so I went to login as root and realised that my normal Linux account didn’t have root privileges. I did some searching on the Internet and found that most versions of Linux disable the root account by default. I found that you can enable root by running the following command.

Changing the Linux Swapfile Size

I am having real problems keeping my ASUS netbook running. It doesn’t have enough specs to run a lightweight version of Linux. Increasing the size of the swapfile is supposed to improve the performance of low specced machines. I have worked out how to change the swapfile size in the hope that it may help. To check if you actually have a swapfile. swapon -s This will either return nothing or detail the swapfiles statistics.