find . -type f | sed 's/.*\.//' | sort | uniq -c | sort -nr
pretty
Thursday, May 11, 2023
Count and sort by file extension in folder
One liner to count all files by extension in folders and subfolders.
Saturday, January 14, 2023
Grep in utf16 file
A quick way to grep in utf16 by converting it to utf-8 on the fly
iconv -f utf-16 -t utf-8 file.txt | grep query
Tuesday, January 10, 2023
recursive grep in Powershell
The eqvivalent of grep -r in Powershell
Get-ChildItem -Recurse -Include *.txt -Path . | Select-String -Pattern "foobar"
grep on a remote machine and save output to local machine
Grep on a remote machine and save output to local machine
This particular example grep is used for trying to find deleted files on an disk in linux
ssh user@remotehost "grep -a -P 'searchterm' /dev/md2" > output.txt
Subscribe to:
Posts (Atom)