Help with selective ls


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help with selective ls
# 8  
Old 04-03-2012
You can just use the same regex as a pattern as you did for egrep:
Code:
ls -1tr *.txt | awk '/log_[0-9]+\.txt/'

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Selective running

I have MegaCli64 -PDList -aALL | grep -E 'Enclosure Device ID|Slot Number' Enclosure Device ID: 252 Slot Number: 0 Enclosure Device ID: 252 Slot Number: 1 Enclosure Device ID: 252 Slot Number: 2 Enclosure Device ID: 252 Slot Number: 3 I need to run the following command on all slots... (4 Replies)
Discussion started by: anil510
4 Replies

2. Shell Programming and Scripting

Selective printing

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)
Discussion started by: anil510
9 Replies

3. UNIX for Dummies Questions & Answers

Selective replace

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)
Discussion started by: siya@
11 Replies

4. Shell Programming and Scripting

Selective grouping

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)
Discussion started by: anil510
8 Replies

5. Shell Programming and Scripting

Selective grep

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)
Discussion started by: anil510
9 Replies

6. UNIX for Dummies Questions & Answers

selective grep

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)
Discussion started by: verse123
6 Replies

7. Shell Programming and Scripting

selective printing

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)
Discussion started by: JoeColeEPL9
4 Replies

8. IP Networking

selective masquerading

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)
Discussion started by: NESter
4 Replies

9. UNIX for Advanced & Expert Users

Selective Umask

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)
Discussion started by: baanprog
3 Replies

10. Shell Programming and Scripting

echo is selective?

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)
Discussion started by: rgard
0 Replies
Login or Register to Ask a Question
CXREF(1)						      General Commands Manual							  CXREF(1)

NAME
cxref - cross reference C source files SYNOPSIS
cxref [ -FSCcfis ] [ -w width ] [files] DESCRIPTION
Cxref reads the named C source files and produces on the standard output a cross reference of all the identifiers and constants in the files. Constants are integer constants (12, 0421, 0x1A), floating point constants (123.45, 0.2e-4), string constants ("this is a string "), and character constants ('a', '33'). Identifiers, character constants, and string constants are sorted lexicographically, i.e. according to the machine collating sequence (7-bit ASCII on the Vax or the Pyramid). Integer and floating point constants are sorted numerically. The trailing 'l' or 'L' on long integer constants will not show up in the output listing. If no files are named, cxref reads the standard input. For multiple files, the argument "-" (a single dash) indicates that the standard input should be read at that point. If arguments are given, they must come before any file names. Cxref recognizes the following arguments: -F Fold case in comparison. By default, case is distinct in comparison of identifiers and string and character constants. (cxref simply passes the "-F" option on to sort(1) as "-f".) -S Cross reference all files separately. The default action is to cross reference all named files together. -c Leave character constants out of the cross reference listing. -f Leave floating point constants out of the cross reference listing. -i Leave integer constants out of the cross reference listing. -s Leave string constants out of the cross reference listing. -C Leave all constants, character, string, integer, and floating point, out of the cross reference listing. By default, all types of constants are included in the cross reference. -w width Make the output be width columns wide. The output width will never be less than 51 or more than 132 columns. Cxref silently adjusts incorrect settings to the nearest allowable setting. If no width is specified, the output will default to 80 columns wide. Cxref does not include #include files, or expand macro definitions. Files named in #include lines can be listed on the command line if they should also be cross referenced. If a quoted string has an escaped newline in it (see ``The C Programming Language'', page 181, or Section 2.5 of the C Reference Manual), it will show up inside the string in the output listing as N. This is to make it visible to the programmer, and to keep the various fil- ters which Cxref uses to actually do the work from getting terribly confused. Cxref is best run in the background, with its output redirected into a file or the line printer spooler lpr(1), since it reads all the named files, using sort(1) as an intermediate pass. The sorting can take time which the user can probably put to more productive use. DIAGNOSTICS
Self explanatory. BUGS
Systems running UNIX 4.0 and later already have a program named cxref. Therefore, on those systems, this program should be renamed. Cxref does not do any formatting on its output (other than to insure that it writes the proper number of columns), so it should probably be run piping its output into pr(1). Floating point constants are converted to a common format for sorting, therefore they may appear in the output in a format different from (but numerically equivalent to) their form in the original source code. SEE ALSO
lex(1), lpr(1), pr(1), sort(1) FILES
/tmp/cxr.$$.* temporary files for integer and floating point contstants. Cxref removes these files when it is through. AUTHOR
Arnold Robbins School of Information and Computer Science Georgia Institute of Technology Atlanta, Geogia 30332 UUCP: gatech!arnold CSNET: arnold@gatech ARPANET: arnold%gatech.csnet@csnet-relay.arpa Copyright (c) 1984 by Arnold Robbins. All rights reserved. This program may not be sold, but may be distributed provided this notice is included. Georgia Tech CXREF(1)