Can anyone advise how do I use ls to do a selective amd sorted listing of file that I want to have as below?
Am looking for files that are named as log_<nnnn>.txt, where <nnnn> are numeric, i.e. I want to have a listing sorted from the newest to the oldest of files that starts with log_ and with a .txt extension and the characters in between these two can only be numeric, example log_1.txt, log_234.txt, log_222.txt etc.
I want to exclude files like log_9ab.txt, log_a9b.txt., log_99a.txt
I thought I can get away with doing
but unfortunately the * list also files like log_99a.txt.
I want to be able to only list files where the characters in between log_ and .txt are numeric, unfortunately, sometimes, there can be 2, 3 or 5 numeric characters.
Any advise will be much appreciated. Thanks in advance.
Last edited by Scrutinizer; 04-02-2012 at 03:28 AM..
Reason: code tags
I have the following contents in a file
---- CRITICAL: altered for /usr/bin/bin1 ---- OK: /usr/sbin/bin2 result fine ---- OK: /usr/sbin/bin3 result fine ---- CRITICAL: altered for /usr/bin/bin4 ---- OK: /usr/bin/bin5 result fine ---- OK: /usr/bin/bin6 result fine ---- CRITICAL: altered for... (9 Replies)
i have a large sequence of format
sat_1_g3_g_0_8540 . A 1 15501 . . . ID=sat_1_g3_g_0_8540;parentName=sat_1_g3_g_0_8540;Al=sat_1_g2_g_0_8540;
sat_1_g3_g_2_8510 . C 1 25501 . . . ... (11 Replies)
I have a text file in this format.
Group: AAA
Notes: IP : 11.11.11.11
#User xxxxxxxxx
#Password aaaaaaaaaaaaaaaa
Group: AAA
Notes: IP : 11.11.11.22
#User yyyyyyyyyyyyy
#Password bbbbbbbbbbbbb (8 Replies)
I have to grep out only email address from a column. It has characters appended and prepended
F=<sss1@domain.com>
<sss2@domain.com>
(sss3@domain.com)
<sss4@domain.com>
Whatever added before and after email, I should be able to grep out only emails. (9 Replies)
Hello,
I have been using the command below for file manipulation.
while read A B; do grep $f1; done < f2 > f3
So, if a certain string is found in f2 (for ex; DOG243435) and it is also present in f1, then print that string plus the contents of the line in which it was found onto f3.
... (6 Replies)
hi all
from below text
"abcd,SYS_12345,xyz,PQR, ,"
I want to print only
"abcd,SYS,xyz,PQR, ,"
i.e. taking only first three 3 chars from 2 string of comma separated file
thanks (4 Replies)
I am running Linux 2.6.20 on i686 architecture.
I want to be able to masquerade different hosts on my LAN to different external interfaces. Specifically, I want one specific host to masquerade through a vpn tunnel while the other hosts simply masquerade over the regular ISP interface. I only... (4 Replies)
Hi,
We have umask 022 in /etc/profile for security reasons.
But I want have some other umask for selected users. how to achieve this?
Regards (3 Replies)
i tried to ask about this earlier, but didn't explain well enough. From a script, i issue the following:
echo `pgp --encrypt filename --recipient public-key`
The result is perfect. The encrypted file is in the directory just as if i'd issued the pgp command from the command line.
However,... (0 Replies)