loops in linux

loops in Linux shell scripts

Loops in Linux shell scripts is something you will inevitably face once writing more complex scenarios. They are nothing new for those who have at least some sort of programming experience, since they exist in pretty much any programming language. Loops are control structures to repeatedly execute a block of code as long as a specified condition is true. They are essential for automating repetitive tasks and processing large amounts of data efficiently. Since loops are a fundamental programming concept, they of course exist in bash (or any other shell).

Continue reading
bash check permissions

check ownership and permissions for absolute path easily

I couldn’t count times when asking someone to check permissions in Linux for some file I was given answer which was something like:

[root@linux ~]# ls -l /var/log/httpd/access_log
-rw-r--r-- 1 root root 17245040 Mar 13 13:38 /var/log/httpd/access_log
[root@linux ~]#

So all looks good – file is readable. But is it really?

Continue reading