Tag Archives: grep

Search for files with certain size and extension

I was looking for a large PDF file that was above 100 MB. The file was inside thousands of other files and folders, so I used this command to find it: find . -type f -size +100M | grep -i … Continue reading

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

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