Author Archives: Ahmed Tawfik

Unknown's avatar

About Ahmed Tawfik

Cybersecurity Professional, Systems Engineer, OSS & Linux Geek

How To Write Infinite Loop in Bash

This is how you create an infinite loop in bash to run a piece of code infinitely at defined intervals. #!/bin/bashwhile [ 1 ]do # Your code goes here # Modify sleep time (in seconds) as needed below sleep 2done … Continue reading

Tagged | Leave a comment

find files and copy them to a certain folder in bash (draft)

find . -name “*” | grep -i scomm | xargs ls -ltr | grep “Aug 13 10” | awk ‘{print $9}’ to use in the cp command (get the column number 9 which contains the file’s full path cp `find … Continue reading

Tagged , , | Leave a comment

How to search for a string inside multiple text files

find starting_folder -name “*” | grep -i file_name | xargs grep -i search_string for example: “find . -name “*” | grep -i hobba | xargs grep -i tito” searches for the string “tito” inside all files whose name contains the … Continue reading

Tagged , , | Leave a comment

How to search for a file using the "find" command in bash (not case sensitive)

find start_directory -name “*” | grep -i search_string e.g. “find . -name “*” | grep -i hobba” searches within the current directory and can return a file with name “aamr_HoBba.log” for example.

Tagged , | Leave a comment

An Introduction to linux Shell Scripting for DBAs, A Nice Tutorial by Oracle

I found this nice tutorial and would like to share it with you, it’s really useful: http://www.oracle.com/technology/pub/articles/saternos_scripting.html

Tagged , | Leave a comment