Sponsored Content
Top Forums Shell Programming and Scripting Checking for substring in a loop takes too long to complete. Post 303039766 by Peasant on Tuesday 15th of October 2019 03:16:28 AM
Old 10-15-2019
How long does ls -d "/app/scripts"/* last, how many files are inside ?

What are your operating system and shell details ?
With what options is the filesystem mounted ?

Regards
Peasant.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Killing a process that takes too long

Hello, I have a C program that takes anywhere from 5 to 100 arguments and I'd like to run it from a script that makes sure it doesnt take too long to execute. If the C program takes more than 5 seconds to execute, i would like the shell script to kill it and return a short message to the user. ... (3 Replies)
Discussion started by: WeezelDs
3 Replies

2. Shell Programming and Scripting

shell script takes long time to complete

Hi all, I wrote this shell script to validate filed numbers for input file. But it take forever to complete validation on a file. The average speed is like 9mins/MB. Can anyone tell me how to improve the performance of a shell script? Thanks (12 Replies)
Discussion started by: ozzman
12 Replies

3. UNIX for Dummies Questions & Answers

time how long it takes to load a module

Hello, like the title says, how can i measure the time it takes to load a module in Linux, and how how can i measure the time it takes to load a statically compiled module. /Best Regards Olle ---------- Post updated at 01:13 PM ---------- Previous update was at 11:54 AM ---------- For... (0 Replies)
Discussion started by: ollebanan
0 Replies

4. Shell Programming and Scripting

sort takes a long time

Dear experts I have a 200MG text file in this format: text \tab number I try to sort using options -fd and it takes very long! is that normal or I can speed it up in some ways? I dont want to split the file since this one is already splitted. I use this command: sort -fd file >... (12 Replies)
Discussion started by: voolek
12 Replies

5. UNIX and Linux Applications

database takes long time to process

Hi, we currently having a issue where when we send jobs to the server for the application lawson, it is taking a very long time to complete. here are the last few lines of the database log. 2012-09-18-10.35.55.707279-240 E244403536A576 LEVEL: Warning PID : 950492 ... (1 Reply)
Discussion started by: techy1
1 Replies

6. Shell Programming and Scripting

Wget takes a long time to complete

Hi, I wish to check the return value for wget $url. However, some urls are designed to take 45 minutes or more to return. All i need to check if the URL can be reached or not using wget. How can i get wget to return the value in a few seconds ? (8 Replies)
Discussion started by: mohtashims
8 Replies

7. UNIX for Advanced & Expert Users

Find command takes too long to complete

Hi, Below is my find command find /opt/app/websphere -name myfolder -perm -600 | wc -l At time it even takes 20 mins to complete. my OS is : SunOS mypc 5.10 Generic_150400-09 sun4v sparc SUNW,T5440 (10 Replies)
Discussion started by: mohtashims
10 Replies

8. Shell Programming and Scripting

Find command takes long

Hi, I am trying to search for a Directory called "mont" under a directory path "/opt/app/var/dumps" Although "mont" is in the very parent directory called "dumps" i.e "/opt/app/var/dumps/mont" and it can never be inside any Sub-Directory of "dumps"; my below find command which also checks... (5 Replies)
Discussion started by: mohtashims
5 Replies

9. Shell Programming and Scripting

Script takes too long to complete

Hi, I have a lengthy script which i have trimmed down for a test case as below. more run.sh #!/bin/bash paths="allpath.txt" while IFS= read -r loc do echo "Working on $loc" startdir=$loc find "$startdir" -type f \( ! -name "*.log*" ! -name "*.class*" \) -print | while read file do... (8 Replies)
Discussion started by: mohtashims
8 Replies

10. UNIX for Beginners Questions & Answers

Finding largest files takes too long

Good evening. because the folder has thousand of files it takes too long and have some trouble to get the largest files and then compress files or delete it, for instance find . -size +10000000c -exec ls -ld {} \; |sort -k5n | grep -v .gz The above commad took an hour and i have to cancel... (10 Replies)
Discussion started by: alexcol
10 Replies
sg_get_fs_stats(3)					     Library Functions Manual						sg_get_fs_stats(3)

NAME
sg_get_fs_stats - get filesystem statistics SYNOPSIS
#include <statgrab.h> sg_fs_stats *sg_get_fs_stats(int *entries); DESCRIPTION
The sg_get_fs_stats takes a pointer to an int, entries, which is filled with the number of mounted file systems the machine has. The return value is a pointer to the first member of an array of sg_fs_stats structures; the number of entries in the array is returned in entries. The function returns statistics about mounted filesystems, including free space and inode usage. RETURN VALUES
sg_get_fs_stats returns a pointer to a structure of type sg_fs_stats. typedef struct { char *device_name; char *fs_type; char *mnt_point; long long size; long long used; long long avail; long long total_inodes; long long used_inodes; long long free_inodes; long long avail_inodes; long long io_size; long long block_size; long long total_blocks; long long free_blocks; long long used_blocks; long long avail_blocks; } sg_fs_stats; device_name The name known to the operating system. (eg. on linux it might be hda) fs_type The type of the filesystem. mnt_point The mount point of the file system. size The size, in bytes, of the file system. used The amount of space, in bytes, used on the filesystem. avail The amount of space, in bytes, available on the filesystem. total_inodes The total number of inodes in the filesystem. used_inodes The number of used inodes in the filesystem. free_inodes The number of free inodes in the filesystem. avail_inodes The number of free inodes available to non-privileged processes. io_size A suggested optimal block size for IO operations -- if you're reading or writing lots of data, do it in chunks of this size. block_size How big blocks actually are on the underlying filesystem (typically for purposes of stats reporting). total_blocks The total number of blocks in the filesystem. free_blocks The number of free blocks in the filesystem. used_blocks The number of used blocks in the filesystem. avail_blocks The number of free blocks available to non-privileged processes. SEE ALSO
statgrab(3) WEBSITE
http://www.i-scream.org/libstatgrab/ i-scream $Date: 2005/07/13 13:01:23 $ sg_get_fs_stats(3)
All times are GMT -4. The time now is 09:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy