LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > Linux - News > Syndicated Linux News
User Name
Password
Syndicated Linux News This forum is for the discussion of Syndicated Linux News stories.

Notices

Reply
 
Search this Thread
Old 05-29-2008, 06:11 AM   #1
LXer
LXer NewsBot
 
Registered: Dec 2005
Posts: 73,112

Rep: Reputation: 82
LXer: Simple Shell One-Liner To Enumerate File Types In Linux and Unix


Published at LXer:

How to inventory your filesystem using a simple shell one-liner in Linux and Unix, for all shells from ash to zsh.

Read More...
 
Old 05-29-2008, 12:44 PM   #2
partner55594039
LQ Newbie
 
Registered: May 2008
Posts: 1

Rep: Reputation: 0
Alternative one-liner without awk

find -maxdepth 1 -exec file {} \;|sort -t \: -k 2|uniq -f 2 -c|sed 's/^\( *[0-9]*\).*:\(.*\)/\1\2/'
 
Old 05-30-2008, 08:47 AM   #3
kjordan
Member
 
Registered: Jul 2004
Distribution: LFS, I felt the itch and scratched it
Posts: 227

Rep: Reputation: 31
Quote:
Originally Posted by partner55594039 View Post
find -maxdepth 1 -exec file {} \;|sort -t \: -k 2|uniq -f 2 -c|sed 's/^\( *[0-9]*\).*:\(.*\)/\1\2/'
Or even more simply than that:
find . -exec file -b {} \; | sort | uniq -c

Last edited by kjordan; 05-30-2008 at 08:48 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unix shell script:How to delete the first line in a file?? rche3252 Programming 6 03-03-2010 07:32 AM
what types of services do telecomm firm like t-moble,celtel,mtn use linux/unix for yawe_frek Linux - Networking 4 12-06-2007 02:58 PM
simple unix file system problem alokatzenith Programming 16 11-01-2007 06:02 PM
How to turn a file to a one liner thru sh script? jillann Linux - Newbie 15 04-18-2007 09:32 AM
LXer: Understanding UNIX/Linux file system LXer Syndicated Linux News 0 01-29-2006 07:01 PM


All times are GMT -5. The time now is 02:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration