I was hoping to get some assistance with this C program I am working on. The goal is to find the largest file in the current directory and then display this filename along with the filesize. What I have so far will display all the files in the current directory. But, how do I deal with "grabbing"... (1 Reply)
I'm trying to find the 50 largest file in a directory named /sasdb and its' subdirectories. I'm using the find command and a pipe to awk
Not sure if I'm actually getting the largest files from this directory and its subdirectories. Here is the code I used...
find /sasdb -ls | awk '{print... (8 Replies)
Hi,
1)I have XX directory and have lot of files ,I want to find largest file in that
directory
2)how calculate the size of file in MB.
Thanks,
Mohan (15 Replies)
What is the correct command for finding and displaying the largest file on the system?
I don't know how to specify "largest" with "find", and pipe that to something that will display the file contents. Or should I be using cat, more, less, ls, or something else? (4 Replies)
Hello,
How to find the list of 5 largest(size wise) file in current directory?i tried using
ls -l | sort -t " " -r +5 -6 -n | head -5
but this is not giving correct output as ls -l command gives 1 extra line of output that is how many total files are there!so by running the above... (4 Replies)
Hello,
i am on linux 2.6.13-1.1526_FC4smp , and i would be very greatfull
if someone could help to find the largest files on that server.
I know i can find files with find command or list them with ls ,
but is there a way that i could list let's say 10 biggest files on server ?
:o (11 Replies)
What is the best way to find the largest files in a directory? I used du -k|sort -rn |less.
I got a results for this. But if I used the following command , I got another result...a different order in the same directory. Why is that?
ls -la |awk '{print $5," ",$9}' sort -rn|less. I saw that... (6 Replies)
Hi All,
Is there a direct Linux command to find the largest file by checking recursively in all the directories. (3 Replies)
Discussion started by: paragkalra
3 Replies
LEARN ABOUT ULTRIX
mktemp
mktemp(1) General Commands Manual mktemp(1)Name
mktemp - make a name for a temporary file
Syntax
mktemp [ -c ] [ -d directory_name ] [ -p prefix ]
Description
The command makes a name for the pathname of a temporary file and writes that name to standard output. The name will not duplicate that of
an existing file. The command does not create a new file. The file named must actually be created before can generate a new filename.
Subsequent calls to will only generate a new file name if all previously generated file names have been created by the user and still
exist. Error messages are written to standard error.
The directory_name generated by is the concatenation of a directory name, a slash (/), a file prefix, a dot (.), a four digit number and a
unique character.
The directory name is chosen as follows:
(1) If the -d option is specified, directory_name is used.
(2) Otherwise, if the TMPDIR environment variable is set and a string that would yield a unique name can be obtained using the value of
that variable as a directory name, this value is used.
(3) Otherwise, is used.
The prefix is chosen as follows:
(1) If the -p option is specified, prefix is used.
(2) Otherwise, if the LOGNAME environment variable is set, it is used as the prefix.
(3) Otherwise, the user's login name is used.
Options-c Causes to attempt to create a regular file using the generated (or created) name string. If file creation is successful, a zero
length file is created with access permissions derived from the process's file mode creation mask, see No attempt is made to
create a file if the length of the generated (or created) name string exceeds 1023 characters. It is the user's responsibility
to remove files created by use of this option.
-d directory_name
Causes directory_name to be used as the directory portion of the pathname. In this case, directory_name is used instead of
TMPDIR and
-p prefix Causes the string prefix to be used as the file's prefix. It is used instead of LOGNAM and the user's login name. If the pre-
fix is longer the 249 characters, it will be silently truncated to that length before the concatenation of the suffix.
Environmental Variables
LOGNAME When the -p prefix option is not specified, the value of this variable is used as the prefix of the filename, if it exists.
TMPDIR When the -d directory_name option is not specified, the value of this variable is used instead of
Restrictions
If the user does not have write permission in the directory specified, and error message is reported and is used in its place. The entire
path name can not exceed 1023 characters, and the temporary file name can not exceed 255 characters. If the generated file name is too long
it is truncated to fit before the suffix is added.
See Alsomktemp(1)