General :: Rm Non-interactive Command - Delete A Directory With Its Files

Sep 28, 2010

I wanna delete a directory with its files and I wanna do that as follows: rm -r dirToDelete Unfortunately, I always get asked for EACH single file if I wanna delete this because it is write protected.... Is there a way to suppress this feedback message so that just the whole directory with its contents disappears?

View 5 Replies


ADVERTISEMENT

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 :: 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 :: How To Delete All Files In Directory Without Deleting?

Feb 9, 2010

I know that rm -i will prompt wether you want to delete each file.But rm -i -r will prompt for each file in each subdirectory recursively. How to make it prompt just for the directory itself, and then delete its contents without asking?How to delete all the files in a directory without deleting . and ..?How to recursively delete all tilde files in a directory?How to GUI file managers delete files to Trash? Where is this "Trash" located? Can you delete to trash in the command line?

View 14 Replies View Related

General :: Delete All Files In A Directory Except The 7 Latest Ones?

Dec 4, 2010

Here is how i am isolating the 7 latest files

Code:
ls -ltr | tail -7

is there a way to give that negated list to the rm command? or should i be using the find command with an exec {}?

View 14 Replies View Related

General :: Delete A Line With Certain Format From Files In A Directory?

Sep 21, 2010

I need a PHP script to delete a line with certain pattern from all filesin a directory. The Directory contain files with extensions .js,.html and.php. Do any body give a working code snippet to Read all files in a directory with above extension and delete that line from the files.

View 1 Replies View Related

General :: Find Directory Older Than X And Mv Directory With Sub Files Command?

Jul 13, 2011

I'm quite new to linux but I have configured a simple ftp server and it's working great. I have a FTP-Shared folder with upload and download subfolders. Under upload's and download's I have identical category subfolders like mp3's, movies, software etc. in both. As the guy's upload, I would like to create a line crontab where I can move all the content under /FTP-Shared/upload/mp3/* older than 14 day's to FTP-Shared/downloads/mp3/ recursively (Like in cp command), but the timestamp must be searched on the first directory and not sub files example: /mp3/Club Dance/CD1/Hallo world.mp3This is how far I got:[root@clients ~]# /usr/bin/find /FTP_Shared/upload/Mp3s/ -depth -mindepth 1 -mtime +14 -type d -exec mv -f {} /FTP_Shared/download/Mp3s/ ;This command moves the directory and files, but it is not recursively

View 4 Replies View Related

General :: Delete Files On The Command Line With Regular Expressions?

May 6, 2010

Lets say I have 20 files named FOOXX, where XX is the number of the file, eg 01, 02 etc. At the moment, if I want to delete all files lower than the number 10, this is easy and I just use a wildcard, eg rm FOO0* However, if I want to delete specific files ina range, eg 13-15, this becomes more difficult. rm FPP[13-15] does not work, and asks me if I wish to delete all files. Likewse rm FOO1[3-5] wishes to delete all files that begin with FOO1 So, what is the best way to delete ranges of files like this? I have tried with both bash and zsh, and I don't think they differ so much for such a basic task?

View 2 Replies View Related

Ubuntu :: Permissions For My Home Directory Were Accidentally Changed From 'access Files' To 'create And Delete Files?

Nov 25, 2010

the permissions for my home directory were accidentally changed from 'access files' to 'create and delete files', and I changed them back, but ever since then I am not able to change any preferences/settings at all. power management, themes, panels, emerald, anything. my user account is supposed to be the administrator, and all the user privliges are checked. how to get control of my computer back?

View 9 Replies View Related

General :: Tar Command For Directory With Files

Feb 24, 2011

Using tar command. All I need the usage, and basic explanation. Let's assume I have a directory with files that I need to tar, how do I go about it.

View 14 Replies View Related

General :: Apply A Command To All Pdf Files In A Directory?

Jul 29, 2011

i want to apply this command

Code:

pdftotext article.pdf - | grep DOI

to all the pdf's in a directory and save each line of output to a text file. i.e. i want to collect each line containing "DOI" from every pdf in a text file. I am unable to understand bash scripting enough to write a for loop for this.

View 1 Replies View Related

CentOS 5 :: Command To Delete The Oldest File In A Folder/directory?

Oct 13, 2009

I am trying to add a command to my backup script to delete the oldest file in the destination folder before adding a new .tar.gz file.I found this information at .html which I thought would work fine and added the following line to my backup script:ls -t -r -l /backups/Scalix_Backup* | head --lines 1 | xargs rmHowever when I tried this I get an error:rm: invalid option -- wTry `rm --help' for more information

View 7 Replies View Related

General :: Ls Command And Displaying Number Of Files In Current Directory?

Oct 15, 2010

What command will provide you with the number of files in your current directory?
Choose one answer.
A. ls -c
B. ls | wc -w (this one)
C. ls -n | count
D. ls -wc (this one ?)

View 5 Replies View Related

General :: Del Command To Remove Files To Directory Instead Of Completely Deleting Them?

Dec 2, 2010

how to write a script so that when I use the 'del' command it removes/sends the files / folders to a I specify for example 'dustbin'

View 1 Replies View Related

General :: Useradd Command To Create Passwd / Shadow & Other Files Under Different Directory

May 19, 2011

I am bulding my own image based on 2.6.32 kernel, I wish to add a guest user:

In a script thats invoked by the makefile, I use 'useradd' command & this updates the shadow, passwd files under /etc on the host, is it possible to tell the command to create the shadow / password under some other folder on the host? may be /tmp?

View 2 Replies View Related

General :: Command Line - Automating A Task - Copy All Subdirectories And Files From One Directory To Another

Jun 10, 2010

I need to copy all subdirectories and files from one directory to another ever 5 minutes or so, with the old data automatically being overwritten with the new data. I'd also like this to run at startup. Is there any way this can be done? If so, what program would I need to schedule the automation and what is the command line I would need.

View 2 Replies View Related

Programming :: Shell Script To Automatically Delete Files With The Same Name As The Parent Directory?

Mar 18, 2010

I am facing a problem in Windows due to a virus called Newfolder.exe which creats files with the same name as it's parent directory and an extension .exe and this happens for every directory in the entire hierarchy in the infected pen drive. The antivirus detects them, but is sucking slow. So I thought this is a good opportunity to use the concepts of the all mighty shell script to remove those as they follow the same pattern. Say my complete path is

Code:

/home/pkd/fol1/

The virus would have created an file with complete paths

Quote:

/home/pkd/fol1.exe

If fol1 has two more directories fol11 and fol12 Then there would be two more .exe(virus created) in the following path

Quote:

/home/pkd/fol11/fol11.exe
/home/pkd/fol12/fol12.exe

View 1 Replies View Related

Ubuntu :: Delete Duplicate Files Command Line?

Apr 14, 2010

Is there a way to remove duplicate files from a specific folder through SSH? I've uploaded a lot of flash games on my server and I can see in the Webmin's file manager that I have many duplicates. Their names are different, of course.

View 2 Replies View Related

Ubuntu :: Command Not Found \ Edit The 2 Files And Delete The Insert Lines?

Mar 10, 2010

i try do modify BASHRC and ENVIRONMENT files on directory ETCthen all the command don't work, such as:SUDO, GEDIT, NAUTILUS, NANO and some others!now i want to edit the 2 files and delete the insert lines

View 9 Replies View Related

Ubuntu :: Delete Files In Trash That Is Older Than 10 Days With A Terminal Command?

Sep 27, 2010

Can I delete files in trash that is older than 10 days with a terminal command?

View 3 Replies View Related

General :: Command To Delete Bash Command History?

May 31, 2010

What's the command to delete bash command history?

View 4 Replies View Related

Ubuntu :: A Bootable CD To Get To An Interactive Command Line?

Jan 19, 2011

As I have posted here [URL], my laptop powered down during an update because I forgot to plug it into the mains power. Anyway, after going through the thread I referred to above, I learned that I must chroot into the existing installation and patch it up. I can do this using a live CD but unfortunately, I gave my most recent live CDs away and the Live CDs I have left don't recognize the file system on the current Ubuntu installation. (If I remember correctly, the current [broken] installation is 10.04). Downloading a new live CD is a bit difficult as internet speeds over here aren't very fast. I was wondering if there is another alternative bootable CD that I could use to get a interactive command line which I can use to "chroot".

View 9 Replies View Related

Software :: Way To Execute Bash As Interactive And Run A Command?

Jun 20, 2009

I'm trying to start bash with a command and have it interactive like this:bash -i -c "echo Welcome!"As in, execute the command and allow me to use it as an interactive shell afterwards. (I'm doing something more complicated than echoing, but this doesn't work.)I've tried this from a running gnome-terminal, from one gnome-terminal to a new one withgnome-terminal and from the Alt+F2 program launcher (with "Run in terminal" ticked).

View 6 Replies View Related

General :: Delete The Parent Directory With Rm -rf?

May 15, 2011

I have a FAT32 SD card with a file on it, that, viewed in Windows the filename consists of a long string of nonsense. Viewed in my Android phone's Linux terminal, ls -a shows nothing in the directory. When I try to delete the parent directory with rm -rf deleteme, it fails with "Directory not empty". When I try to delete/move in Windows 7, it says the filename would be too long and/or Explorer crashes. Windows disk check doesn't find anything wrong. How can I delete this?

View 2 Replies View Related

General :: Use Mkdir Command To Create 'local' Directory In /usr - There Are Error - Cannot Make Directory

Jun 16, 2010

I am a student studying computer science course.

Well, I am facing problem when doing lab questions.

I must use DLXLinux bundled in Bochs (bochs.sourceforge.net).

I am required to use the /usr/local directory.

In /usr directory, there is no directory named 'local' but there is one thing called 'local@'. So, when I try to use mkdir command to create 'local' directory in /usr , there are error "cannot make directory.....".

Look at my screenshot at [url].

View 9 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 :: Delete Protected Directory In Samba?

Dec 20, 2010

How to create a directory in samba share in which user can write read files but neither can create more directories tree nor delete any directory.

suppose
[Share]
comment = NRshare
path = /home/share
browseable = yes

[Code].....

I know user cannot delete share directory here. But user can create any number of directories of files in share.

I would like to create directories in share which cannot be added or deleted.

View 2 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 :: Launching Interactive Gnome-terminal With A Command (and Not Exiting)

Oct 13, 2010

I want to have a script (tcsh/bash/python) that launches a bunch of gnome-terminals (or 1 with multiple tabs). And I want it to execute a command, but keep the shell interactive. Currently, if you type gnome-terminal then it launches a new interactive shell, but if you give it the execute flag, then it executes the command and quits (or stays open, but non-interactive depending on the users gnome-terminal settings).

I have this command which I want to run automatically before I start working. What the command does is dynamic and different for each shell. It takes arguments. So it's not something I can take care of in a .cshrc type file.

View 3 Replies View Related

Ubuntu :: Script Or Command To Move Files To Directory Of Same Name

Mar 12, 2010

I'm doing a little work on my media center and the scrappers seem to do a much better job when each movie is in a directory with the name of the movie. However that's not how i have things set up.I have a few hundred avi files i need moved to directory named the same as the avi file.

View 3 Replies View Related







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