Skip to main content

Posts

Showing posts from 2025

Reading uncommented line in Linux and Windows

Reading uncommented line is almost a daily live for most Linux and Windows Sys Admin. Uncommented in .conf or .ini lines are the active or the lines that are currently in used for the loaded configuration. In Linux, it's quite straight forward to do it using grep. grep ^[^#] service_file.conf The above command uses regex, to search for lines in the .conf file that doesn't start with #. In regex ^ means the first character, but if it is inside the brackets it has other meaning. It negates whatever character that follows. So, the regex means search the first character that doesn't start with #. Technically, it's teling grep to search for uncommented lines. Yes, the above solution is for Linux. How can we do it in Windows? Well, it turns out to be almost the same but with a little twist of course since its a different operating system. So, here's how we can do it in Windows. findstr /b /v ^# file.txt Hopefully, it makes life easier and the above commands...

Windows CLI grant Full access to a folder

icacls is a command line utility tool that allows system admin to grant or deny access permissions to a folder or path. Example below grants the user "TheAdminUser1" to the Desktop path specified below. icacls C:\Users\admin\Desktop /grant TheAdminUser1:F To check whether the permissions has been applied or not. cd to the path, like C:\Users\admin\Desktop, then type: icacls . . >> means the current path Once everything is ok a similar output like the image below will be shown, and there should be an "F" access list which means Full Access Permissions. If the output shows "successfully processed 1 files" and failed processes shows "0" files then permission has been applied without any issues. For more complex scenarios, and if the system has PowerShell cmdlets installed like Get-Acl and Set-Acl might offer more flexibility. Cast all your anxieties on him, for he cares about you. - 1 Peter 5:7 Don't let your heart b...