10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hey,
I need to write a command line (only one line), which prints the content of the files of the last modified sub-folder
thanks in advance
I have to use grep for this (3 Replies)
Discussion started by: sijaanh
3 Replies
2. UNIX for Dummies Questions & Answers
I am trying to fetch the latest modified file from a directory using the command
find . -type f -exec ls -lt \{\} \+ | head | awk '{print $9}'
After the O/P, I get the below mentioned error and the command doesnt terminate at all.
find: ls terminated by signal 13
find: ls terminated by... (2 Replies)
Discussion started by: Sree10
2 Replies
3. Shell Programming and Scripting
How to copy files from one directory to another directory with the subfolders copied.
If i have folder1/sub1/sub2/* it needs to copy files to folder2/sub1/sub2/*.
I do not want to create sub folders in folder2.
Can copy command create them automatically?
I tried cp -a and cp -R but did... (4 Replies)
Discussion started by: santosh2626
4 Replies
4. Shell Programming and Scripting
I wan to pick the latest modified file name and redirect it to a file ..
ls -tr | tail -1 >file
but this is printing file ins side the filename ,
can anyone help me out (5 Replies)
Discussion started by: vishwakar
5 Replies
5. Shell Programming and Scripting
hi everyone
suppose i have many directory under one directory. now i want to find out the last modified directory
so i executed the command
ls -ltr
but it gives me the directory structure too and i don't want this
so i removed 'r' also but it too gives me directory... (2 Replies)
Discussion started by: aishsimplesweet
2 Replies
6. Shell Programming and Scripting
Hi
I need to copy last modified directory from path /users/bin to be copied to /tmp in a perl script ...somehow my script is not allowing me to do cd /users/bin.
i have tried
$dir = `find /users/bin -maxdepth 1 -type d -mtime 0 `
cp -R $dir /tmp/new
but it says missing destination... (1 Reply)
Discussion started by: shaveta
1 Replies
7. UNIX for Dummies Questions & Answers
I only know how to list all sub-directories or files in specified directory. I don't know how to order them by modified date, furthermore, I don't know how to get the top one file in the sorted list. Wish you can do me a favor. Thanks in advance! (3 Replies)
Discussion started by: crest.boy
3 Replies
8. UNIX for Advanced & Expert Users
how to directly open a last modified file in a directory? Please help (5 Replies)
Discussion started by: apsprabhu
5 Replies
9. Shell Programming and Scripting
Hi,
I have an application which creates some directories while running. I want to delete these directories which are 4 days older.
i tried
find . type d -mtime +1 -print
And it is working fine..
but
find . type d -mtime +4 -print
is not giving any results which are 4 days... (6 Replies)
Discussion started by: Tuxidow
6 Replies
10. Shell Programming and Scripting
I want a one liner perl command to find a directory only if the modified time is within the last hour
I am running this on windows - and I will define a variable for the result.
So for example I want to return value of 1 for the variable if the modified time of d:\test1 is within the last... (0 Replies)
Discussion started by: frustrated1
0 Replies