Tag: grep

Find files of a specific mime-type

Use this command to find files of a given mime-type. In this example, we are looking for video files… find…

Optimized Grep Searching

Grep that searches recursively, ignores binary files, and doesn’t look inside Subversion hidden folders. grep -Ir –exclude=”*\.svn*” “pattern” *

Fish Shell Command History Meme

Use this command if you want to know your command usage stats in the fish shell. grep -v “^\#” “.config/fish/fish_history”|awk…

Grep using Sed

View only lines that contain the word “string” sed -n ‘/string/p’

Seach for a String in a Folder using grep

Search string “test_text” at directory ‘/var/log’ and below grep test_text -R /var/log/*

Graphical representation of sub-directories

This command shows a graphical representation of the current sub-directories. ls -R | grep “:” | sed -e ‘s/://’ -e…

Recursive Grep

Recursively check a folder to find the given text using grep grep -R “text” *

Pid Command

Create a command that will return the pid of the given command string.. #!/bin/sh ps aux|grep 1|head -n1|awk ‘{print2}’

Sensex Figure using a Linux Command

This one command will fetch and display the latest sensex figure in Linux. This command basically downloads a page, locates…

Search Text in a Folder using grep

Search for a specific text in a folder using grep grep “fetchFeedPacksCustomize()” *.js [tags]grep,search,text,folder[/tags]