General :: Shell Script To Find A File Size?
Jul 20, 2010
am trying to write a shell script to find the size of a particular log file and if the log size grows, script should mail the changes to the administrator or a any user so script should monitor the log file continuously in a time interval, how can i do that?
I tried with these codes to find the file size but it throws me error says command not found
$s=$( stat -c %s mylogfile.log)
echo $s
View 10 Replies
ADVERTISEMENT
Apr 8, 2011
How to find the filesize of a flash which is not exactly stored in the temp but redirected by a fd.
flash31 -> /tmp/FlashXXvsg1uY (deleted) directory is /proc/processid
Chrome is downloading a flash and I can see in the proc directory the flash file, How can I see the current file size of such a file ?
View 1 Replies
View Related
May 22, 2011
I created a VM disk image with kvm-img, but I forget what was the max size of that disk image when I created it. Currently, its size is 6.2G, I want to install some large packages in that VM, so I want to make sure the disk image can expand to an adequate size.
View 1 Replies
View Related
Nov 3, 2010
the below tag is in the xml file. Now i want to find and extract the value of application name test1 and test2 one by one in the unix shell script. how to do this
<application name="test1">
</application>
<application name="test2">
[code]...
View 2 Replies
View Related
Apr 13, 2010
I'm relatively experienced with UNIX and Linux, but this has me thrown for quite a loop, and it seemed like such a simple question. How would I go about finding the newest file in a file system? I thought something like:
Code:
ls -ltr `find /usr -type f`
would work, but I seem to be exceeding the argument maximum for ls:
ksh: 0403-029 There is not enough memory available now
I thought something involving xargs might work, but I really suck with that command.
View 3 Replies
View Related
Jan 21, 2009
I have a file that's supposed to be growing in size 24/7. I want to check every 10 minutes via cron that it's actually growing. If not, send an email. Does anyone know how to write a script to do that?
View 3 Replies
View Related
May 18, 2011
shell scripting in Fedora14I want a script"Find in curent folder for files, and it copy first file he find with name gived by user, if name already exist then echo error message and finish"command usage " bash scriptname copyASname"
smthing like Code: #!/bin/bash
for files in /home/user/*
do
[code]....
View 1 Replies
View Related
Oct 14, 2010
In a shell script, I am creating a .tar using this command
Code:
tar -zcvf dst/lib/library.tar.gz dst/lib
There are two problems:
[code]...
View 1 Replies
View Related
Jan 23, 2010
I am trying to learn shell scripting. What does the dollar sign mean, and these signs {}
DEST="${DST}`date +%F`/"
View 11 Replies
View Related
Sep 10, 2010
When i change the directory using 'cd', the length of my shell prompt keeps on increasing. To make it more clear kindly see below
Code:
$> cd MyWorks
$ Myworks> cd Shell
[code]....
View 8 Replies
View Related
Jul 3, 2009
I am trying to find / write a shell script that will go through a file organized like this (but with thousands of lines)...
93,5.00,"contig00002",169,83,"jgi|Brafl1|100379|fgenesh2_pg.scaffold_359000019"
579,1.00,"contig00003",3,380,"jgi|Brafl1|114745|estExt_fgenesh2_pm.C_1200006"
450,5.00,"contig00007",2,352,"jgi|Brafl1|274326|estExt_GenewiseH_1.C_8420008"
...and check the region of each line between the second and third pipes (the 6-digit numbers) against the values in the first column of a separate text file in CSV format like this...
274326,"Wnt family of developmental regulators"
114745,"FOG: Hormone receptors"
100379,"Transcription factor tinman/NKX2-3, contains HOX domain"
...and when they match, replace the value to the right of the third pipe (e.g., fgenesh2_pg.sca...) with the value in the second column in the CSV file associated with that number.
View 4 Replies
View Related
Jun 8, 2011
To find the space occupied by files modified more than 4 years ago, i tried following.I am wondering if it is right ?
Code:
find /temp -type d ! -name ".*" -mtime +1460 | wc -l |du -sh
I tried this, but this sits there for long time (of couse the path i tried has lot of files) So i am not sure if this is right.
P.S.:
SHELL=bash
OS=RHEL5
View 9 Replies
View Related
Jan 8, 2010
I can display the RPM installed on CentOS 5.4 though:
Code:
#rpm -qa| more
How can I know the size of those RPMs?
View 1 Replies
View Related
May 18, 2010
i need help in this issue how to find files with unusual size and with unusual names of EX : just dots, names ending with space(s),names containing shell wildcard characters, names containing non-ASCII (control) characters
View 3 Replies
View Related
Jan 16, 2010
I cannot find what my hard drive size is and need to know what size is my Ram.
View 4 Replies
View Related
Apr 15, 2010
I made an account under freeshell.org and it has been very satisfactory so far. I recommend everyone getting an account under freeshell.org. But anyways, how do I find files over, for example, 500 KB, in the entire, my shell account?
View 1 Replies
View Related
Jun 10, 2010
Are there software that can split big file size into small file size in Linux?
View 1 Replies
View Related
Jun 13, 2011
I was just testing specifying limit on file size to a user and have added the following to /etc/security/limits.conf bob soft fsize 100 This basically should have said not to allow bob to create anyfile greater than 100Kb in size.
But the interesting thing is, if bob already has any file which is greater than 100Kb in size, it even doesn't allow to log him into the system both from console and SSH. Also nothing is logged in logs.. How do I configure it so that, bob can login to the system even though he has any file greater than 100Kb (but doesn't allow him to create file which are greater than 100Kb) ??
View 3 Replies
View Related
Dec 6, 2010
I have two shell scripts:
sh1.sh
echo "First script"
echo "Now calling second one"
sh2.sh
sh2.sh
echo "Second script"
In this shell script, I want to print out which shell script called this. In this case, sh1.sh called sh2.sh. So, I want to print out "sh1.sh".How to achieve?
View 1 Replies
View Related
Apr 17, 2011
I was trying to find a shell script that will encode video to a an iso that I can burn for a dvd. It seems I have lost a few of my dvds and I backed them up into mkv and I need to convert it to pal so it will work until I find them. My search was leading to other formats, but I was wanting to use pal because it is smaller. My search lead me here, but this shell script is not in pal.I need a solution that would work with slackware.
View 2 Replies
View Related
Jan 19, 2011
is lvresize with --resizefs options re-size the Logical Volume and then re-size the file system? i mean we don't need to use resize2fs?I looked at man pages but it doesn't explain this option.
View 3 Replies
View Related
Dec 14, 2010
How can we find the maximum size of the inode table and what decides it, and how the maximum size of volume of file system is decided ?
View 4 Replies
View Related
Dec 9, 2008
How can I read .gz file direct on shell/terminal without decompressing the file?
satimis
View 5 Replies
View Related
Mar 30, 2010
I need a shell script that will add the users name and date to a file when the user has modified the file, these files are within a group and only accessible to this group. But we need a way for people in the group to know who and when the file was last modified.
View 1 Replies
View Related
May 23, 2011
i am trying to convert a binary file in to ASCII using shell script. this file contains multiple types of data like string, number, bcd, etc.
View 5 Replies
View Related
Jun 5, 2010
I have a Canoscan LiDE 30 scanner which works fine in Linux. I haven't used it in months, and never since moving from Jaunty x86_64 to Fedora 11 x86_64. This evening I suddenly need to scan two pages to send to someone via e-mail, and the recipient is desperate to receive them. Naturally, Xsane has decided this is the moment to screw me.
The problem: I cannot figure out how to tell Xsane that the page size is 8.5 11. It insists on scanning only the left side, 3.99 x 11. I cannot find a page size anywhere in any of the buttons.
In Preview I once got it to scan the entire page, but could not figure out how to save the image to file. Subsequently I have not been able to figure out how I did it. In any event, scanning from the small main window always scans 3.99 x 11. Adjusting the scan area manually in the Preview window allows me to change the size area in the small main window to 8.5 x 11, but when I then scan from the small main window it reverts to 3.99 x 11.
I have scanned the document a hundred times at least, each time trying different buttons, but nothing has succeeded in getting the full page.
View 5 Replies
View Related
May 11, 2011
I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.
Should I be looking to concatenate the files into one file with the file names included, and then print them?
something like: -printfunction -printername < file*
View 7 Replies
View Related
Jan 28, 2010
I wrote a small script that gets me the list of enabled system accounts in my system.
I figure '*' & '!' (in field #2 of /etc/shadow) mean that the account is disabled or they cannot login, hence 'safe-to-ignore'
Code:
IFS=$'
'
for i in `cat /etc/passwd` #get each line in the passwd file
do
var1=`echo $i | cut -d':' -f3` #get user ID field
if [ $var1 -lt 500 ] && [ $var1 -gt 0 ] #compare to extract relevant IDs
[Code].....
BTW i figure the following command gives me the list of system users, but i am not able to find a way to process it further... :-(
Code:
awk -F":" '$3 >= 1 && $3 < 500 { print $1 }' /etc/passwd
View 3 Replies
View Related
Apr 7, 2010
I need to find TCSH shell and gzip version number by running a acript on several boxes through ssh. How can i do that? I made a script for tcsh but it is not working by ssh , it only works on my box . I dont know from where to find the gzip version info.
View 5 Replies
View Related
Aug 1, 2010
this is srinath,newbie to linux and shell scripts.am in need of shell script,which have to checkout the source code(C/C++) from CVS server to a specified directory and compile that source code and get all its dependency files to a specified directory.
View 2 Replies
View Related