Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Touch 10% of the total files inside a folder Post 302629321 by vbe on Tuesday 24th of April 2012 01:08:44 PM
Old 04-24-2012
How do you want it to "touch" only 10%, on what criteria?
In the simplest way,you would need to count how many, and compute to get 10%, then use a counter to get out of the loop
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep running total/ final total across multiple files

Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
Discussion started by: MrAd
5 Replies

2. UNIX for Dummies Questions & Answers

Touch all files and subdirectories (recursive touch)

I have a folder with many subdirectories and i need to set the modified date to today for everything in it. Please help, thanks! I tried something i found online, find . -print0 | xargs -r0 touch but I got the error: xargs: illegal option -- r (5 Replies)
Discussion started by: glev2005
5 Replies

3. Shell Programming and Scripting

check how many files in folder or total files in folder

Hi all, I have copied all my files to one folder.and i want to check how many files (count) in the folder recently moved or total files in my folder? please send me the query asap. (3 Replies)
Discussion started by: durgaprasad
3 Replies

4. UNIX for Dummies Questions & Answers

I am trying to get the total size of a folder?

I am trying to get the total size of the folder using the below command but its not working. any ideas? du -bc <foldername>/|grep total|tr -s " "|cut -d" " -f1 the output i am getting is 78996 total but i just want it to be as 78996 please help (3 Replies)
Discussion started by: classic
3 Replies

5. Shell Programming and Scripting

Security for applets files inside a folder

Friends I have a directory structure /a/b/c/applets/ This directory has .java, .class and other applet files. I gave the applets folder 755 permission because these applets are displayed at different web pages of a portal. Now I want to restrict the visibility of all the files in this... (0 Replies)
Discussion started by: dahlia84
0 Replies

6. Shell Programming and Scripting

Renumber position 88-94 inside all files matching criteria inside folder

There are 4 files inside one folder matching criteria i.e. File name = ABCJmdmfbsjopXXXXXXX_mm-dd-yyyy_XXX.data Here is the Code which find the files matching criteria:- TS=`date +"%m-%d-%Y"`| for fname in `find . -name "ABCJmdmfbsjop???????_${TS}*.data"` do # Matching File Processing Code.... (1 Reply)
Discussion started by: lancesunny
1 Replies

7. Shell Programming and Scripting

Total number of files in the folder should be listed

Hi All, When i give the ls -lrt to list out all files with total number of files , i get the output as ls -lrt total 72 -rw-r--r-- 1 hari staff 796 Jul 11 09:17 va.txt -rw-r--r-- 1 hari staff 169 Jul 13 00:20 a.log -rwxr-xr-x 1 hari staff 659 Aug... (9 Replies)
Discussion started by: Kalaihari
9 Replies

8. Shell Programming and Scripting

[Solved] Simple Shellscript for uploading files to a specific folder on a ftp-server?

hi! Iam using my D-link DNS-320 (NAS) with fun_plug installed (a unix client) I am currently using cron to run a shellscript running a java-application that creates a couple of txt files. These files needs to be uploaded to a specific folder on my webhosts ftp server-account. I need a... (16 Replies)
Discussion started by: Nigge
16 Replies

9. UNIX for Dummies Questions & Answers

How to get all the files inside a folder then put the value in a variable?

Hi here is my code for i in `ls *.cmd` do msg aaa imp -U$AAAUSER -P$AAAUSERPWD <$i>>$curdir/import_tap.out -Jutf8 done I can only get all files with .cmd extension. what i need to get are all the files inside the specific folder Thanks (2 Replies)
Discussion started by: cmarzan
2 Replies

10. Shell Programming and Scripting

Counting total files with different file types in each folder

Trying to count total files with different file types with thousands of files in each folder. Since some files do not have extensions I have to use below criteria. Count Total Files starting with --> "^ERROR" Count Total Files starting with --> "^Runtime" Count Everything else or files... (3 Replies)
Discussion started by: kchinnam
3 Replies
touch(1B)					     SunOS/BSD Compatibility Package Commands						 touch(1B)

NAME
touch - change file access and modification times SYNOPSIS
/usr/ucb/touch [-acfm] file... DESCRIPTION
touch sets the access and modification times of each file to the current time. file is created if it does not already exist. OPTIONS
-a Change the access time of file. Do not change the modification time unless -m is also specified. -c Do not create file if it does not exist. -f Attempt to force the touch in spite of read and write permissions on file. -m Change the modification time of file. Do not change the access time unless -a is also specified. USAGE
See largefile(5) for the description of the behavior of touch when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). EXIT STATUS
The following exit values are returned: 0 touch executed successfully and all requested changes were made. >0 An error occurred. touch returns the number of files for which the times could not be successfully modified. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
touch(1), attributes(5), largefile(5) SunOS 5.11 26 Oct 1995 touch(1B)
All times are GMT -4. The time now is 12:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy