I have recently taken on a new position and want to clean up several file locations that currently hold data back through 1999. While I need to keep this data for business reasons, I have created directories to help sort out the individual years. Is there a quick command that I can use to archive... (2 Replies)
Hi,
Can any one tell the command to list all the files that are created as of today from all the directories?
The Command "ls -ltR" is listing all the files.
But I want the list of files that has been created as of today along with the directory path:)
Thank you in advance.:)
Regards,... (4 Replies)
I need to figure out how to get all the files from a certian dir ./123/*sat files
and ./230/*sat files and several other directories which have these *sat files in them. I need to calculate how many were created today and how many yesterday from 2:00 pm on the 28th to 2pm on the 29th.
It's a... (1 Reply)
I have a listener (a batch job written in shell script) that calls a perl file (say apple.pl). The listener runs at scheduled timing (say 11 pm to 6 am)&.
Owner of the listener is a common id.
My question is..
Once the listener starts running (here, Im NOT attempting to generate any reports... (1 Reply)
Hello experts,
I have written following script to download files which created today.
Unfortunately, it's not working.
test.ksh:
#Defining variables
USR='xxx'
PASSWD='yyyy'
HT='test.test.com'
FILE='S*.pdf'
XFILE=$(echo find . -type f -mtime 0)
ZFILE=$(echo ls -tR|grep 'Jun 8')... (14 Replies)
Morning
My other issue I have seems very simple but im just not seeing it. I have a script that checks on a remote share to see if the backups for some systems have run. Its as simple as:
find /mnt/ukwcs-net-config/WLAN-Controllers/ -mtime -1 -ls | egrep '(cfg)' > wlanlog.txt
cut -c 1-92... (4 Replies)
Hi all,
In linux how to create a directory with specified size, so that it can be used only up to the mentioned size.
Actually my question is, whether we can do directory quota in linux.
mounting the directory in a partiton will do that, but do we have any other option... (1 Reply)
Hi, ALL
thanks in advance,
i listed all files using this command
ls -ltr $(date +%Y%m%d)*.xmlbut i would like to exclude the last one created ;
Best regard
MEROUAN
Use code tags, thanks. (4 Replies)
Hi,
I want to display the file names and the record count for the files in the 2nd column for the files created today.
i have written the below command which is listing the file names. but while piping the above command to the wc -l command
its not working for me.
ls -l... (5 Replies)
Discussion started by: Showdown
5 Replies
LEARN ABOUT LINUX
qsort
QSORT(3) Linux Programmer's Manual QSORT(3)NAME
qsort - sorts an array
SYNOPSIS
#include <stdlib.h>
void qsort(void *base, size_t nmemb, size_t size,
int(*compar)(const void *, const void *));
DESCRIPTION
The qsort() function sorts an array with nmemb elements of size size. The base argument points to the start of the array.
The contents of the array are sorted in ascending order according to a comparison function pointed to by compar, which is called with two
arguments that point to the objects being compared.
The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respec-
tively less than, equal to, or greater than the second. If two members compare as equal, their order in the sorted array is undefined.
RETURN VALUE
The qsort() function returns no value.
CONFORMING TO
SVr4, 4.3BSD, C89, C99.
NOTES
Library routines suitable for use as the compar argument include alphasort(3) and versionsort(3). To compare C strings, the comparison
function can call strcmp(3), as shown in the example below.
EXAMPLE
For one example of use, see the example under bsearch(3).
Another example is the following program, which sorts the strings given in its command-line arguments:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int
cmpstringp(const void *p1, const void *p2)
{
/* The actual arguments to this function are "pointers to
pointers to char", but strcmp(3) arguments are "pointers
to char", hence the following cast plus dereference */
return strcmp(* (char * const *) p1, * (char * const *) p2);
}
int
main(int argc, char *argv[])
{
int j;
if (argc < 2) {
fprintf(stderr, "Usage: %s <string>...
", argv[0]);
exit(EXIT_FAILURE);
}
qsort(&argv[1], argc - 1, sizeof(argv[1]), cmpstringp);
for (j = 1; j < argc; j++)
puts(argv[j]);
exit(EXIT_SUCCESS);
}
SEE ALSO sort(1), alphasort(3), strcmp(3), versionsort(3)COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2009-09-15 QSORT(3)