General :: How To Delete Selected Files?
Feb 10, 2010Assumed 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?
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?
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
i am new to linux and i nid a bash script to Delete selected backup files and also restore selected backup file to a user define directory.
View 3 Replies View RelatedI am writing a script to delete certain files
say
Code:
find / -name lighttpd
gives following output
Code:
/etc/init.d/lighttpd
/etc/lighttpd
/home/lighttpd
/opt/lighttpd-1.4.x/src/lighttpd
I do not want to delete file in home directory but rest all. In one shell script. So first line I am clear with but what can be the second line,
How can I delete selected rows of a table in perl/CGI??
View 5 Replies View RelatedI have 2 external hdd in wich I have all my files.... yesterday, I have copied all the files from hdd1 to hdd2 and I want to eliminate duplicates so I used FSLint to find them, now, I have a txt file that looks like this code...
now I want to make a shell script to delete all the files/entries (read from the log file) that begin with code...
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.
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 RelatedI 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)
I have a multi-user machine with several network interfaces (Ethernet, if that matters). I wish to grant selected users, or groups, full access to selected network interfaces (including ability to adjust IP address and to bind to low ports, but *only* on those interfaces). It is important to me that an user/group does not such full control over other interfaces. Granting partial, or temporary, root permissions is OK; it's a friendly environment.How do I go about it?System: Linux 2.6.recent; usual Debian setup (can be adjusted if needed).
View 2 Replies View RelatedI 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 RelatedI'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 View RelatedI 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 RelatedI 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 Relatedi 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 RelatedI 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 Relatedhow to delete only files which have no extensions in the directories. but other files should exist.
View 12 Replies View RelatedWhat 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?
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 RelatedIs this possible someone delete one file or folder in linux server its automatically stored one path like recyclebin.
View 5 Replies View RelatedThere are few hundred tar.gz files each having several sub dirs in them (ex: ftp_server1_logs, mail_server2_logs). However the main tar.gz files (ex: 20101001.tar.gz) does not contain all sub dirs every time (ex: 20101001.tar.gz may only contain some ftp server log dirs etc..)
what i have to do is find the tar.gz files that contain a specific type of log type (ex: ftp logs) and extract all logs to a single folder (ex: ftp logs)
I have a backup folder which I need to prune and I've been trying to do a find and destroy action on files in this folder which have not been modified for more than 30 days. I figure if no users complain that their files have been missing for more than 30 days, it's safe to delete them from this folder.
View 13 Replies View RelatedHow can I remove all .swp files in all of my subdirectories under Linux?
View 4 Replies View RelatedI 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?
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 RelatedI 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 ...
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 RelatedI 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
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 Relatedfind -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