The gMan nixWiki

Because the mind is made of Teflon...

User Tools

Site Tools


general_find

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
general_find [2022/09/24 19:12] – [Find Files by Perms] gmangeneral_find [2024/01/19 00:06] (current) gman
Line 1: Line 1:
-====== FIND STUFF IN LINUX ======+====== Find Stuff in Linux ======
  
 There are four basic commands to find stuff in Linux:  There are four basic commands to find stuff in Linux: 
Line 7: Line 7:
   - find   - find
  
-====== whereis ======+===== whereis =====
  
 Searches for binary files, source files, and man pages for the specified command names. Switches: Searches for binary files, source files, and man pages for the specified command names. Switches:
Line 25: Line 25:
 ---- ----
  
-====== which ======+===== which =====
  
 Returns the path to the executable indicated.  Returns the path to the executable indicated. 
Line 35: Line 35:
 ---- ----
  
-====== locate ======+===== locate =====
  
 Fast way to search for files by name on your disk.  Fast way to search for files by name on your disk. 
Line 49: Line 49:
 ---- ----
  
-====== find ======+===== find =====
  
-===== Basic Syntax =====+==== Basic Syntax ====
  
 <code> <code>
Line 84: Line 84:
 ---- ----
  
-===== Search Location Shortcuts =====+==== Search Location Shortcuts ====
  
 The first argument after the find command is the location you wish to search (the starting point, and find will recurse into subdirs).  The first argument after the find command is the location you wish to search (the starting point, and find will recurse into subdirs). 
Line 97: Line 97:
 ---- ----
  
-===== Expressions =====+==== Expressions ====
  
 This specifies how we want to match what we are looking for.  This specifies how we want to match what we are looking for. 
Line 114: Line 114:
 ---- ----
  
-===== Find Files by Type =====+==== Find Files by Type ====
  
 Use the ''-type'' expression. The most common is "f" for file but the others are just as easy: Use the ''-type'' expression. The most common is "f" for file but the others are just as easy:
  
 ^  Type  ^ Description  ^ ^  Type  ^ Description  ^
-|   block (buffered) special | +|   regular file |
-|  c  | character (buffered) special |+
 |  d  | directory | |  d  | directory |
 +|  l  | symbolic link |
 +|  c  | character device |
 +|  b  | block device |
 |  p  | named pipe (FIFO) | |  p  | named pipe (FIFO) |
-|  f  | regular file | 
 |  s  | socket | |  s  | socket |
  
Line 136: Line 137:
 ---- ----
  
-===== Find Files by Size =====+==== Find Files by Size ====
  
 Use the ''-size'' expression. All units are rounded up (this is tricky!), for example, 1M = 1048576c but: Use the ''-size'' expression. All units are rounded up (this is tricky!), for example, 1M = 1048576c but:
Line 162: Line 163:
 ---- ----
  
-===== Find Files by Owner =====+==== Find Files by Owner ====
  
 Use the ''--user'' expression and provide the username or user ID (uid). Examples: Use the ''--user'' expression and provide the username or user ID (uid). Examples:
Line 170: Line 171:
 ---- ----
  
-===== Find Files by Perms =====+==== Find Files by Perms ====
  
 Use the ''-perm'' expression. There are three ways to specify perm mode:  Use the ''-perm'' expression. There are three ways to specify perm mode: 
Line 203: Line 204:
 ---- ----
  
-===== Find Files by Timestamps =====+==== Find Files by Timestamps ====
  
 You can find files by modification, access, or change in timestamps. You can find files by modification, access, or change in timestamps.
general_find.1664046768.txt.gz · Last modified: by gman