Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Need to check last file with a starting name Post 302975662 by RoronoaZoro on Thursday 16th of June 2016 04:35:42 PM
Old 06-16-2016
Need to check last file with a starting name

Hello,

I need help on finding with an if statement or with a command a file that exist in lets suppose /folder with the name ABC* but i need to get the last file generated with that name and fi the file exist then do an echo and if not do another echo

Please help
 

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
packf(1)						      General Commands Manual							  packf(1)

NAME
packf - compress a folder into a single file (only available within the message handling system, mh) SYNOPSIS
packf [+folder] [msgs] [-file name] [-help] OPTIONS
Specifies the file in which you want the message(s) to be stored. If you specify an existing file then the specified messages will be appended to the end of that file. Otherwise, a new file will be created and the messages placed in it. If you do not specify a filename, packf attempts to place the messages in a file called msgbox in the current working directory. If this file does not exist, packf asks whether you want to create it. Prints a list of the valid options to this command. The default settings for this command are: +folder defaults to the current folder msgs defaults to all -file DESCRIPTION
Each message in a folder is normally stored as a separate file. The packf command takes all messages from the current folder and copies them to a single specified file. Each message in the file is separated by four <CTRL/A>s and a newline. You can specify a folder other than the current folder by using the +folder argument. If you do not want all the messages in a folder to be packed into one file, you can specify a number of messages or a range of messages with message numbers. The first message packed will become the current message. If you specify a +folder argument, that folder will become the current folder. When messages have been packed into a file using packf, you can separate them into individual messages using the burst command. See burst(1). PROFILE COMPONENTS
Path: To determine the user's Mail directory Msg-Protect: To set protections when creating a new file EXAMPLES
The first example shows all the messages in the folder +lrp being packed into a file called planning: % packf +lrp -file planning The next example shows how packf prompts you if you do not specify a -file option. A file called msgbox is created by packf in your home directory, and messages 3 to 5 are packed into it: % packf +lrp 3-5 Create file "/machine/disk/username/msgbox"? y FILES
The user profile. SEE ALSO
burst(1) packf(1)
All times are GMT -4. The time now is 07:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy