This is good to test a file has enough permission to do read, write or execute operations. For a good…
Browsing: Bash Shell
In Linux, an empty file is a file that has a size of zero bytes. This means that the file…
Bash scripts are simple text files that contain a collection of commands. Bash scripts can help with administrative tasks, task…
Similar to for loop, while loop is also entry restricted loop. It means condition is checked before executing while loop.…
Loops are very useful for doing repetitive tasks for any programming language. For loops are also available for bash scripting.…
We can use an internal field separator (IFS) variable to parse an array. Let’s use an example script, where first…
Command SNAME=$(basename “$(test -L “$0” && readlink “$0” || echo “$0″)”) While running a bash script using Linux terminal the…
Command: md5sum myfile.php > myfile.php.md5 Above command will generate md5 checksum of file myfile.php and store in file myfile.php.md5. myfile.php.md5…
Command: echo <password> | passwd –stdin <username> Example: Use the following command to change password of user jack in a…
Command: while true;do echo “Press CTRL+C to Exit”; done Example 1: Some times we are required to execute some commands…