Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Need to check last file with a starting name Post 302975664 by Don Cragun on Thursday 16th of June 2016 04:59:00 PM
Old 06-16-2016
Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework Questions forum following special homework rules.

If this is a homework assignment, please refile your request in the proper forum with a completely filled out homework assignment template (from the special homework rules link above).

If not, please tell us:
  1. what operating system you're using,
  2. what shell you're using,
  3. whether you are looking for a file named ABC* or a filename that matches the pattern ABC*, and
  4. whether you are looking for a file only in the directory /folder or for a file in any directory in the file hierarchy rooted in /folder.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to check for a file, check for 2hrs. then quit

I wish to seach a Dir for a specific file, once the file is found i will perform additional logic. If the file is not found within two hours, i would like to exit. Logically, I'm looking for the best way to approach this Thanks for any assistance in advance. Note: I'm using a C shell and... (2 Replies)
Discussion started by: mmarsh
2 Replies

2. Shell Programming and Scripting

cat a file starting with ~|

helo all I have a file where lines start with ~|. Given a sample line-> ~|21|123|1232|ABC|2135.... So when i use the command -----cat $file | mailx -s "Rejects : $envid" $recip.dat------ When unix cats the file which holds lines starting with ~| it seems to be it takes those lines... (2 Replies)
Discussion started by: KenJo
2 Replies

3. UNIX for Advanced & Expert Users

Check EOF char in Unix. OR To check file has been received completely from a remote system

Advance Thanks. (1) I would like to know any unix/Linux command to check EOF char in a file. (2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
Discussion started by: alexalex1
5 Replies

4. Shell Programming and Scripting

Get all File names starting with letter P

Hi, I have lets say 10 files , I need to process them one by one. So I need a command to get one file name at a time to process it into a variable Example Files P1111.dat P3344.dat S344.dat ... v_file_name = 'p111.dat' .. I will rename it to something after processing ... (1 Reply)
Discussion started by: prassu
1 Replies

5. Shell Programming and Scripting

if statement to check files with different ending but same starting name

I am trying to check if files staring with filename but ending with diffent dates e.g. filename.2011-10-25. The code I am using is below if It works find only if one file is present but returns binary operator expected when there are mulptiple files. Please help me correcting it. I... (5 Replies)
Discussion started by: ningy
5 Replies

6. UNIX for Dummies Questions & Answers

Count of rows starting with 01 in a file

Hi I am very new to unix and please help me in solving the below problem I have a file with 50000+ rows. Each row(line) start with 01 or 02 or 03. Now i have to get the count of rows starting with 01 only, Thanks in advance (3 Replies)
Discussion started by: nmakkena
3 Replies

7. UNIX for Advanced & Expert Users

How to delete a* file with out deleting file name starting with a?

Hi, I have a query: I have a bunch of files starting letter with 'a' (example: abhi,all,anand,animal,a1.txt,allow.java,a*) here i want to delete/remove only a* folder but not other files and folders. and a* folder is present in so many other folders. what is unix command to delete... (9 Replies)
Discussion started by: rajanikanth86
9 Replies

8. Shell Programming and Scripting

Get the last string of a file starting from .

The file names are as below a.txt.gz a.txt How to get the output as .txt.gz .txt (1 Reply)
Discussion started by: vedanta
1 Replies

9. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

10. Shell Programming and Scripting

Grep a log file starting from a specific time to the end of file

I have a log file which have a date and time at the start of every line. I need to search the log file starting from a specific time to the end of file. For example: Starting point: July 29 2018 21:00:00 End point : end of file My concern is what if the pattern of `July 29 2018 21:00:00`... (3 Replies)
Discussion started by: erin00
3 Replies
mhpath(1mh)															       mhpath(1mh)

Name
       mhpath - print full pathnames of MH messages and folders

Syntax
       mhpath [ +foldername ] [ msgs ] [ -help ]

Description
       Use the command to display the full pathname of the specified folder.  If you do not specify a folder, displays the pathname of the current
       folder.

       If you specify a message with its message number, displays the pathname of the specified message.  You can also specify a  number  of  mes-
       sages,  or  a range of messages.  If the top of the range that you specify is greater than the last message in the folder, displays as much
       of the specified range as possible.

       Additionally can take a keyword or a sequence name.  The following keywords are acceptable:

       first	 The first message in the folder.

       last	 The last message in the folder.

       new	 The message after the last message in the folder.  You cannot use new as part of a message range.

       cur	 The current message in the folder.

       prev	 The message before the current message.

       next	 The message after the current message.

       all	 All of the messages in the folder.

Options
       -help	 Prints a list of the valid options to this command.

Examples
       In the following example, displays message 3 in the folder
       % mhpath +inbox 3
       /r/phyl/Mail/inbox

       The following example displays the pathname of messages 2 to 5 in the current folder:
       % mhpath 2-5
       /r/phyl/Mail/inbox/2
       /r/phyl/Mail/inbox/3
       /r/phyl/Mail/inbox/4
       /r/phyl/Mail/inbox/5

Profile Components
       Path:   To determine your Mail directory

Files
       The user profile.

See Also
       folder(1mh)

																       mhpath(1mh)
All times are GMT -4. The time now is 02:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy