User Tools

Site Tools


wiki:finding_files

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
wiki:finding_files [2020/04/29 18:01] – [Examples] walkeradminwiki:finding_files [2023/04/03 17:12] (current) walkeradmin
Line 1: Line 1:
 ====== Finding Files ====== ====== Finding Files ======
 <color darkorange>Apr 2020</color> <color darkorange>Apr 2020</color>
 +\\ 
 +<color darkorange>Updated Apr 2023</color>
 \\  \\ 
 \\  \\ 
Line 9: Line 11:
  
 One thing I have always struggled with is finding things in CentOS. So here I am going to put a few examples, and over time hopefully add some more. One thing I have always struggled with is finding things in CentOS. So here I am going to put a few examples, and over time hopefully add some more.
 +\\ 
 +\\ 
 +<color #ed1c24>If you are not 'root' then you can't search for any file/folder that requires root privileges.</color>
 \\  \\ 
 \\  \\ 
Line 16: Line 21:
  
 To find a file, use: <color #ed1c24>find / -file "install.sh"</color> To find a file, use: <color #ed1c24>find / -file "install.sh"</color>
 +I think -file should be - name: <color #ed1c24>find / -name "install.sh"</color>
 \\  \\ 
 \\  \\ 
Line 25: Line 31:
 \\  \\ 
 If you are unsure about the filename, but can remember some of it, a wildcard search might help: <color #ed1c24>find / -name “myFile*”</color> If you are unsure about the filename, but can remember some of it, a wildcard search might help: <color #ed1c24>find / -name “myFile*”</color>
 +\\ 
 +\\ 
 +Find files with the same extension: <color #ed1c24>find / -name *.log</color>
 +\\ 
 +\\ 
 +If you only wish to find folders then use -type d: <color #ed1c24>find / name home -type d</color>
 +\\ 
 +\\ 
 +If you are only interested in files created in the last 2 days use: <color #ed1c24>find / -name home -type d -mtime -2</color> This looks for folders called home created in the last 2 days.
 +\\ 
 +\\ 
 +
wiki/finding_files.1588179700.txt.gz · Last modified: 2023/03/09 22:35 (external edit)