Sponsored Content
Top Forums UNIX for Dummies Questions & Answers grep specific number from a list of numbers Post 302605979 by methyl on Friday 9th of March 2012 08:43:35 AM
Old 03-09-2012
@dodasajan
I refer you to post #1 . Your code repeats the original problem but also with a typing error in the name of the file.

Code:
touch File90
touch File900
touch File9000

ls File90
File90

ls | grep 'File90'
File90
File900
File9000

ls |grep 'File90$'
File90

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Getting unique list of numbers using grep

Hi, I am going to fetch a list of numbers that starts with "0032" from a file with a format like the given below: " 0032459999 0032458888 0032457777 0032451111 0032452222 0032453333 0032459999 0032458888 0032457777 0032451111 0032452222 0032453333 " I want to get a unique... (6 Replies)
Discussion started by: tinku
6 Replies

2. Shell Programming and Scripting

using sed to replace a specific string on a specific line number using variables

using sed to replace a specific string on a specific line number using variables this is where i am at grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies

3. UNIX for Dummies Questions & Answers

list all files containing 4 digit number using grep

how can i list all files in my home directory that have a 4 digit id number, the line number where the id is located and the id itself not printing the entire line? (5 Replies)
Discussion started by: hobiwhenuknowme
5 Replies

4. Shell Programming and Scripting

iterate through list of numbers and print specific lines with awk

Could someone please point me in the right direction with the following? I have a program that generates logs that contains sections like this: IMAGE INPUT 81 0 0.995 2449470 0 1726 368 1 0.0635 0.3291 82 0 1.001 2448013 0 1666 365 1 0.0649 ... (4 Replies)
Discussion started by: euval
4 Replies

5. Shell Programming and Scripting

the smallest number from 90% of highest numbers from all numbers in file

Hello All, I am having problem to find what is the smallest number from 90% of highest numbers from all numbers in file. I am having file with thousands of lines and hundreds of columns. I am familiar mainly with bash but I am open to whatever suggestion witch will lead to the solutions. If I... (11 Replies)
Discussion started by: Apfik
11 Replies

6. Programming

How to grep the specific string or user's list from the file

I have a file on UNIX system from where I want to grep the list of all users associated to the particular repository.If the user's list is in single line then I fetch all list but if it is in two separate lines it doesn't.I use the below command a=KESTREL-DEV;b=users;cat access_file|grep... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

7. Shell Programming and Scripting

Number of elements, average value, min & max from a list of numbers using awk

Hi all, I have a list of numbers. I need an awk command to find out the numbers of elements (number of numbers, sort to speak), the average value the min and max value. Reading the list only once, with awk. Any ideas? Thanks! (5 Replies)
Discussion started by: black_fender
5 Replies

8. Shell Programming and Scripting

Finding contiguous numbers in a list but with a gap number tolerance

Dear all, I have a imput file like this imput scaffold_0 10558458 10558459 1.8 scaffold_0 10558464 10558465 1.75 scaffold_0 10558467 10558468 1.8 scaffold_0 10558468 10558469 1.71428571428571 scaffold_0 10558469... (5 Replies)
Discussion started by: valente
5 Replies

9. Shell Programming and Scripting

Process a specific number of files ina list

Hello, I have a list of files that was created with, FILES='./'$FOLD'/'$FOLD'_continue/'$OPTIMIZE_ON'/'*'out.txt' I am doing a loop on this list for INPUT in $FILES do ... done but I may not want to process everything. Is there a simple way to just process the first 5,10,n, etc in... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

10. Shell Programming and Scripting

Grep pattern after specific line number in a file

Hi guys, I am running a while loop in a script ro read a file line by line. Now I want to run a grep only on the lines below the line I am that is being read by the while loop. Eg: If my while loop is on line 4 of the file, the grep only runs below line 4 and does not include line 1,2... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies
TOUCH(3)								 1								  TOUCH(3)

touch - Sets access and modification time of file

SYNOPSIS
bool touch (string $filename, [int $time = time()], [int $atime]) DESCRIPTION
Attempts to set the access and modification times of the file named in the $filename parameter to the value given in $time. Note that the access time is always modified, regardless of the number of parameters. If the file does not exist, it will be created. PARAMETERS
o $filename - The name of the file being touched. o $time - The touch time. If $time is not supplied, the current system time is used. o $atime - If present, the access time of the given filename is set to the value of $atime. Otherwise, it is set to the value passed to the $time parameter. If neither are present, the current system time is used. RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | It became possible to change the modification | | | time of a directory under Windows. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 touch(3) example <?php if (touch($filename)) { echo $filename . ' modification time has been changed to present time'; } else { echo 'Sorry, could not change modification time of ' . $filename; } ?> Example #2 touch(3) using the $time parameter <?php // This is the touch time, we'll set it to one hour in the past. $time = time() - 3600; // Touch the file if (!touch('some_file.txt', $time)) { echo 'Whoops, something went wrong...'; } else { echo 'Touched file with success'; } ?> NOTES
Note Note that time resolution may differ from one file system to another. Warning Prior to PHP 5.3.0 it was not possible to change the modification time of a directory with this function under Windows. PHP Documentation Group TOUCH(3)
All times are GMT -4. The time now is 05:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy