Tag Archives: grep

Search for an AD user using PBIS and userid

Let’s say I have a user id in Linux 234234234 and I need to check which user that represents in Active Directory. All I need is: pbis enum-users | grep -B 5 -A 5 234234234 where: enum-users: returns all users … Continue reading

Posted in Linux, Uncategorized | Tagged , , | Leave a comment

How to delete all files in a folder EXCEPT certain ones in BASH

Imagine you have a folder that has about 20 files that you need and like 100 files that you don’t. In this case, there is a very simple bash script that allows you to do that in a jiffy! Here … Continue reading

Posted in Linux, Uncategorized | Tagged , , , | Leave a comment

Alternative way to find files with specific extension in a folder on Linux

If you don’t like the “find” command, you can use the following one instead (I prefer it myself): ls -R | grep “\.xml” where “-R” lists all recursively grep is used to filter filename “\.xml” you must put the “\” … Continue reading

Posted in Linux | Tagged , , , , | Leave a comment

Highlight your grep results

Used grep command before ?grep is a very good command that allows you to grep text 🙂It allows you to search the contents of a file/group of files for a string (regular expression) of course it is great, but the … 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