10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
HI
I am using below script to remove only last year files and also need deleted files i want to keep in log file or history for future reference
But it is giving wrong output please help or let me any other way for example 2016 if am using this command it is removing 2016 and 2017 files also... (2 Replies)
Discussion started by: Kalia
2 Replies
2. Solaris
Hi,
I would like to know is there any way to capture the year in /var/adm/sulog file in solaris 10?
Please suggest (2 Replies)
Discussion started by: manoj.solaris
2 Replies
3. UNIX for Dummies Questions & Answers
Hi
i have written a infinite loop which writes to a file log.txt
while
do
echo " file in use " >> log.txt
done
i have started this process in one terminal , from another terminal i issued cp command
cp log.txt log2.txt
i was expecting a File in use message but didnt ?
i have... (6 Replies)
Discussion started by: rakeshkumar
6 Replies
4. Shell Programming and Scripting
Hi
I have files like
abc_cd_20110302_123423
abc_cd_ef_20110301_123423
abc_cd_ef_20110403_123423
abc_ef_20110401_123423
I want to extract the
the year and month associated with each file.
I tried
logfileyearmonth=`echo $logfile | awk -F_'{print $NF}'`
Any other way can I... (6 Replies)
Discussion started by: dgmm
6 Replies
5. Shell Programming and Scripting
Is there a way to show the first 4 lines of a file without using head -4?
In sed would it be sed '1,4d' ?
What if I just wanted to display the 2nd line ONLY?
How could this be done with AWK?...correctly with SED? (6 Replies)
Discussion started by: puttster
6 Replies
6. Shell Programming and Scripting
Hi
I need to get the File creation date (MM,DD,YYYY)
using ls -ltr am getting only Month and Day only, I need year also when the file is modified.
Thanks (3 Replies)
Discussion started by: KiranKumarKarre
3 Replies
7. Shell Programming and Scripting
Hello experts,
I have a directory which the files inside have different date.
Now I'd like to move them to folder year/mouth (2007/01 , 2007/02)
Have any suggestion?
thanks in advance for reading or anyposts. (3 Replies)
Discussion started by: mmm951
3 Replies
8. Shell Programming and Scripting
When i use, 'ls -ltr' I only see the month and day (timestamp) of the file.
How do i see the year also.
Thanks and Regards,
Ram (1 Reply)
Discussion started by: ramky79
1 Replies
9. UNIX for Dummies Questions & Answers
How do I know the year of creation of a file modified less than 6 months from now. Since I "know" that the file has been created
in 2004 since ls -l does not show the year of its creation but can I get the same information through a command etc.
From the ls man page:
Am I clear enough??
... (6 Replies)
Discussion started by: encrypted
6 Replies
10. UNIX for Dummies Questions & Answers
Hello guys,
I want to extract year of file creation. Is there a direct way to get that information.
"ls -l" do give required information but if the file created is not older then 6 months it will not display the year. To get year one possible way will be do a math with date extracted by ls.
... (2 Replies)
Discussion started by: RishiPahuja
2 Replies