General :: Find -mtime Gives Unexpected Results?
Aug 12, 2010Code:
$ ls -l
-rw-r--r-- 1 username vuser 35553 Aug 9 18:15 note.20100809_1815.sql
[code]....
Code:
$ ls -l
-rw-r--r-- 1 username vuser 35553 Aug 9 18:15 note.20100809_1815.sql
[code]....
I sorted a large mailing list and the result is in almost sorted order, but not quite.The sort was invoked in the default manner, just "sort".See (below) a segment of the output file.(Note: the actual files have a street address following each name.I have omitted the addresses to avoid complaints about disclosing personal information on-line.) I expect all people named KATZ to be grouped together, but they aren't. This phenomenon occurs elsewhere in the output file, so it has nothing to do with surnames beginning with the character string KATZ.
View 5 Replies View RelatedI've got a script where I have to parse out the last modified time for a large amount of files. Piping the output for "ls" into "cut" seems to work most of the time, but the output is unpredictable.The "fields" argument doesn't find the date modified columns consistently, and using character count is as well since the output can vary in width depending on the file name
View 3 Replies View RelatedI am writing a bash script which includes the find (and rm command with exec) command the options -mtime -15 or +15 so that files older 15 days must be deleted from the home directory. I think that -mtime +15 should be ok, but in which case does the option -mtime -15 really come in handy?? go back 15 days until today's date?
View 1 Replies View RelatedI need to delete all *.trc files that are older than 30 days and I am getting a "Argument list too long" error. There are other files that should not be deleted which is why I am using the "*.trc" and newer files need to be kept as well. I have seen other postings but they do not cover both of the conditions. Below are 2 of the many attempts at doing this but I cannot get this to work.
find *.trc -mtime +31 -print| xargs rm -f {}
find *.trc -mtime +31 -print -exec rm -f {} ;
I'm very very tired, worked all night long, and I did't sleep for hours... So I'm like a zombie now... half awake, and half asleep.
I was trying to clear a directory. Then I run the command cd to enter the directory, and then before thinking I run this dangerous command. on my Linux server: "find / -mtime +1 -exec rm {} ;"
I got a lot of:
Could this command have deleted something inside these directories? I'm afraid that the next reboot the server won't startup...
I have some files on server with the date several months ago, but invisible for `find -mtime 7` search. When I list them as `ls -l` they look perfectly normal:
-rw-r--r-- 1 root root 347253 Jun 12 16:26 pedia_main.2010-06-12-04-25-02.sql.gz
-rw-r--r-- 1 root root 490144578 Nov 24 16:26 gsmforum_main.2010-11-24-04-25-02.sql.gz
"find -mtime" does not work as expected on files with different timezones?
so I was wondering how I could do a simple find which would order the results by most recently modified. Here is the current fine I am using. (I am doing a shell escape in php, so that is the reasoning for the variables. find '$dir' -name '$str'* -print | head -10
How could I have this order the search by most recently modified. (Note I do not want it to sort 'after' the search, but rather find the results based on what was most recently modified)
I wanted to supply mplayer with the output of find command as arguments. The error returned showed spliced names of files whenever spaces occurred. I have subdirectories in my /home/my_user_name/Music/ directory, and in them multiple *.oga music files. The actual command that I issued was
Code:
mplayer $(find /home/my_user_name/Music/ -name "*.oga")
mplayer started but then was looking for broken file names. I am thinking quoting has to do with it to preserve the filename as one string but different attempts were met with inroads:
Code:
mplayer `find /home/my_user_name/Music/ -name "*.oga"`
gave me the same result and
Code:
mplayer `"find /home/my_user_name/Music/ -name *.oga"`
complained about wrong mplayer syntax.
I'm trying to do a
find /photos/* -type f -mtime +365
to find all my pictures that are over a year old, but I keep getting argument list too long. How can I view what all the results are, even if it just dumps it to a file that I have to open?
If I do something to the effect of this:ldapsearch -b "dc=example,dc=com" -x -z 3000
I'll get this back at the end of the result set:
# search result
search: 2
result: 4 Size limit exceeded
The thing is is that I have way more (thousands) than what's being displayed here. And I've tried to mess around with /etc/ldap.conf, changing the SIZELIMIT directive to something else, 10000, let's say, and restarting the server, but the same goddamn thing happens.
I've been messing around with this for quite some time now, hopefully someone will be able to shed some light on this so that I can learn my way out of this mess that is LDAP. Also in a related matter, I'm running Mint (based off of Ubuntu), and all the documentation that I've seen (probably read a good 100+ pages in a few days now on this) keeps telling me to make changes to my slapd.conf file. What slapd.conf file? It doesn't exist, I can't find it at least. find / -name slapd.conf turns up nothing.
So when I press Super + F I get "Search Files & Folders" but I don't get any results when I search for files/folders I know are in my home folder.
Am I missing something, do I need to install any other packages for this to work?
I'm timing how long it takes to run a command foo. I'm looking to append the results from the time command to a file, and discard the results from the foo command. I tried the following, but it didn't do what I want:
$ time ./foo > /dev/null >> output_from_time_command.txt
Is there an easy way to do a recursive command line search on a path for a particular type of file extension?I want to build a script that will check for the existence of any .xxx files in a recursive path, if they exist, I would like to run the "mail" command to send me a message. I already have mail running on he server.My thoughts were to tryQuote:ls -R |grep .iniorQuote:find . |grep .inibut neither of those return only the .ini files, they also return files that are named such as .ini.bak, .ini.original, .ini.old, ect...
View 2 Replies View RelatedI had created a tar ball of my home folder. But after formatting the system when I tried to untar it, it is showing the following error:
Code:
How to somehow recover my home folder!
From last few days i am getting some log messages in /var/log/messages. The log is .... unexpected rcode (SERVFAIL) from master 192.168.110.8#53 I am not sure what is it.
View 8 Replies View Relatedwhile doing socket/network programming, i am getting SSH-2.0-openssh4.7 error, instead of showing day time of server.general description i have Linux Box, with the help of putty i am connecting from windows system to Linux box,no problem in loging,after typing program, i am running the program with gcc. when typing ./a.out, it is showing SSH-2.0-openssh4.7, actually it should display daytime from linux box in both tcp and udp.
View 1 Replies View RelatedRHEL 5.4. I'm facing the following error after rebooting the server:
/dev/VolGroup01/u04: UNEXPECTED INCONSISTENCY Run fsck Manually"
*** An error occurred during the file system check.
*** Dropping you to a shell: the system wil reboot
*** when you leave the shell.
give the root password for maintenance:
-Previously I performed a lvreduce command on a LV, after the lvreduce, I reboot the server.
-After login as root I run:
e2fsck -f /dev/VolGroup01/u04
But, it shows:
The filesystem size (according to the superblock) is 5218304 blocks
The physical size of the device is 1310720 blocks ...
either the superblock or the partition table is likely to be corrupt
abort<y>? no
pass 1: cheking inodes, blocks, and sizes
error reading block 1310722 (invalid argument) while doing inode scan
inore error <y>? y
-Additionally, trying to lvdisplay, it shows:
Locking type -1 initialization failed
I have no important data on that LV, but I can not boot the server properly.
find /opt/postfix/mail/email.com/~spam/~quarantine/ ( -iname * -o -iname .* ) ! -type p -exec grep -i -c admin@email.com {}; -xdev -print
When I do this command I receive this error message:
-bash: syntax error near unexpected token `('
I wrote a script to start portal.
Its start portal (not a problem)
Only getting following message:
This is the else before second logic
Can't install linux on PC. Get the massage "Starting udev... udevd-work[137]: 'sbinblkid -o udev -p/dev/tmp-blo k-7:14' unexpected exit with status 0x000b.
View 3 Replies View RelatedI'm trying to install the Sun Java plugin to use in Chrome. The installation seems to have gone well, but I have hit an error trying to create a symbolic link of the libnpjp2.so library in the plugins directory of Chrome.
When typing in "in -s /opt/java/jre1.6.0_26/lib/i386/libnpjp2.so" I get "Syntax error near unexpected token `in' ". I'm not sure what could be wrong, I'm in the right directory.
I tried to remove a folder in linux, davidanderson'spetshop_617 as a folder name. It contained a single quotes. By using the following command
rm -r path/davidanderson'spetshop_617
I am getting this error ,Error: unexpected EOF while looking for matching `''unexpected end of files.How can i remove the folder?
In my case, it occurs intermittently when trying to connect using putty's command line client 'plink.exe' to a linux machine using ssh. For some testing purposes, a linux server is setup with 8K virtual ip addresses and the testing scripts will connect to these ip addresses through ssh using plink.exe. There will be concurrently 25 ssh sessions launched to the server. While it works for sometimes, it throws 'server unexpectedly closed network connection' error intermittently. If the same ip address is tried again manually, it works. While the ssh server is accepting connections, this error is thrown sometimes and unable to find out the reason from the logs. It is not that the ssh connection is completely blocked. It gives this error message while connecting to some of the virtual ip addresses but works some times.
The hosts.deny, sshd_config are tuned to allow the connections, allow more sessions etc.
I am trying to install vlc media player on my backtrack3 but when i am giving a command xvjf to extract bz2 file then
bash: syntax error near unexpected token `('
I have been trying to get the following code to run.
Code:
However I am getting the following error:
Is there something that I am missing in the script? I have it as a unix file and tried to make sure that I did not have any extra characters.
I was checking /opt and then found something unusual. Below are the results of du and df -h,
Code:
$sudo du -h /opt/|tail -3
1.1G /opt/IBM
[code]....
I am repeatedly getting error:
I need to pass the value of:
I am using #!/bin/bash
This command works on shell without any issue.
My website can`t open because of the error, Parse error: syntax error, unexpected T_STRING in /home/dodonet2/public_html/includes/config.php on line 45.
View 8 Replies View Related