General :: Delete All But 10 Newest Files?

Apr 8, 2011

I'm trying to keep a directory full of log files manageable. Nightly, I want to delete all but the 10 most recent. How can I do this in a single command?

View 2 Replies


ADVERTISEMENT

General :: Delete All Files (except The Four Newest) Throughout Directories Using A Bash Script?

Aug 16, 2011

I'm looking for a Bash script that will go into a list of directories and delete all but the four most recently created files.

How can I do this?

View 4 Replies View Related

General :: Rsync Only Newest N Gb Of Files?

Jul 27, 2011

I have two directories, dirA whicht contains N gb of data and dirB which is supposed to contain only the newest M gb of data from dirA. When files are added to dirA, they sould also be added to dirB, while the oldest files in dirB should be deleted.Is that possible with rsync? or any other software?

View 1 Replies View Related

Ubuntu :: Delete (the Newest Version, The Only One OS On PC) And Install XP After That?

Sep 1, 2011

I tried to delete Ubuntu (the newest version, the only one OS on my PC) and install XP after that. I booted from USB and deleted one partition that contained Linux (formated it to ntfs) files using gparted. When I wanted to boot from Windows installation CD, i got the following message:Unknown file system:Grub rescue> I dont know how to proced with installation of XP, it seems it can not boot from my CD.

View 9 Replies View Related

General :: Rsync N Newest Files In A Directory?

Nov 8, 2010

What would be the easiest way to go about rsyncing the n newest files in a directory to a remote server?

View 2 Replies View Related

General :: Wget / Delete Files / Getting Bunch Of Filefolders, But No Files, Ex."cccamp07-de-1845?

Oct 11, 2010

I am trying to dl the files located here: http://good.net/dl/bd/CCCamp-2007/video/m4v/ using wget.

Now when I use the command wget -r -A .m4v http://good.net/dl/bd/CCCamp-2007/video/m4v/

I get the just a bunch of filefolders, but no files, ex."cccamp07-de-1845-Freifunk_und_Recht.m4v" but its a folder.

View 4 Replies View Related

General :: Possible To Delete All The Files Including System Files As Root?

Sep 21, 2010

If I am logged in as root in a linux system and I run command rm -rf on / folder, should it remove all the files? also the kernel?

View 4 Replies View Related

Programming :: Bash Script To Find Newest Files And Count Them?

Feb 25, 2010

I'm working on a bash script that will go through a directory, find the sub-directories that have been created since the last time the script ran, count the results, and output that integer (will most likely be '1' or less per each instance run) to a file. Give the circumstances, my previous (and very limited) experience with bash is not sufficient for me to pull this off. since it probably has bearing, is that my mail server stores files that it flags as viruses in a folder. It creates a sub-directory for each virus that it quarantines .I want to count those subdirectories and graph them with MRTG. Hence the script. I'm going to post what I've got so far and the purpose of it, because I'm told I have a very odd and efficient way of doing scripting.

[Code]...

But then it dawned on me that it wouldn't work because I would have to not count the directories that have already been counted and count the ones that have not been counted. Given that the purpose of this is to generate a graph about every 5 minutes, using find won't work because, to my knowledge, that will only find things based on whole day values, I need it almost down to the minute.

View 1 Replies View Related

Ubuntu :: Rsync --delete Doesn't Delete Superflous Files

Sep 25, 2010

I am trying to use an old box as backup server. I have tried a couple of possibilities along the lines of:

Quote:

rsync -a --delete --progress --log-file=/home/$USER/info.txt -e ssh /home /etc root@192.168.0.106:/mnt/back

The problem is it does not delete files that has been removed from my local system?
I run the command as root on the local system.

(I realize I should properly not ssh into the server as the server's root but I'm having trouble with the permissions and I want to make sure everything else works before messing around with it)

View 2 Replies View Related

Ubuntu :: Can Delete These 'un-delete-able' Files In Trash?

Nov 1, 2010

I just can't stand knowing that there's a slight problem with my PC.I have roughly 12.5 Gigs of files, mostly movies that are multiple clones of a particular movie (which was an entirely different problem altogether) and I CANNOT DELETE THESE THINGS! There has to be a simple way to do it from terminal, problem is, I can't seem to find the trash directory in terminal.

View 3 Replies View Related

General :: Automatically Delete Log Files?

Apr 9, 2011

I have a script running as a cronjobIt outputs logs upon each run to /var/log/mylog.logIs there anyway I can delete this or compress it when it gets too large?A cheap and dirty way is to setup another cronjob to delete the log every X interval.... although I'm not sure if that's the proper way

View 3 Replies View Related

General :: Delete All My Windows Files?

Mar 8, 2011

I would boot up windows and do it but window will no longer open my system crashed and was only able to recover linux. i open up system info and 31 gig of memory are used up on windows. i try to delete them but the option doest pop up and the delete key will not work. how can i remove all the windows files without deleting any of my linux stuff? if its possible.

View 15 Replies View Related

General :: Delete A File Or Certain Files Using Php?

Apr 28, 2011

i wanna ask on how to delete a file or a certain file in linux by using php or in other word by using web browser. example i want to delete the file inside /var/www/cgi-bin/ with browser.

View 14 Replies View Related

General :: Delete Files In A Directory - RM?

Jun 17, 2010

I have a USB drive that I boot using SysLinux. I think select one of several options to complete a task. I do not have access to edit those Kernels. I need to add a option from the Syslinux menu where I can delete all the files from a specific directory.

View 3 Replies View Related

General :: Delete Files Which Have No Extensions?

May 30, 2010

how to delete only files which have no extensions in the directories. but other files should exist.

View 12 Replies View Related

General :: Delete Hidden Files I Have 2 In My PC?

Feb 10, 2011

What should do? Or how to delete that I have 2 hidden in my PC?
I know nothing that's why please tell me detail if some one know about it?

View 5 Replies View Related

General :: How To Delete Selected Files?

Feb 10, 2010

Assumed I have the following files:

test12.txt
test13.txt
test14.txt
test15.txt

I want to delete the first 3 files with one command. How to do that?

View 8 Replies View Related

General :: Delete Temp Files Using Rm -rf?

Apr 14, 2010

i am trying to delete temp files using rm -rf but i am getting this error "bash: /usr/bin/rm: Arg list too long"

View 11 Replies View Related

General :: Recover Delete Files

Nov 11, 2010

Is this possible someone delete one file or folder in linux server its automatically stored one path like recyclebin.

View 5 Replies View Related

General :: Delete Matching Files In All Subdirectories?

Feb 22, 2010

How can I remove all .swp files in all of my subdirectories under Linux?

View 4 Replies View Related

General :: Can I Delete Files Created By Others In A Directory I Own

Jul 23, 2010

I created a directory somewhere with permissions rwxrwxr-x so that other users in my group can create files and directories in it.

I do need to be able to delete the contents in this "public" directory, but it seems that while I am able to remove any files in this directory I cannot remove and subdirectories under it.

Is there a way to remove such subdirectories owned by others under a directory owned by me?

View 3 Replies View Related

General :: Delete Files Older Than 1 Year?

Sep 24, 2010

Possible Duplicate:How do I delete files greater than a certain date on linux How to delete all files in current directory and it`s sub directories older than one year ?

View 2 Replies View Related

General :: Loop Through A DIR To Delete Files By Inode

Feb 9, 2010

I have a directory that contains some files (over a 1,000) that have a '' in the filename. There are also some good files that I need to keep. therefore I need a script to delete based on inode.

What I have thus far:
list="$(ls -il /opt/PC/log/*RPOUT*.xml)" #this gives me the list
# I need to get the inode of.
for i in $list
do
find . -inum $i -exec rm -i {} ;
echo "delete file" $i >> /home/me/tmp/del_inode.txt
done
echo 'completed'

I know this is not right ... what I know is is the 'find' is. I need to loop through the $list gleaning inodes to get all the files with '' delete. I'm not sure how. The $i gives me the whole line. I just want the first position. set $() does not seem to work ...

View 5 Replies View Related

General :: Cannot Copy,cut,paste And Even Delete Files?

Mar 16, 2010

I just installed Fedora11 with the KDE desktop and completed a yum update. Every time i try to copy and paste files and even delete files from a file manager or my desktop, I get this error:Quote:Could not start process Unable to create io-slave:klauncher said: Error loading 'kio_trash'.or thisQuote:Could not start process Unable to create io-slave:klauncher said: Error loading 'kio_file'.orQuote:Could not start process Unable to create io-slave:klauncher said: Error loading 'kio_desktop'.Current KDE version is 4.2.2

View 2 Replies View Related

General :: Delete All Files On A Server With A Particular Filename?

Mar 23, 2011

I run 5GBFree.com a free hosting site. As you can imagine, it gets quite a few people signing up to abuse the service.Recently I've found a LOT of people setting up sites with a particular script that floods forums and IRC chat rooms. The names of the files are as follows:

peindom1.php
peindom2.php
peindom3.php
peindom4.php

Is there a command I can run to remove files with these filenames ANYWHERE on the server (so basically, a command to go through all folders on the server and remove instances of that name

View 14 Replies View Related

General :: Delete Files When It's Older 30 Days?

Jan 6, 2011

I am trying to put together ksh shell and I am new with writing scripts.How do you write a command to delete any files if it's 30 days old and also it's not currently being locked?

View 10 Replies View Related

General :: Delete Old Files Older Than 7 Days?

Sep 18, 2009

find -type f /path/* -mtime +7 -exec rm {} ;Is this the best way to delete only files (not directories) within /path that are older than 7 days? or is there a better way?

View 3 Replies View Related

General :: Delete Selected Files From Sftp?

Apr 6, 2010

i am trying to delete multiple files from sftp with non-interactive way as per the desire ext. But i am not able to get the proper extension of the files for removing files.

lftp -u ${user},${passwd} sftp://${ip}<<EOF
cd ${path}
rm *${ext}
bye
EOF

View 4 Replies View Related

General :: How To Delete Multiple Hidden Files

Mar 17, 2010

I am using ubuntu 8.04 and have a separate home partition. While setting it up I had a few failures and was left with several directories containing many hidden files which I can't seem to delete. The man pages for 'rm' didn't seem to provide the answer either.

Is there a flag or escape sequence that will allow 'rm' to delete these files?

View 8 Replies View Related

General :: Script To Delete Temp Files?

Jul 30, 2009

we have 2 linux desktop m/c as server and we use amc n windows as clients....we get more temp files like .AppleDoueble, ":2edstore".i need to remove these temp files periodically with the script. how to write a script to remove these temp files.....

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved