How to find top 10 largest files in confluence
Asked by Dhrumil Shah:

HI Team

Can anyone suggest me how to find top 10 largest file which is uploaded in confluence, I want to identify such files and remove it.

Please suggest


Answers:
author: Taha Khanzada
body: Hi Dhrumil,

* Provide more information like you are storing attachments in file system or in database ?
* If file system then your confluence server is unix server or windows server ?

For Standard Confluence installation assuming you are using UNIX box and file system to store attachment then you can use below command to find top 10 largest files in KBs. Confluence home is your confluence home directory or basically you need to use path to attachment

```
find &lt;confluence-home&gt;/attachments/ -printf '%s %p\n'| sort -nr | head -10
```

Taha

comments: author: Saravanan
body: HI TahaThanks for your reply. I have list down all the TOP 10 files but its having some number kind of formate. Can you please suggest how can we come to know the file name and its related link in dashboard.Below is the files which is under attachment folder. Can you please suggest how to find the link from file name-bash-3.2$ ls0 106 114 122 130 139 147 155 163 171 18 188 196 203 211 22 228 236 244 28 36 44 52 60 69 77 85 931 107 115 123 131 14 148 156 164 172 180 189 197 204 212 220 229 237 245 29 37 45 53 61 7 78 86 9410 108 116 124 132 140 149 157 165 173 181 19 198 205 213 221 23 238 246 3 38 46 54 62 70 79 87 95100 109 117 125 133 141 15 158 166 174 182 190 199 206 214 222 230 239 247 30 39 47 55 63 71 8 88 96101 11 118 126 134 142 150 159 167 175 183 191 2 207 215 223 231 24 248 31 4 48 56 64 72 80 89 97102 110 119 127 135 143 151 16 168 176 184 192 20 208 216 224 232 240 249 32 40 49 57 65 73 81 9 98103 111 12 128 136 144 152 160 169 177 185 193 200 209 217 225 233 241 25 33 41 5 58 66 74 82 90 99104 112 120 129 137 145 153 161 17 178 186 194 201 21 218 226 234 242 26 34 42 50 59 67 75 83 91105 113 121 13 138 146 154 162 170 179 187 195 202 210 219 227 235 243 27 35 43 51 6 68 76 84 92-bash-3.2$ ls27920289 28409859 28410103 28410152 28410552 28410566 28410877 28410959 28410968 28411038 28411061 28411181 28411237 2841277227920472 28409875 28410104 28410478 28410553 28410571 28410880 28410960 28410975 28411045 28411062 28411182 28412765 2841281427920473 28410093 28410121 28410485 28410556 28410581 28410883 28410963 28410976 28411046 28411098 28411183 28412766 2841281527920573 28410097 28410122 28410486 28410564 28410582 28410884 28410964 28410978 28411053 28411143 28411192 2841276728409857 28410099 28410125 28410548 28410565 28410665 28410886 28410967 28410985 28411055 28411176 28411236 28412770


author: Taha Khanzada
body: Hi Saravanan,

when you run the above command you will get to 10 largest file. Confluence doesn't save attachment as .pdf .doc etc in file system.  
Interpreting file name from this will not be easy. Confluence Store attachments in the following hierarchy mentioned in this link <https://confluence.atlassian.com/conf53/hierarchical-file-system-attachment-storage-411109022.html>

Also if you want to find where attachments for particular space is saved you can run this in your browser  
\<confluence url\>/admin/findspaceattachments.jsp

Coming back to your question

Interpreting below output to identify actual file name is challenge  
415176704 (size in KB) \<confluence-home\>/attachments/ver003/67/132/174882817/65/246/174496065/**174654877**/1

It would be easier to find attachment name from Database of if you know the details  
Second last number of the above output will give you attachment id then run below query in database

```
select attachmentid, title from attachments where attachmentid = '174654877'
```

<br />

Once you know attachment name you can directly search in confluence with that name

Hopefully this helps.

Taha


Tags: confluence-administration