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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-21-2015, 11:27 AM
|
#1
|
LQ Newbie
Registered: Aug 2008
Posts: 20
Rep:
|
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
|
|
|
09-21-2015, 11:49 AM
|
#2
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,955
|
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/
|
|
|
09-21-2015, 12:21 PM
|
#3
|
Moderator
Registered: Aug 2002
Posts: 26,761
|
Closed per above.
|
|
|
All times are GMT -5. The time now is 07:34 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|