# Delete a specific file

**URL:** https://meta.discourse.org/t/delete-a-specific-file/120627
**Category:** Support
**Created:** [June 18, 2019, 6:06am UTC](https://meta.discourse.org/t/delete-a-specific-file/120627 "2019-06-18T06:06:50Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [June 18, 2019, 6:06am UTC](https://meta.discourse.org/t/delete-a-specific-file/120627/1 "2019-06-18T06:06:50Z")

</div>

I need to delete a specific .docx that a user posted with sensitive information as soon as possible. Please help! 😅

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [June 18, 2019, 6:19am UTC](https://meta.discourse.org/t/delete-a-specific-file/120627/2 "2019-06-18T06:19:07Z")

</div>

Sorry for not including more details in my OP, I was a bit panicked. Here’s a bit more background.

The file was originally published in a post I have since deleted. The link to the file in that post was something like like this: [https://example.com/uploads/short-url/3\_FILE\_ID.docx](https://example.com/uploads/short-url/3_FILE_ID.docx)

I assumed that the file would be somewhere in `/shared/standalone/uploads/default`, but I haven’t been able to find it through this:

`find . | grep "3_FILE_ID.docx"`

So that’s where I’m stuck currently.

---

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [June 18, 2019, 6:23am UTC](https://meta.discourse.org/t/delete-a-specific-file/120627/3 "2019-06-18T06:23:37Z")

</div>

> [@alehandrof](#):
>
> I need to delete a specific .docx

If it happened to me I’d start looking in the uploads folder.  
Example

```plaintext
csmubd2lcomau:~ admin$ /scripts/connect-to-server/sydney-10.8.0.1.sh 
ssh -R 52698:localhost:52698 ceiteach@ceiteach@10.8.0.1
Last login: Tue Jun 18 16:15:05 2019 from 10.8.0.2
[ceiteach@sydney ~]$ sudo bash
[root@sydney ceiteach]# cd /var/discourse/shared/standalone/uploads/default/o
optimized/ original/  
[root@sydney ceiteach]# cd /var/discourse/shared/standalone/uploads/default/original/1X/
[root@sydney 1X]# ls *.docx
2d7aced744661d422e1b66e02a12f1617acf13ed.docx e759a55a7284e4bc80f6be55a3013d4c49e8277b.docx
[root@sydney 1X]# pwd
/var/discourse/shared/standalone/uploads/default/original/1X

```

Maybe revoke read privileges … check the consequences of removing the file .. and delete the post that the user made.

---

<div class="post-metadata">

### Author: ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)
#### Post date: [June 18, 2019, 6:24am UTC](https://meta.discourse.org/t/delete-a-specific-file/120627/4 "2019-06-18T06:24:51Z")

</div>

> [@alehandrof](#):
>
> find . | grep “3\_FILE\_ID.docx”

`ls *.docx` and check the contents of the files you find.  
the file name might be a hash of the contents.

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [June 18, 2019, 6:54am UTC](https://meta.discourse.org/t/delete-a-specific-file/120627/5 "2019-06-18T06:54:10Z")

</div>

Thanks @csmu for the help, I found the file!

I’ll document what I ended up doing in case this is helpful for future travellers:

1. I navigated to the `/var/discourse/shared/standalone/uploads/`

2. I searched for the relevant filetype like this: `ls -Rl | grep ".docx"`

3. I looked at the list of files and found the one (there was only one in my case) that was posted today.

4. I downloaded the file to make sure, by using a command like this _on my local machine_:

5. After I confirmed that it was the file I wanted, I just deleted it (`rm /var/discourse/shared/standalone/uploads/default/original/2X/1/FILE_ID.docx`)

Rejoice!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 18, 2019, 10:37am UTC](https://meta.discourse.org/t/delete-a-specific-file/120627/6 "2019-06-18T10:37:44Z")

</div>

Glad you found it! If you need to do it again, If you still have the post that links the file, you can right click to get the path /filename rather than spelunking to find it.

---

<div class="post-metadata">

### Author: ![alehandrof](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alehandrof/32/119526_2.png) [@alehandrof](https://meta.discourse.org/u/alehandrof)
#### Post date: [June 18, 2019, 10:49am UTC](https://meta.discourse.org/t/delete-a-specific-file/120627/7 "2019-06-18T10:49:49Z")

</div>

The filename linked to in the post was different from the filename in the system. That’s what threw me off originally.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 18, 2019, 10:49am UTC](https://meta.discourse.org/t/delete-a-specific-file/120627/8 "2019-07-18T10:49:53Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
