General :: Deleting Everything: # Rm -rf /
Aug 23, 2010Just wondering, what happens when you delete every single file on a running Linux system?
# rm -rf /
Just wondering, what happens when you delete every single file on a running Linux system?
# rm -rf /
I've a big text, and I would like to delete several lines in vim. I was thinking in doing that with marks, but I can't do it. Below it's an example text and I want to delete from <FROM HERE> to <TO HERE>. How can I do that?
[Quote] .....
I am a non-root user, and have made a directory into which other users in my group can write. The directory is setgid, so files and directories within it have the same group.I can delete files placed into this directory, but if a user creates a subdirectory with files in it, I can't seem to delete those. Is there something special I can do (other than, say, bothering the user in question or the sysadmin about it) to get rid of this subdirectory?
EDIT: Inevitably, of course, someone asks "why?"The shared folder in question is a mercurial repository. We can't use a shared-account ssh-key-based server for this like mercurial-server, and we can't just host it externally for various reasons. But that part works fine.We use Redmine for project management, but it does not yet read the repo index for file contents - it reads the working directory. So the working directory must be kept up-to-datecrontab has been disabled by the sysadmin, so that's out. So I naïvely put a changeset hook in the shared repo that performed an "hg update". This seemed to work fine initially, until, of course, someone pushed a commit with a new directory. While I had vague thoughts of trying to make a setuid script for the hook, I'll probably just consider safer avenues.
I have a laptop that I was dual booting with Windows 7 and Ubuntu. I used the MSFT disk manager to delete the partitions. I made sure my windows live cd was working, which it was, before doing this. But now, when I boot my computer, it won't run the cd. All I get is
error: no such partition. and then a command prompt: grub rescue>
I made sure my boot priority was set to boot from the CD first.
my website was recently infected with this stupid malware lotultimatebet .cn...there is a hidden iframe on almost all the 6000 pages of my site.can you please advise, if it is possible for me to remove this line from all pages by executing some command?
View 1 Replies View RelatedI have found a file beginning with a question mark in my home dir, not sure how the hell it got there. It's from a downloaded rar i think.
Does anyone know how to do this?
what would be the syntax to delete a line containg the word "word" from the file "file" i want to delete the whole line and not only the word...
View 6 Replies View RelatedI'm writing a Perl script which performs linux commands.I have a directory with a load of files.
Code:exec_cmd('rm $(ls * | grep -v file1)');
This command will delete all except for file1. How can I modify this to delete all files except for file1 & file2?
I had a program run riot and it has created hundreds of spurious files in one directory. Fortunately they are all dated 4th November so are easily identified. What bash command can I use from the console to delete them all?
View 2 Replies View RelatedI have a large number of zip-archives which I would like to extract and then delete, keeping only the extracted files. The files are located in a number of directories and I issued the following command, hoping that it would solve my problem (which it didn't):
Code:find . -name "*.zip" -execdir unzip '{}' ; -deleteWhat happened was that find continued to extract the files as intended, but then it deletednot only the zip-archives but also the newly extracted files.it only affected a portion of the files that I had already backed up.I don't have enough space on my hard drive to extract all the files without simultaneously removing any data and I don't have the energy to go through all the directories one by one manually. Surely there must be a better way. Is there a way to fix the code snippet above so that it works as I intended or is there a better way of doing this?
i need to restrict access of deleting to directory and partitions os disk? how do i do it?
View 5 Replies View RelatedIf I delete some program, let's say - PulseAudio, it still runs and I need to kill this process. Why? How can it work if it's no more on the HDD? And if I just reboot the PC after deleting PulseAudio (without killing it), it won't be in memory then?
View 6 Replies View RelatedI have deleted the ubuntu partition on my xp pc. Now at restart i have the following:
GRUB loading.
error: no such partition
grub rescue>
I have no idea what to do now. I have downloaded super grub - because one of the pages that i googled said it would help - but my pc does not read from either the cd or usb drives - don't know why.I need this pc recovered today .
My cousin just deleted his Linux partition and another smaller partitio nand now Windows is not booting, no he does not have the recovery disc. When Windows tries to boot it goes to "GRUB" and says "partition not loaded". What are some GRUB commands? And is it possible to fix this without using the recovery CD?
View 1 Replies View RelatedI was testing my authorized_hosts setup, so deleted my local private key. I then successfully ssh'd into my remote server using RSA authentication. I was expecting to get a permission denied, seeing as there is no longer a private key to guarantee I'm me. Guessing I'm misunderstanding something fundamental. Anyone know what's going on? It doesn't look like ssh-add is holding my private key:jake@clyde:~$ sudo pkill -9 ssh-agent
View 2 Replies View RelatedI'm using the command below to sync two directories. Problem is insted of deleting the files on the target directory it simply appends a ~ character at the end of the file name. Not sure why this is happening?I'd like to have all deletes on the source replicated on target.
View 2 Replies View RelatedSomething strange is happening with RedHat Linux 5. I created one directory system_verilog twice and both the times somehow it's get deleted after next booting of machine (after modification of some of the file in this directory).
View 3 Replies View RelatedI am facing some problem regarding deletion of a line from a text file. The file consists of the lines of type which consists of more than 6 occurrences of : character in it. The line should be deleted completely and the line next to it must be shifted up.
View 1 Replies View Relatedi have a problem about deleting a line from a text file which contains two specific patterns. i am using "sed -i "/$name/ d" peop.txt" but i must use one more variable which is surname.
"
burak:ak:3242:2342:dsa@a.com
gokhan:an:432:4234:da@a.com
"
and this is the code of text file. and the second question when i use "/$name/ d" it deletes not only the names which are macthing with $name but also all words that contain $name. so how can i fix these problems_?
on my site now I'm using cache and need me cron script that will delete files older than 1 hour I have feature in my kloxo control panel just need me the command .
View 2 Replies View RelatedI recently bought a Buffalo 500GB ministation usb with "optional disk encryption". Turns out, I'm having one hell of a time trying to remove the "optional" from the drive. I figured I could just delete the program that is on the disk, and go on my way. That doesn't seem to be the case.
fdisk /dev/sdc1, then "p" showed that there were 4 partitions. So I deleted them one by one. "n" gave me a new partition. "t" I used 87 because I will be using it on windows. Then "w" to write everything.
mkfs -t ntfs /dev/sdc1 - all went well.
fsck -f -y /dev/sdc1 - all went well
Then I took the removed the drive and plugged into Windows only to find that the "optional" is still there. It actually creates a virtual drive with the "optional" software. So I tried it over again. I tried fdisk only to see that the partitions were back (as if they were never removed). I removed them again, and used primary partition as linux and wrote to disk. As a hunch, I checked permissions. Can't remember what it said, but I did change them.
chmod 777 /dev/sdc1
Then in a last hope of desperation, before coming to work today, I decided to dd the drive.
dd if=/dev/zero of=/dev/sdc1 bs=4k conv=notrunc
Is it possible that the "optional" stuff is actually hard coded onto a chip, or something inside the drive and I may never get rid of it?
Is there anyway to delete certain paragraphs within a text file and then insert the paragraph into another text file.I just cannot figure out how to remove the specific lines from the file and then insert them into another file at a certain line within that new file. Thanks again
View 10 Replies View RelatedAny method through which I can delete 1000 qmail users added from year 2007 to 2008 in single shot?
View 2 Replies View RelatedI'm trying to write a script to do the following:
I have a text file that contains many lines that look like this:
I'm trying to make my script read this text file, find the string sequence "QIEN", and delete everything from this sequence backwards (including "QIEN") so that the above lines look something like this:
I'm aware that grep is good to do a regular find-and-delete as follows:
Code:
But this will delete everything on the lines that contain the string sequence "QIEN".
I had dual boot Win Xp and CentOs Linux. I have small harddisk and needed more space, so I removed CentOS linux with partition manager and rebooted. Now I can not boot my XP. All I can see is GRUB prompt. Keyboard do not respond except CTRL ALT DEL. I know I have to fixmbr. But I can not boot from my bootable XP CD. I can boot from CentOS linux DVD and enter into linux rescue mode. From that I typed "grub" entered into grub. Then I tried
root(hd0,0)
makeactive
chainloader --force +1
boot.
But it gives me some error. Can I boot my XP from CentOS DVD rescue mode?
Playing with the Box, I deleted a Raid-0 partition intentionally, saved it, and reboot drops me to (Repair Filesystem#) prompt. I notice during boot-up that the box didn't find /dev/md0, which is expected.
So what's the recovery procedure, since I can't edit #/etc/fstab, permission denied.
#fdisk -l
shows all other partitions.
Not much familiar with fsck/e2fsck, yet like to give it a try.
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 RelatedI would like to delete a directory in emacs' dired-mode.
I mark the directory with the "d" key, and then hit "x" to deleted flagged.
I then get the following error:
Is there any way to get emacs to delete the directory and stop its whining?
I have a hard drive with the following layout:
I want to delete the first two partitions (a 243 MB Linux swap partition and a 5.87 GB root partition). Problem is, every time I deleted them, Windows would also delete Drive G: and H:, leaving only drive F: intact. Deleting the two Linux partitions using GParted from a Live CD also gave the same result. I've attempted this multiple times now and, after each attempt, TestDisk always managed to recover all the deleted partitions.
Any ideas on how to delete these two partitions without affecting the rest?
[root@localhost media]# ls UMESH
[root@localhost media]# cd UMESH/
[root@localhost UMESH]# ll
ls: cannot access ejb: Input/output error
total 0 d? ejb
[root@localhost UMESH]# rm -rf ejb
rm: cannot remove 'ejb': Input/output error
[root@localhost UMESH]# ll
ls: cannot access ejb: Input/output error
total 0 d? ejb
[root@localhost UMESH]#
The privileges for root for UMESH are as below:
[root@localhost media]# ll
total 4
drwxr-xr-x 3 vickey root 4096 1970-01-01 05:30 UMESH
[root@localhost media]#
Also I can't even paste a file in the USB.