Sponsored Content
Full Discussion: Linux script - help!!
Top Forums Shell Programming and Scripting Linux script - help!! Post 302843544 by JerryHone on Tuesday 13th of August 2013 06:36:13 PM
Old 08-13-2013
I've had various issues with trying to use mtime and ctime in the past, so my usual method is to touch a file with a date time stamp of, say, a year ago
Code:
touch -t 20130813 ref_file

and then use
Code:
find . ! -newer ref_file

to find files that are older than the specific date
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Linux Script help

Hi Everyone , have a nice day given below is a simple linux script but its first part is not working ( variable k assignment ) , while second loop is working fine can anyone help me out with this #!/bin/sh echo "Enter Date" read date1 for i in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14... (6 Replies)
Discussion started by: Dastard
6 Replies

2. Shell Programming and Scripting

help with linux shell script

HI im a novice with shell scripts but i need help with a random script I have this folder filled with 500 different file names... I need help creating a script that will take each filename and make a new folder named that filename and then move that file into the newly created folder. Then the... (1 Reply)
Discussion started by: emachala
1 Replies

3. Shell Programming and Scripting

Help with linux bash script

Hello everybody! This is my first time having to write a script so your help is most appreciated.Also i am a beginner when it comes to linux so please bare with me.Thanks in advance to all who will look into this for me. I have to write a bash script that will show the free space on the hard... (4 Replies)
Discussion started by: manike
4 Replies

4. Shell Programming and Scripting

Linux script help

I am creating a script that will incorporate multiple variables organized in a spreadsheet for pdftk. I have a 1000 page pdf that I have to split into about 300 individual pdfs. The basic command line to extract pages is as follows: $ pdftk file.pdf cat 1-7 output newfile.pdf file.pdf =... (8 Replies)
Discussion started by: tankcommander
8 Replies

5. Linux

linux script

I need to write a script to which need to track errors in log and need to check last 100 lines in the log at every 5 minits. if error fund need to mail my self error type 1. "STATE_ADMIN" if found need to print: <Jan 5, 2011 11:47:02 AM IST><ewaps2> <ADFAPPS2> < STATE_ADMIN 2."Java heap... (0 Replies)
Discussion started by: udara
0 Replies

6. Shell Programming and Scripting

Help, Linux Script

#!/bin/sh args=("$@") echo "#=================================" echo "#Script Name:" echo "#By:" echo "#Purpose:" echo "#:Command Line: picoc" echo "#=================================" pico $@ this is my script. i think it is ok w/o error. but when i run it i got error. i'm using a VMBox... (1 Reply)
Discussion started by: jrdncchr
1 Replies

7. Shell Programming and Scripting

Need linux script!!

I have a text file like this: 25 raj 78 rohit 89 bhanu 58 mohit 29 mano 53 rohit 63 shiva 74 lapan 63 bhanu what i need is a linux script to reorganize this file by adding the relevant content(number) to the names and print only once.... please help me someone. ... (1 Reply)
Discussion started by: shan1990
1 Replies

8. Shell Programming and Scripting

Need help! Linux shell script

Hi all, I am trying to make a Nodemanager work in RHEL 5 I got this script from 'oraclemiddleware.wordpress.com', and made appropriate changes to suit my weblogic installation. I keep getting the error, "line 82: syntax error: unexpected end of file". I have checked every line to make sure all... (4 Replies)
Discussion started by: chakrv1
4 Replies

9. UNIX for Dummies Questions & Answers

Linux script

Hello, could you please help me with the following request? I need a linux command script that does the following. 1. delete folders folder1 and folder2 located in install/users/web/folder1&2. and also delete folder3 install/jboss/server/folder3. All these folders has many folder and files... (1 Reply)
Discussion started by: bern11
1 Replies

10. Shell Programming and Scripting

Linux script

can anyone help in this i have a file like 2089,success 2089,failure 2087,failure 2089,success 2087,failure. i want output like. 2089,success=2,failure=1 2087,success=1,failure=2 thanks (8 Replies)
Discussion started by: pradeep rawat
8 Replies
touch(1)						      General Commands Manual							  touch(1)

NAME
touch - update access, modification, and/or change times of file SYNOPSIS
ref_file time] file_name... Obsolescent time_str file_name... DESCRIPTION
updates the access, modification, and last-change times of each argument. The file name is created if it does not exist. If no time is specified (see date(1)) the current time is used. The and options are mutually exclusive. Options The following options are available: Change the access time of file_name to time, or to the current time if time is not specified. Do not change the modification time unless is also specified. Change the modification time of file_name to time, or to the current time if time is not specified. Do not change the access time unless is also specified. Silently prevent from creating the file if it did not previously exist. Do not write any diagnostic messages concerning this condi- tion. Use the corresponding time of ref_file instead of the current time. Use the specified time instead of the current time. The option argument is a decimal number of the form: [[CC]YY]MMDDhhmm[.SS] where each two digits represents the following: CC The first two digits of the year. YY The second two digits of the year. MM The month of the year (01-12). DD The day of the month (01-31). hh The hour of the day (00-23). mm The minute of the hour (00-59). SS The second of the minute (00-61). If neither CC nor YY is given, the current year is assumed. If YY is specified, but CC is not, CC is derived as fol- lows: (taken into account the local time factor) If YY is: CC becomes: ------------------------ 69-99 19 00-68 20 If the resulting time value precedes the Epoch (00:00:00 January 1, 1970 Greenwich Mean Time), exits immediately with an error status. The range for SS is 00 through 61 rather than 00 through 59 to accommodate leap seconds. If SS is 60 or 61, and the resulting time, as affected by the environment variable, does not refer to a leap second, the resulting time is one second after a time where SS is 59. If SS is not given a value, it is assumed to be 0. The syntax shown by the second line is recognized when neither the option, the option, nor the option delimiter is specified, and the first operand consists of all decimal digits. This operand is interpreted as the time argument instead of as a file name. However, in this case, time_str is assumed to be of the form: MMDDhhmm[YY] This is for backward compatibility. The form given above is recommended for future portability. The option delimiter can be used before the first file_name if there is a possibility that file_name consists of all digits, in order to ensure that the first syntax is used. succeeds when invoked by the of the file if any of the following are true: o A time is specified. o Only the access time of the file is being updated. o Only the modification time of the file is being updated. In addition, succeeds when invoked by a user with write permission on the file if of the following are true: o No time is specified. o the access time and modification time of the file are being updated. EXTERNAL INFLUENCES
Environment Variables If the time is specified via the option, is used to interpret the time for the specified time zone. determines the language in which messages are displayed. If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari- able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single- and multibyte character code sets are supported. RETURN VALUE
returns the following values: All file_name arguments were successfully changed. Prints out a diagnostic message if an invalid time or a time earlier than the Epoch was specified with the option, or if the and options were both specified, or if one or more of the file_name arguments could not be accessed. EXAMPLES
The following command sets the modification and access times of the file named "bastille" to midnight, July 14, 1989, creating the file if it does not already exist. The following command does the same thing using the backward-compatible syntax: The following command sets the time of the two files named "0714000089" and "bastille" to the current time, creating them if they do not exist: To create a zero-length file, use any of the following: DEPENDENCIES
NFS An attempt to touch a file owned by the superuser on a remote server can fail, even if the invoking user has write permission on the file. SEE ALSO
date(1), utime(2). STANDARDS CONFORMANCE
touch(1)
All times are GMT -4. The time now is 04:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy