LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Closed Thread
  Search this Thread
Old 09-21-2015, 11:27 AM   #1
imujjwal
LQ Newbie
 
Registered: Aug 2008
Posts: 20

Rep: Reputation: 0
List distinct file name from the multiple file using LS command


Hi,
I would like to know how can I display the unique/distinct file name from ls in linux. Will appreciate if you could let me know the exact command in order to get the below mentioned result.

The distinct output should only list the starting name list only for example only one charlie, only one tango and only one alpha like below one :

[ncell@informatica-srv1 test]$
-rwxrwxrwx 1 etl etl 937 Sep 13 22:00 charlie13150913_111_222629.unl
-rwxrwxrwx 1 etl etl 186 Sep 11 01:44 tango20150911_117_112263.unl
-rwxrwxrwx 1 etl etl 186 Sep 21 01:44 alpha20150921_123_033924.unl

Above output is what i am looking for, Again I need only one charlie, tango, alpha from the below mentioned output


[ncell@informatica-srv1 test]$ ls -ltr

-rwxrwxrwx 1 etl etl 937 Sep 13 22:00 charlie13150913_111_222629.unl
-rwxrwxrwx 1 etl etl 1498 Sep 13 22:02 charlie13150913_131_349632.unl
-rwxrwxrwx 1 etl etl 1135 Sep 13 22:02 charlie13150913_113_135911.unl
-rwxrwxrwx 1 etl etl 1343 Sep 13 22:02 charlie13150913_113_135912.unl
-rwxrwxrwx 1 etl etl 2627 Sep 13 22:02 charlie13150913_138_976607.unl
-rwxrwxrwx 1 etl etl 1506 Sep 13 22:03 charlie13150913_111_330091.unl
-rwxrwxrwx 1 etl etl 1690 Sep 13 22:03 charlie13150913_111_222630.unl
-rwxrwxrwx 1 etl etl 2637 Sep 13 22:03 charlie13150913_117_111111.unl
-rwxrwxrwx 1 etl etl 3002 Sep 13 22:04 charlie13150913_119_133130.unl
-rwxrwxrwx 1 etl etl 2256 Sep 13 22:04 charlie13150913_131_349633.unl
-rwxrwxrwx 1 etl etl 2442 Sep 13 22:04 charlie13150913_113_279957.unl
-rwxrwxrwx 1 etl etl 1312 Sep 13 22:04 charlie13150913_111_330092.unl
-rwxrwxrwx 1 etl etl 2247 Sep 13 22:04 charlie13150913_139_336782.unl
-rwxrwxrwx 1 etl etl 1677 Sep 13 22:04 charlie13150913_119_133131.unl
-rwxrwxrwx 1 etl etl 2238 Sep 13 22:04 charlie13150913_138_976608.unl
-rwxrwxrwx 1 etl etl 1398 Sep 13 22:04 charlie13150913_122_053970.unl
-rwxrwxrwx 1 etl etl 1877 Sep 13 22:04 charlie13150913_111_330093.unl
-rwxrwxrwx 1 etl etl 2240 Sep 13 22:04 charlie13150913_134_075453.unl
-rwxrwxrwx 1 etl etl 2796 Sep 13 22:05 charlie13150913_112_940211.unl
-rwxrwxrwx 1 etl etl 2249 Sep 13 22:05 charlie13150913_112_940222.unl
-rwxrwxrwx 1 etl etl 1852 Sep 13 22:05 charlie13150913_116_174685.unl
-rwxrwxrwx 1 etl etl 1370 Sep 13 22:05 charlie13150913_111_330094.unl
-rwxrwxrwx 1 etl etl 1687 Sep 13 22:05 charlie13150913_111_330095.unl
-rwxrwxrwx 1 etl etl 937 Sep 13 22:05 charlie13150913_113_135913.unl
-rwxrwxrwx 1 etl etl 1489 Sep 13 22:05 charlie13150913_113_135914.unl
-rwxrwxrwx 1 etl etl 2445 Sep 13 22:05 charlie13150913_113_174897.unl
-rwxrwxrwx 1 etl etl 1114 Sep 13 22:05 charlie13150913_122_053971.unl


-rwxrwxrwx 1 etl etl 186 Sep 11 01:44 tango20150911_117_112263.unl
-rwxrwxrwx 1 etl etl 185 Sep 11 01:44 tango20150911_117_112264.unl
-rwxrwxrwx 1 etl etl 188 Sep 11 01:44 tango20150911_117_112265.unl
-rwxrwxrwx 1 etl etl 376 Sep 11 01:44 tango20150911_116_174807.unl
-rwxrwxrwx 1 etl etl 186 Sep 11 01:44 tango20150911_116_174808.unl
-rwxrwxrwx 1 etl etl 186 Sep 11 01:44 tango20150911_116_174809.unl
-rwxrwxrwx 1 etl etl 378 Sep 11 01:44 tango20150911_116_174813.unl
-rwxrwxrwx 1 etl etl 381 Sep 11 01:44 tango20150911_138_976706.unl
-rwxrwxrwx 1 etl etl 378 Sep 11 01:44 tango20150911_138_976707.unl
-rwxrwxrwx 1 etl etl 192 Sep 11 01:44 tango20150911_113_280089.unl
-rwxrwxrwx 1 etl etl 381 Sep 11 01:44 tango20150911_113_280090.unl
-rwxrwxrwx 1 etl etl 376 Sep 11 01:44 tango20150911_132_327415.unl
-rwxrwxrwx 1 etl etl 193 Sep 11 01:44 tango20150911_132_327416.unl
-rwxrwxrwx 1 etl etl 380 Sep 11 01:44 tango20150911_132_327417.unl
-rwxrwxrwx 1 etl etl 188 Sep 11 01:44 tango20150911_132_327418.unl
-rwxrwxrwx 1 etl etl 188 Sep 11 01:44 tango20150911_133_329284.unl
-rwxrwxrwx 1 etl etl 177 Sep 11 01:44 tango20150911_133_329285.unl

-rwxrwxrwx 1 etl etl 186 Sep 21 01:44 alpha20150921_123_033924.unl
-rwxrwxrwx 1 etl etl 186 Sep 21 01:44 alpha20150921_117_212263.unl
-rwxrwxrwx 1 etl etl 185 Sep 21 01:44 alpha20150921_117_212264.unl
-rwxrwxrwx 1 etl etl 188 Sep 21 01:44 alpha20150921_117_212265.unl
-rwxrwxrwx 1 etl etl 376 Sep 21 01:44 alpha20150921_116_174807.unl
-rwxrwxrwx 1 etl etl 186 Sep 21 01:44 alpha20150921_116_174808.unl
-rwxrwxrwx 1 etl etl 186 Sep 21 01:44 alpha20150921_116_174809.unl
-rwxrwxrwx 1 etl etl 378 Sep 21 01:44 alpha20150921_116_174810.unl
-rwxrwxrwx 1 etl etl 381 Sep 21 01:44 alpha20150921_108_976706.unl
-rwxrwxrwx 1 etl etl 378 Sep 21 01:44 alpha20150921_108_976707.unl
-rwxrwxrwx 1 etl etl 192 Sep 21 01:44 alpha20150921_113_280089.unl
-rwxrwxrwx 1 etl etl 381 Sep 21 01:44 alpha20150921_113_280090.unl
-rwxrwxrwx 1 etl etl 376 Sep 21 01:44 alpha20150921_102_327415.unl
-rwxrwxrwx 1 etl etl 193 Sep 21 01:44 alpha20150921_102_327416.unl
-rwxrwxrwx 1 etl etl 380 Sep 21 01:44 alpha20150921_102_327417.unl
-rwxrwxrwx 1 etl etl 188 Sep 21 01:44 alpha20150921_102_327418.unl
-rwxrwxrwx 1 etl etl 188 Sep 21 01:44 alpha20150921_103_329284.unl
-rwxrwxrwx 1 etl etl 177 Sep 21 01:44 alpha20150921_103_329285.unl
-rwxrwxrwx 1 etl etl 190 Sep 21 01:44 alpha20150921_118_242622.unl
 
Old 09-21-2015, 11:49 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Please do not cross post. I've requested that this thread be closed and that your duplicate thread be used to address your question

http://www.linuxquestions.org/questi...me-4175554092/
 
Old 09-21-2015, 12:21 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Closed per above.
 
  


Closed Thread



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to List the distinct file name ? imujjwal Linux - Newbie 39 09-29-2015 01:38 AM
To search distinct special char in file rohit_shinez Programming 19 09-05-2013 11:44 AM
Using multiple mirrors in sources.list file rng Debian 4 02-24-2013 10:45 PM
How can you distinct between link and file when using readdir TruongAn Programming 2 09-01-2005 06:25 PM
can't see root file system with list command fr_baker Linux - General 10 06-07-2004 08:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration