Sponsored Content
Top Forums Shell Programming and Scripting Shell script to find out 2 last modified files in a folder..PLZ HELP!!!!!!!!! Post 302163405 by panknil on Friday 1st of February 2008 12:42:06 AM
Old 02-01-2008
MySQL

Dear Anju,

to get the timestamp of a file, try this,

ls -l filename|awk '{print $6$7$8}'

then the result will be in the format of MonDDYY
here in the place of YY u'll get the time of the file creation if the file get created within 6 months. if the file got created before 6 months then in the place of YY value will be the year(2007 etc)

Regards,
Pankaj
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to call other files..plz help

Hi all, I have a number of shell script,perl script.. etc in a directory,which i need to execute in some order.Now i need to create a script to call all these files in that order..so that the new script will execute all the files one by one....plz help this is urgent. Thanks In advance Anju (3 Replies)
Discussion started by: anju
3 Replies

2. Shell Programming and Scripting

help: find and modified files script

hello all im a newbie in the linux world ..i have just started creating basic scripts in linux ..i am using rhel 5 ..the thing is i wanted to create a find script where i could find the last modified file and directory in the directory given as input by the user and storing the output in a file so... (6 Replies)
Discussion started by: tarunicon
6 Replies

3. Shell Programming and Scripting

HOW TO CHECK ONLY .C FILES EXISTS OR NOT IN A FOLDER using IF in C shell script?

Hi friends.. I hav a problem.... I dont know how to check .c files exists r not in a folder using IF in C shell script actually i tried like this if(=~ *.c) even though some .c files or there in the current folder..it is not entering int o the if control statement...... (17 Replies)
Discussion started by: p.hemadrireddy
17 Replies

4. Shell Programming and Scripting

Find all text files in folder and then copy to a new folder

Hi all, *I use Uwin and Cygwin emulator. I´m trying to search for all text files in the current folder (C/Files) and its sub folders using find -depth -name "*.txt" The above command worked for me, but now I would like to copy all found text files to a new folder (C/Files/Text) with ... (4 Replies)
Discussion started by: cgkmal
4 Replies

5. Shell Programming and Scripting

Compiling all modified Java files in a folder on Unix

Hi all, I have a Unix script that will compile all Java files in a sub folder as follows: find . -name "*.java" -print -exec $JAVA_HOME/bin/javac -cp .:$CLASSPATH '{}' \; I would like to enhance it to only compile those Java files who: 1.) Have no class file 2.) Have a class file... (1 Reply)
Discussion started by: Annorax
1 Replies

6. Shell Programming and Scripting

How to Process input files from folder in shell script?

Hi, I want to process all input files available into folder (C:\ShellPrg\InputFile\) Input files are abc.CSV , XYZ.zip (zip of CSV file), PQR.gz (zip of CSV file). I want to check the extension of file, If its .zip/.gz then need to unzip the file as .CSV I want to parse line by line of... (2 Replies)
Discussion started by: Poonamol
2 Replies

7. Shell Programming and Scripting

How to unzip files from folder in shell script (ksh)?

I have a folder (C:\shellprg\input\) containing .CSV, .zip, .gz files. 1] I want to find all .zip/.gz files from folder (C:\shellprg\input\). 2] unzip/uncompress files into the same folder (C:\shellprg\input\) through shell script. I am using below commands for unzip files, unzip <filename>... (2 Replies)
Discussion started by: Poonamol
2 Replies

8. Shell Programming and Scripting

Shell script that lists files with different owner than the folder

Hello, I'm trying to write a script which is listing files based on different preferences, like filetype or permissions. All is fine, except for one: I want to list files in /home which has a different owner than the home directory it is in. Here is an example: /home/UserA is the directory, and... (10 Replies)
Discussion started by: Zwiebi
10 Replies

9. Shell Programming and Scripting

Shell script to copy files from on folder to another

I am trying to copy files with specific date and name to another folder. I am very new to shell scripting so i am finding it hard to do that. see the sample code i have written below. srcdir="/media/ubuntu/CA52057F5205720D/Users/st4r8_000/Desktop/office work/26 nov"... (13 Replies)
Discussion started by: Aqeel Abbas
13 Replies

10. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
atprint(3)						       AtFS Toolkit Library							atprint(3)

NAME
atWriteStatus, atWriteMode, atWriteDate, atWriteName, atScanStatus - print and scan special attribute values SYNOPSIS
#include <atfs.h> #include <atfstk.h> char*atWriteStatus (Af_key *aso; int verbose); char*atWriteMode (Af_key *aso); char*atWriteDate (Af_key *aso, char *dateAttribute); char*atWriteName (Af_key *aso, char *path); int atScanStatus (char *statusStr); DESCRIPTION
atWriteStatus returns a string representation of Asos AF_STATE attribute. With the verbose argument TRUE, atWriteStatus returns a long (8 character) status name. Otherwise, on FALSE, it returns a one character short representation. The result value is a statically defined string in any case. atWriteMode generates a ls -l(1) like (e.g. -rwxr-xr-x) string representation of the AF_MODE attribute. It returns its result in static memory, which will be overwritten on subsequent calls. atWriteDate produces a date string from the given dateAttribute to be used for ls -l(1) like output (e.g. Jan 8 11:07 or Jul 10 1992). The format of the date string depends on the value of the date attribute. The string is always 12 characters long and begins with the month and day. For dates younger than 6 months, the third field is the time, for dates older than 6 months, the year. The result string resides in static memory, which will be overwritten on subsequent calls. atWriteName generates a bound pathname from path and aso. atScanStatus converts an status string to an internal numeric status value. It understands various abbreviations, including the one charac- ter status strings generated by atWriteStatus. .BUGS The format switch in afWriteDate (for dates older than six months) does not happen at exactly the right time. It may be a few days later. AtFStk-1.12 Fri Jun 25 16:39:43 1993 atprint(3)
All times are GMT -4. The time now is 09:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy