Questions tagged [delete]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-2 votes
3 answers
50 views

I want to Check two patterns in two consecutive line and delete the first line if the second pattern matches in the following line [closed]

I want to Check two patterns(a1 and a2) in two consecutive line and delete the first line(line having pattern a1) if the second pattern(a2) matches in the following line Input a1 b1 a1 a2 c1 c2 a1 b1 ...
user avatar
  • 21
0 votes
1 answer
49 views

How to delete entire directory fast in under 1 hour that contains millions of files and nearly 18TB of data? [closed]

My backup program backed up entire other drives multiple times by accident to one of my large drives and therefore hogged the entire drive. I already have backed up to another drive what I need from ...
user avatar
25 votes
1 answer
2k views

Unable to delete this file as root [duplicate]

I'm unable to delete a file with rm -rf /home/wordpress/testDomain.com from my Linux machine. Instead of the file being deleted, I get an Operation not permitted error. How can I fix this? $ cd /home/...
user avatar
  • 461
0 votes
0 answers
24 views

Leftover files on Linux, spotting them automatically?

I wanted to run an Android app on Waydroid, so I installed it from the AUR. Unfortunately, the app would reject any emulated device. As I had no other use for Waydroid, I uninstalled it with pacman -...
user avatar
16 votes
4 answers
2k views

Delete a file called '.env'$'\r'

I have no idea what created this file - I guess a terrible shell script. It is called '.env'$'\r' I have tried various versions of rm, and the technique of opening the direcory with vim ./, selecting ...
user avatar
0 votes
1 answer
62 views

Deleting files using xargs prints lots of No such file or directory (but seems to work...)

I have a script that deletes files older than N minutes. The script basically runs: find /some-folder/* -mmin +59 | xargs rm -rf But for some reason it prints tons of: No such file or directory but ...
user avatar
  • 881
0 votes
0 answers
38 views

RHEL 7.9 how to use nmcli to remove an ip address?

I want to use nmcli to remove an ip address on an interface. I want the interface to have no ip address. I tried the following but nothing works nmcli con mod eth0 ipv4.address; nmcli con up id eth0 ...
user avatar
  • 294
-1 votes
1 answer
44 views

Search & replace for a string separated by whitespace upon substring match found

Below is a sample file content: cat sample.txt -server -XX:+UseParallelGC -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+AggressiveHeap -XX:+PrintHeapAtGC -Djava.util.logging.FileHandler....
user avatar
  • 307
0 votes
3 answers
55 views

Where is the undo button in Linux? If I created an SSH key and copied the public key to a NAS, how would I undo or delete it?

I created an SSH key using ssh-keygen -t rsa. Then I copied the key to the NAS, so I wouldn't have to enter a password using ssh-copy-id. I realized that I did it for the wrong user, so now I need to ...
user avatar
  • 1
0 votes
1 answer
21 views

In bash, how do I delete child directories older than the date that another directory was created?

I can use the following command to delete child directories in a particular directory older than x number of days find /path/to/base/dir/* -type d -ctime +10 -exec rm -rf {} \; but how would I delete ...
user avatar
  • 1,860
0 votes
2 answers
108 views

What is emacsen-common package?

I was trying to remove emacs and all packages related and almost removed emacsen-common. The output to apt remove emacsen-common is: Reading package lists... Done Building dependency tree... Done ...
user avatar
2 votes
2 answers
513 views

can't delete file from Ubuntu subsystem on Windows 10 Enterprise

This probably is the wrong forum, but I'll give it a go anyway. I'm running the ubuntu subsystem in Windows 10 Enterprise: root@hostname:/directory/stuff# cat /etc/*release DISTRIB_ID=Ubuntu ...
user avatar
  • 106
1 vote
2 answers
60 views

Remove directory, except when pointed to by symbolic link

I have the below directory structure. I need to find the directories in which a file called log.xml exists and remove all of them completely, except the directory which is pointed to by a specific ...
user avatar
  • 13
1 vote
1 answer
961 views

Cron job to delete all files older than 7 days: -exec rm -f {} \; vs -delete [duplicate]

I want to run a cron job which deletes .txt files older than 7 days. I have two commands. The first command: /usr/bin/find /var/www/example.com/wp-content/targetdir -name "*.txt" -type f -...
user avatar
0 votes
0 answers
101 views

How can i remove/delete a repo i cloned from git?

I cloned a repo twice, first, I cloned at home. second, I created a folder and cloned it again in the folder. now I cannot delete any of the repo...even the folder I created. Any soln?
user avatar
10 votes
2 answers
360 views

How delete BILLIONS of files efficiently on linux?

A storage system had collected 1.7 billion files from revision backups over a couple of years and was getting a bit full. So I started to delete all files older than five years. Which I assume are ...
user avatar
1 vote
1 answer
233 views

How to compare two file names

I want to compare two files in a folder and delete the number in the name which is the smaller of the two. For instance, say the names were yearMonthDay.txt. I want to compare which is a smaller ...
user avatar
0 votes
3 answers
253 views

How do I delete a pattern in a column using sed command line?

I have a table like this below; "baseMean" "log2FoldChange" "lfcSE" "stat" "pvalue" "padj" "ENSG00000000003.14" 11....
user avatar
0 votes
1 answer
344 views

Cannot delete folder on Synology NAS?

I logged in as root and tried to recursively delete the folder /volume2/Name using rm -rf It started and deleted all the files/directories inside this folder Name, but it cannot remove the folder ...
user avatar
  • 121
-2 votes
2 answers
131 views

sort and delete older file

How can I sort the below files based on the date and time inside the folder and delete the older ones and keep the most recent ones in Linux? I just want to keep the latest one regardless of the ...
user avatar
  • 25
0 votes
0 answers
11 views

faster log handling

I have a system that writes log files. The files come in sequentially, but a single log has 3 or more files. The first file will indicate START, the next file(s) will indicate INFO, and the final ...
user avatar
0 votes
1 answer
100 views

Find files with same name but different extension [closed]

I have a legacy application (unsupported) that generates PDF files of XLS, XLSX, DOC and DOCX on demand. The disk of that app is full and we need to delete those PDFs. So I'm searching for a script ...
user avatar
0 votes
1 answer
219 views

Linux find and delete file by date at home path

I run some processes which generate a huge number of output files (log, error, warning etc) at my home directory. To find the output files generated on a specific day, let's say 17 Sept 2021, I tried ...
user avatar
  • 23
0 votes
1 answer
74 views

Delete files in a directory only when cumulative sum of files size exceeds xGB

I have a directory, with thousands of files. I need to sort the files in descending order of creation date (to make sure that the newest files wont be deleted), and start summing the size of these ...
user avatar
  • 11
3 votes
2 answers
287 views

Delete Newest (Not old) Kernel Entries (Upgrades) CentOS

I made previously Upgrades of my CentOS installations... Now, I would like to delete some previous installation [root@centos /]# ls -al /boot/loader/entries total 36 drwx------. 2 root root 4096 Jun ...
user avatar
  • 188
2 votes
1 answer
437 views

Debian - How I can delete things related to the GUI?

I installed Debian for CLI purposes. How I can delete things related to the GUI without the system crashing (Because I do not need GUI packages to free up memory)?
user avatar
0 votes
1 answer
82 views

Delete all folders in specified path that do not have word "edit" in them?

I'm trying to set up a simple script that would clean up my working folder. The working folder is structured like that: Project 1 Project 1 [edited] Project 2 Project 2 [edited] Project 3 Project 3 [...
user avatar
  • 3
0 votes
1 answer
43 views

Remove files created on Weekend [duplicate]

I am using Debian 10 Buster and I am a Linux newby. It´s never too late.. I am collecting pictures in order to create a long-term time lapse video of a construction site across the street. All of the ...
user avatar
0 votes
3 answers
101 views

Remove text between "<!-- text here -->" tags where "<!-- text here \n\n -->" may be on different lines

I have a text file td.txt which has this content More here || <--field="data.com":CHK test text--> || test 2 test x @ -- ||<!-- more data here --> || echo "||<!--field=&...
user avatar
  • 647
0 votes
1 answer
48 views

How to stop rsyslog output TIMESTAMP

this same question has already received a solution but it doesn't work I'm looking for exactly this, I apply it in my rsyslog but it doesn't work for me, I restart my rsyslog, and nothing, I restart ...
user avatar
-2 votes
2 answers
68 views

How to remove, delete, or uninstall ALL the installed software?

I would like to remove or delete or uninstall ALL the installed apps or applications or programs or softwares from Linux... My computer is slowing down because I have installed a lot of useless ...
user avatar
1 vote
1 answer
62 views

How would I delete these iptables rules?

I added some rules blindly to iptables and now don't know how to remove them. It is the following: sudo iptables -A FORWARD -i eth0 -o wg0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT sudo ...
user avatar
  • 135
0 votes
1 answer
46 views

Rsync, copying from two sources: how to avoid deletion of files from first source after syncing files from 2nd source to the same destination?

I have two source folders I would like to keep synced into the same destination folder. I usually give two separate commands: rsync -auP --delete-before "/source1/" "/detination/" ...
user avatar
  • 1
0 votes
2 answers
99 views

Remove a text from the nth line in a file

I want to remove a string which is coming from a variable in a line. remove_text=' hi'; File: kjdkjdkjddkjd djdk hi sjjsj jfjf sisj hi jdkjdk dkjdkdjd hi hi sksk I want to to delete hi from Nthline ( ...
user avatar
0 votes
1 answer
38 views

Safe to remove Mousepad dependencies in POP_OS?

Note: Originally posted question on Ask Ubuntu and they kindly directed to this StackExchange as more appropriate for a non-official Ubuntu derivative. Background information. Currently Running ...
user avatar
1 vote
1 answer
144 views

Best way to clean up huge directory

I have a directory that contains multiple files of really huge size and the total size of the directory is around 285G where if i do ls -ltrh to list files in the directory, it is taking its own time ...
user avatar
1 vote
3 answers
526 views

Delete files with filename date older than 7 days [duplicate]

so all my files on my backup server are named archive-2021-03-18.zip, archive-2021-03-19.zip, etc. I want to set up a cronjob to delete files where the name is older than 7 days. Would someone be able ...
user avatar
0 votes
2 answers
198 views

How to Remove Linux Downloaded and Extracted files in C: drive?

I was trying to dual boot Linux Mint Cinnamon with my Windows 10 PC. I used Unetbootin to install linux mint cinnamon iso file. I used the hard drive type installation in which the only hard drive in ...
user avatar
  • 11
0 votes
1 answer
121 views

How to make a directory really undeletable?

I'm using this commands to make DIRECTORY undeletable: sudo chmod 000 DIRECTORY sudo chattr +i DIRECTORY But I can delete it using this commands: sudo chattr -i DIRECTORY sudo rm -rf DIRECTORY How ...
user avatar
  • 63
0 votes
1 answer
36 views

How do I get rid of windows on linux?

I have 2 operating systems, Windows and ubuntu. What should I do to eliminate windos operating system and make ubuntu system the only one?
user avatar
-1 votes
1 answer
210 views

Delete till first occurrence of pipe "|" using sed [duplicate]

I want to remove all characters before the next pipe "|" symbol. I tried suggestions on previous questions however that did not work for me. As an example. I want to delete the sequencenum=...
user avatar
0 votes
2 answers
138 views

rsync not reporting on files to delete

I've had a look at this (and the forum thread here) and this. I've tried running in Python and also at the command line. I've double-checked: some files have definitely been deleted from the source, ...
user avatar
  • 1,042
0 votes
1 answer
515 views

How to erase/wipe all ext4 metadata, not just the filesystem signature 53 ef?

I want to make zero all bits of a partition where an ext4 filesystem structure existed (superblocks, metadata, journal, etc), not just the filesystem signature deleted by wipefs. I can quickly zero ...
user avatar
0 votes
1 answer
98 views

How to delete characters after a "." (dot) in the first column?

I want to delete characters after "." in the first column of my file, which looks like this: location LR alpha 14884399.000000 0.471193 3.029710e+01 14904434.024291 0.440564 1....
user avatar
  • 71
0 votes
2 answers
95 views

Deleting files by checking file size in bash

I have two directories with files, one is the "source", the other "destination". I would like to have a script that checks file in "source". If file name and size matches ...
user avatar
  • 319
1 vote
1 answer
130 views

Error in removing a directory: Directory not empty

I try to remove a directory (rm -rf) and I get: rm: cannot remove 'EMBA': Directory not empty moreover when I try to list the directory I get: ls: reading directory 'EMBA': Input/output error the ...
user avatar
  • 113
1 vote
1 answer
41 views

Overide delete(-rm) event to move to(-mv) folder

I have a trouble with deleting files on my company's LAN network. I have 5x5TB shared disks where data is stored. About 20 clients (PC Users) have access to the disks. The big problem is when someone ...
user avatar
0 votes
1 answer
245 views

recursively delete all files+folders except a specific one file in solaris

The below command recursively deletes all but 104.tar file under /tmp/CURRENT folder. find /tmp/CURRENT/ -type f ! -name '104.tar' -exec rm -rf {} + It however, does not recursively delete any sub-...
user avatar
  • 307
0 votes
1 answer
68 views

How to remove multiple instances of a program

I am trying to use virtualenvwrapper, but when I run mkvirtualenv xyz I get the message virtualenvwrapper could not find /home/YOUR_USERNAME/.local/bin/virtualenv in your path In fact ...
user avatar
  • 101
0 votes
1 answer
86 views

Having problem using ls or commands on file: '\' , even escaping with '\\'

Using Windows WSL Bash Subsystem, I have a directory that appears to contain a file: '\' . I am attempting to delete this directory, but cannot. When I use ls in the directory, I get the output: $ ls ...
user avatar
  • 1

1
2 3 4 5