02-13-2008
Quote:
Originally Posted by
abhilashnair
I need to write a Unix shell script
You don't need a "script", it fits into a single line:
find /start/dir -type f -exec du {} \; | sort -rn | head -10
bakunin
This User Gave Thanks to bakunin For This Post:
7 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Let's get some feedback about the top ten ute's you guys use in writing your scripts - I mean yeah it depends on the job and what you're trying to accomplish, but there ARE those commands (sed, grep, awk, cut, etc.) that most will use time and again...
...so, what do you use? (3 Replies)
Discussion started by: diego
3 Replies
2. Shell Programming and Scripting
Hi,
I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern.
Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies
3. UNIX for Dummies Questions & Answers
What's the maximum file size supported by unix. (3 Replies)
Discussion started by: nagalenoj
3 Replies
4. Shell Programming and Scripting
Hi,
I am new to Unix.
I want to display top 10 folders by size.
I tried with
du -ksl * | sort -nr | head -10
command .But I am getting the following error
-bash: /usr/bin/du: Argument list too long
Can some one help me.
Thanks. (5 Replies)
Discussion started by: Satyak
5 Replies
5. Shell Programming and Scripting
Hello member's
I'm learning to script in the ksh environment on a Solaris Box.
I have 10 files in a directory that I need to pass, as input to a batch job one by one. lets say, the files are named as follows:
abcd.txt ; efgh.bat ; wxyz.temp etc. (random filenames with varied extensions ).... (1 Reply)
Discussion started by: novice82
1 Replies
6. Shell Programming and Scripting
Hi All,
O/S: Linux 86x64 Red Hat
I have a sql script that queries top consuming processes of Linux using TOP commnd.
Now I need to automate this task and pass the top processes i.e., PID to the sql script through unix shell script.
Could anyone please let me know how to achieve this.
... (2 Replies)
Discussion started by: a1_win
2 Replies
7. Shell Programming and Scripting
Hello,
I have a shell script like the one below but cannot get it working:
#!/bin/bash
#$ -cwd
CHR=$2
# directories
ROOT_DIR=./
RESULTS_DIR=${ROOT_DIR}results/
# executable
SHAPEIT_EXEC=${ROOT_DIR}shapeit.v2.r727.linux.x64/shapeit.v2.r727.linux.x64
# parameters
THREAT=5... (1 Reply)
Discussion started by: wmelroy
1 Replies
LEARN ABOUT DEBIAN
fitscheck
fitscheck(1) PyFITS 3.0.7 fitscheck(1)
NAME
fitscheck - script to detect and fix FITS standards violations
SYNOPSIS
fitscheck [OPTION]... [FILE]...
DESCRIPTION
fitscheck is a command line script based on pyfits for verifying and updating the CHECKSUM and DATASUM keywords of FITS files. itscheck
can also detect and often fix other FITS standards violations. fitscheck facilitates re-writing the non-standard checksums originally gen-
erated by pyfits with standard checksums which will interoperate with cfitsio.
fitscheck will refuse to write new checksums if the checksum keywords are missing or their values are bad. Use --force to write new check-
sums regardless of whether or not they currently exist or pass. Use --ignore-missing to tolerate missing checksum keywords without com-
ment.
OPTIONS
-h, --help
Display terse usage information (help).
-k [standard | nonstandard | either | none], --checksum=[standard | nonstandard | either | none]
Choose FITS checksum mode or none. Defaults to standard.
-w, --write
Write out file checksums and/or FITS compliance fixes.
-f, --force
Do file update even if original checksum was bad.
-c, --compliance
Do FITS compliance checking, fix if possible.
-i, --ignore-missing
Ignore missing checksums.
-v, --verbose
Generate extra output.
EXAMPLES
% fitscheck --checksum either --write *.fits
Verify and update checksums, tolerating non-standard checksums, updating to standard checksum.
% fitscheck --write --force *.fits
Write new checksums, even if existing checksums are bad or missing.
% fitscheck --compliance *.fits
Verify standard checksums and FITS compliance without changing the files.
% fitscheck --checksum nonstandard *.fits
Verify original nonstandard checksums only.
% fitscheck --checksum none --compliance --write *.fits
Only check and fix compliance problems, ignoring checksums.
% fitscheck *.fits
Verify standard interoperable checksums.
% fitscheck --checksum none --write *.fits
Delete checksum keywords.
fitscheck June 2012 fitscheck(1)