General :: Delete The File And Its Actual Associated Data?
May 12, 2011
I'm confused about "hard link" feature. I've been learning from my UNIX Academy DVDs training that hard links to a file can be many and each of them is an effective filename for the associated data. So let assume that we have some very sensitive data in a file and we want it to be deleted and file has 20 links. I "delete" a file, but in fact I deleted only one "name" of it. My understanding from the training that data is still there until we delete the last associated hard link. But how can I find the names of all of them? If we have the names, they can be removed one by one. Or may be there's command that can trace all the "names" and remove them at once?
View 14 Replies
ADVERTISEMENT
Nov 15, 2010
Suppose I have a 80 GB hard disk (sda) with 4GB of contents. Using a dd to copy to a different disk
Code:
dd if=/dev/sda of=/dev/sdb
copies all the contents (including free space). So sdb also needs to be 80GB.
You will notice that in VMWare or VirtualBox disk images, it is possible to set the disk to use only the amount of space of actual data. So a 80GB virtualbox/vmware image with 4GB of contents will be 4GB.
Is it possible to do that with an actual hard disk (sda) image? I want to create an image of an actual hard disk, copy it to DVD and transport it (in mail) for restoration on another computer (having same hard disk).
View 6 Replies
View Related
Oct 20, 2010
i've been using php/fwrite to add text to a file using the below code but how do i remove text from a file? note that i don't know what line it's on as there will be other content in the file.
View 5 Replies
View Related
Jan 27, 2010
I have a large number of folders that each contain quite a few files of varying sizes (from a few bytes to 400kb or so), mostly smaller ones. I need to get the actual (not the disk usage) size of these folders. Is there any way to do this with a command like 'du'?
View 4 Replies
View Related
Apr 11, 2011
I multi-boot several Linux distributions with an assortment of additional data partitions. I get frustrated whenever fsck is forced during boot. (It ONLY happens when I'm in a hurry don't you know...) So I wrote a script to automate forced fscking when I do have the time. (And/or while I'm doing something else in another workspace.
Because I multi-boot, I've learned that udev doesn't always assign the same device name to each drive for all distributions. I've had the same partition identified as hda5, sda5, & sdb5 by different distributions (without doing anything to affect the boot order) So my solution is to keep a list of partitions in a specific file on each distro with valid device names according to that distribution's udev process. Actually I'd use LABEL= instead but the labels don't show up in /etc/mtab, and I like to make sure a partition isn't mounted before I try to fsck it.
I can make this work in a for loop using cat. But I've seen so many things about NOT using cat that I wanted to rebuild my script. I can make this work with a redirect instead of cat via a while loop, But I "LIKE" old style for loops. But I can't seem to find a way to make a redirect work with one. I thought this might make a good first �LinuxQuestions.org� question. I'm also open to any other suggestions on better/alternative methods... Is it possible to redirect from a file into an actual for loop?
My script is as follows:
Code:
#!/bin/bash
# FsckEm I script to force file system checking on unmounted ext2/ext3/ext4
# partitions in preselected list. FsckEm accepts no options. Partition
[code]....
View 5 Replies
View Related
Jan 9, 2010
I use amarok 2 and I have a lot of files that are titled "Track #.mp3", in Amarok I have changed them to see as the real songs but the actual files are still the same. Is there a way to change the actual file names using amarok to match the tags I have inside of amarok? The reason why I'd want to do this:
1. If my home folder becomes corrupt I don't have to redo 100's of songs (I have a backup but none the less
2. If I ever decide to use another program or if I'm in W7 using Windows Media Player classic it'd be nice to have it recognize the correct files without having to double up on the tag editing
If this isn't possible I'm going to wishlist it because I think it's functional and having a bunch of Track# files is a pain but impossible to get around when you have a lot of mix cd's.
View 2 Replies
View Related
Jun 15, 2011
I am browsing our repository and I want to get this folder but all of the files there have ",v" in the end of their filenames and if you open each file, they have some written data which are headers for version control before the actual content of the file. I want to extract the actual content to make the file my_file.c,v --> my_file.c. Is there a command to do this?
I am having lock error and permission errors so I cannot checkout manually using CVS.
View 2 Replies
View Related
Oct 21, 2009
Many folders within a subdirectory some of which have lots of data in and some of which have only one specific file called produkt.fil inside.I need a command to find and delete those folders that contain ONLY the file produkt.fil - if other files exist (doesnt matter what they are) then they should be left alone. Note: produkt.fil exists in all of the folders always.
View 5 Replies
View Related
Jul 30, 2010
When I ls -l /etc/passwd, -rw-r--r-- 1 root root /etc/passwd When I login as myself, and rm /etc/passwd, it asks: rm: remove write-protected file '/etc/passwd'? If I say yes, will it actually delete the passwd file?
View 1 Replies
View Related
Mar 1, 2010
this is my sed script
#
# insert the line '-A INPUT -i eth0 -j ACCEPT'
# in iptables
#
/-A INPUT -i eth0 -j ACCEPT/a
-A INPUT -i edge0 -j ACCEPT
but when i run sed -f script iptables. it just echo's it to the the screen with my line added and not into the actual file. anyone know what i am doing wrong?
View 4 Replies
View Related
Jan 21, 2010
How do I delete a file if it happens like this.
-????????? ? ? ? ? ? temp.cgi
View 5 Replies
View Related
Feb 18, 2010
Why is there no Delete when I right click like there is with Windows in ubuntu? Pretty much everything else is there like new folder and so on Is there some way to add it? Also why when i delete something does it not ask me if I am sure that i want to delete that file?
View 6 Replies
View Related
Aug 31, 2010
I wonder how to arithmetic operation of our data file using any script program/command (like sed, cut,awk)for example my data.file is:
45 65 42
12 23 61
43 34 21
I want to multiply first column with 2 and add second column with 3 then it become
90 68 42
24 26 61
86 37 21
View 5 Replies
View Related
Jul 24, 2010
I am new to shell scripting.What i am trying is to write a shell script which take the input file and output should like as mentioned below.Output file should have data till SOK (marked in red)from every second line and then the selected data(marked in green) from 4th line.So selected data from 2nd and 4th line in one line of O/P file and then similarly selected data from 6th and 8th line in second line of O/P file.Input File:
3c3
< c1111;11.11.11.11;pOK;SOK:abcde;Universe:aa
---
[code]...
View 14 Replies
View Related
Nov 30, 2010
we assume that we have 2 folders with the name 1 and 2 . The folder 2 is inside 1 . Also, in folder 2 we have file with name "file.txt". And we are in folder 1 . How can we delete the file.txt in one command line ? I mean without using the code below:
Code:
cd 2
rm -f file.txt
cd ..
View 3 Replies
View Related
Nov 21, 2010
when i try to delete, it says can not move to trash,so, how do I delete it permanently?In windows is shift+del
View 2 Replies
View Related
Jan 30, 2010
after so many times deleting staff for mistake.I am unable to get it back from my external hard drive.I use Ubuntu 8.04 LTS and I have all my staff on external hardrive.
Quote:
Z:----> Media -----> FreeAgent Drive
After delete I knew was her
Quote:
/acousticmetal[1]/
, I did all the search I can possible think of.and i dint have any good look can any one please help me out on this issue?.
View 13 Replies
View Related
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
Jun 5, 2011
looking to delete the last 6 lines of a file with sed. figured out how to delete the last line..but i want the last six.
View 6 Replies
View Related
Nov 11, 2010
I was creating a few scripts, I am trying to create a restore script to restore files that have previously been moved to a folder I selected. When moved I stored the original path for these files all in one text file.
I want to know if anyone can tell me how to delete the line from the file after using it restore the file. I have used the grep command to search through the file "pathName" to find where the file was stored but now want to delete that same line.
View 5 Replies
View Related
Jan 9, 2010
I am facing a basic problem in RHEL 5.2. Some of files in a mounted showing ? in place of owner and group owner.
root# find /data/abc -nouser
listing those files.
How to delete those files because
root# find /data/abc -nouser -exec rm -rf {} ;
showing error access is denied.
View 10 Replies
View Related
Aug 19, 2010
how to delete unreadable file? As you can see at attached picture, there is two unreadble files at root directory.
Code:
[code]....
View 4 Replies
View Related
Jun 2, 2010
I tried to clone my laptop ubuntu partition (9.10) using ddrescue into my portable harddisk.I run command "ddrescue r3 /dev/sda6 /dev/sdb6" sdb6 is my portable harddisk partition with lots of data. In my head I was thinking that it will create image file (like iso or img)that can be restored to another disk.Suddenly I relize that it delete my existing data (in sdb6) then I interrupted ddrescue.Is there a way that I could get back my data in sdb6?Partition in sdb6 is FAT32m, now when I try to open sdb6 using Windows OS, it always aks me to format
View 6 Replies
View Related
Sep 15, 2010
Is there a GUI solution to permanently destroying data on my external HD? I know there are some command line options but I am looking for a GUI solution.
View 7 Replies
View Related
Apr 27, 2011
I am trying to find and delete a file using this Code: find . -type f -name ph2964781400100954291.jpg -exec rm -f {} ; It does not work, I think because by default on my distro rm is iterative.
View 2 Replies
View Related
Jun 12, 2010
I have external USB HD 500 GB, by mistake folder with 13 GB deleted, using some windows recovery tools, i got it back, but the deleted folder still take and fill space on the HD!!
any idea how to remove or edit it under linux ?
View 15 Replies
View Related
Jul 20, 2010
I have a file that contains 100 ligns, i need to write a script that read 70 lignes and redirect those 70 ligns to another files and these 70ligns have to be erased in the first file
when i write this command
head -70 somefile.txt>test.txt
or
sed -n 70p somefile.txt>test.txt
i have these 70 lines in the text.txt files
but these 70 lines have to be deleted inthe first file somefile.txt
View 1 Replies
View Related
Jan 20, 2011
seems like i got a hacker on my server who placed a "western union fishing" site on it.i am not able to delete the directory with the root user.
Code:
root@laforge:/var/www/html/mailadmin.somewhat.com> ll
total 12
[code]....
View 14 Replies
View Related
Apr 27, 2010
i've got a file with sorted words - one on each line.How could it be possible to delete thouse lines that have words of length 1 or 2 (1-2 letters). I guess a good way it will be with AWK, n its fuction length(), but getting it, i dont know how to delete those very lines.
View 14 Replies
View Related
Mar 3, 2010
I have a log file which is continously being accessed. Now I want to delete the first line without disturbing the file.Is it possible? The Issue is the log file is being provisioned with ^@^@^@ characters in the first line occupying huge space.So I need to get rid of that. I dont have time to work with root cause but just a script to reduce this space.
View 3 Replies
View Related