
{"id":26094,"date":"2025-10-09T09:56:59","date_gmt":"2025-10-09T07:56:59","guid":{"rendered":"https:\/\/contabo.com\/blog\/?p=26094"},"modified":"2026-01-16T10:58:48","modified_gmt":"2026-01-16T09:58:48","slug":"how-to-find-files-in-linux","status":"publish","type":"post","link":"https:\/\/contabo.com\/blog\/how-to-find-files-in-linux\/","title":{"rendered":"How to Find Files in Linux\u00a0"},"content":{"rendered":"\n<p>Finding the right file on a Linux server can be challenging at first. However, once you <a href=\"https:\/\/contabo.com\/blog\/how-to-check-and-manage-running-processes-on-a-linux-vps\/\" target=\"_blank\" rel=\"noreferrer noopener\">understand the structure<\/a> of the file system and a few commands, it becomes much easier. In this guide, you will learn how to find files within Linux using simple, practical examples.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-understanding-the-linux-file-system\">Understanding the Linux File System\u00a0<\/h2>\n\n\n\n<p>In Linux, everything starts at the <strong>root directory<\/strong>, written as just <code>\/<\/code>. From there, folders branch out like a tree.&nbsp;<\/p>\n\n\n\n<p>Here are some of the most important directories:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/home<\/code> &#8211; here you find user files and home folders&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/etc<\/code> &#8211; this directory stores system configuration files&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/va<\/code>r &#8211; this contains logs and changing application data&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/tmp<\/code> &#8211; this holds temporary files&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/bin<\/code> and <code>\/sbin<\/code> &#8211; these contain core system tools and binaries&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Once you know where things usually lie, you can narrow down your searches. Therefore, always consider the likely directory before running any command.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-finding-files-with-the-find-command\">Finding Files with the <code>find <\/code>Command\u00a0<\/h2>\n\n\n\n<p>The most powerful tool for locating files in Linux is the <code>find <\/code>command. You can search entire file systems or just specific folders.&nbsp;<\/p>\n\n\n\n<p>If you want to search your whole system for a file named <code>backup.sh<\/code>, run:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/ -name \"backup.sh\"&nbsp;<\/code><\/pre>\n\n\n\n<p>This command starts at \/ and looks through all subdirectories. It prints full paths for every file named <code>backup.sh<\/code>.&nbsp;<\/p>\n\n\n\n<p>If you only want to search your own home directory, you can shorten the path. Use <code>~ <\/code>to refer to your current user\u2019s home folder:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find ~\/ -name \"backup.sh\"&nbsp;<\/code><\/pre>\n\n\n\n<p>This search runs faster and avoids scanning system directories.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-case-insensitive-searches-with-iname\">Case-Insensitive Searches with <code>-iname\u00a0<\/code><\/h2>\n\n\n\n<p>Sometimes you do not remember the exact capitalization of a file. In that case, you can use a case-insensitive search.&nbsp;<\/p>\n\n\n\n<p>The <code>-iname<\/code> option ignores upper- and lower-case differences:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/etc -iname \"config.cfg\"&nbsp;<\/code><\/pre>\n\n\n\n<p>This matches <code>config.cfg<\/code>, <code>Config.cfg<\/code>, or even <code>CONFIG.CFG<\/code>. Which is why it is helpful when you only know part of the name.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-finding-large-files-to-free-desk-space\">Finding Large Files to Free Desk Space\u00a0<\/h2>\n\n\n\n<p>When <a href=\"https:\/\/contabo.com\/blog\/how-to-check-disk-space-usage-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">disk space runs low<\/a>, you may want to find large files first. The <code>find <\/code>command can help you identify them quickly.&nbsp;&nbsp;<\/p>\n\n\n\n<p>To list all files larger than 100 megabytes, use:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/ -type f -size +100M&nbsp;<\/code><\/pre>\n\n\n\n<p>This command searches for regular files <code>(-type f)<\/code> bigger than <code>+100M<\/code>. You can then review the output and decide what to clean up.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-searching-for-directions-instead-of-files\">Searching for Directions Instead of Files\u00a0<\/h2>\n\n\n\n<p>Sometimes you are looking for directories rather than individual files. For example, you might want to explore log folders in <code>\/var<\/code>.&nbsp;<\/p>\n\n\n\n<p>You can search specifically for directories with:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/var -type d&nbsp;<\/code><\/pre>\n\n\n\n<p>This shows all directories under <code>\/var<\/code> and is very helpful for exploring nested folder structures.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-deleting-matches-with-find-use-carefully\">Deleting Matches with <code>-find<\/code> \u2013 Use Carefully\u00a0<\/h2>\n\n\n\n<p>The <code>find <\/code>command can also delete files automatically. However, you should use this feature with great care.&nbsp;&nbsp;<\/p>\n\n\n\n<p>For example, to delete all <code>.log<\/code> files in <code>\/tmp<\/code>, you could run:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/tmp -type f -name \"*.log\" -delete&nbsp;<\/code><\/pre>\n\n\n\n<p>This command removes all matching log files immediately. Always double-check the command and path before pressing Enter. If you are unsure, remove <code>-delete<\/code> first and review the listed files.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-browsing-folder-contents-with-ls-lah\">Browsing Folder Contents with <code>ls -lah<\/code>\u00a0<\/h2>\n\n\n\n<p>Sometimes you do not need to search if you just want to inspect what is inside a directory.&nbsp;<\/p>\n\n\n\n<p>For that, use the <code>ls <\/code>command with a few useful options:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -lah&nbsp;<\/code><\/pre>\n\n\n\n<p>This shows file sizes, permissions, and owners. It also displays hidden files, which start with a dot. Together, these details give you a clear overview of the current folder.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-watch-our-youtube-video-on-finding-files-in-linux\">Watch Our YouTube Video on Finding Files in Linux\u00a0<\/h2>\n\n\n\n<p>If you prefer a visual walkthrough, you can follow the connected YouTube video on How to Find Files in Linux. In the tutorial, the same commands are demonstrated step by step on a live Linux system, so you can see exactly how the searches work in practice.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container \" style=\"height: 100%;\"><iframe loading=\"lazy\" title=\"How to find files in Linux\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/8llOqLk5Ywc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion\u00a0<\/h2>\n\n\n\n<p>You now know the basics of the Linux file system and how its main directories are structured. With the <code>find <\/code>command, you can search files by name, size, or type, and even locate large files that fill your storage. You can browse folders comfortably with <code>ls -lah<\/code> and investigate what is happening on your server.<\/p>\n\n\n\n<p>With these tools, you can locate almost any file on your Linux server quickly and reliably.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finding the right file on a Linux server can be challenging at first. However, once you understand the structure of the file system and a few commands, it becomes much easier. In this guide, you will learn how to find files within Linux using simple, practical examples.&nbsp; Understanding the Linux File System\u00a0 In Linux, everything [&hellip;]<\/p>\n","protected":false},"author":77,"featured_media":26099,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[18],"tags":[],"ppma_author":[3116],"class_list":["post-26094","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"uagb_featured_image_src":{"full":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/Find-Files-in-Linux.png",1200,630,false],"thumbnail":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/Find-Files-in-Linux-150x150.png",150,150,true],"medium":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/Find-Files-in-Linux-600x315.png",600,315,true],"medium_large":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/Find-Files-in-Linux-768x403.png",768,403,true],"large":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/Find-Files-in-Linux.png",1200,630,false],"1536x1536":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/Find-Files-in-Linux.png",1200,630,false],"2048x2048":["https:\/\/contabo.com\/blog\/wp-content\/uploads\/2025\/11\/Find-Files-in-Linux.png",1200,630,false]},"uagb_author_info":{"display_name":"Anika Kopte","author_link":"https:\/\/contabo.com\/blog\/author\/anika\/"},"uagb_comment_info":0,"uagb_excerpt":"Finding the right file on a Linux server can be challenging at first. However, once you understand the structure of the file system and a few commands, it becomes much easier. In this guide, you will learn how to find files within Linux using simple, practical examples.&nbsp; Understanding the Linux File System\u00a0 In Linux, everything&hellip;","authors":[{"term_id":3116,"user_id":77,"is_guest":0,"slug":"anika","display_name":"Anika Kopte","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/1c425caa652c679ae47e3f85a48de4e19f09d37bcb5593ba88a7aa4a08bb1d81?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/26094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/comments?post=26094"}],"version-history":[{"count":6,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/26094\/revisions"}],"predecessor-version":[{"id":28268,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/26094\/revisions\/28268"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media\/26099"}],"wp:attachment":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media?parent=26094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/categories?post=26094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/tags?post=26094"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=26094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}