Been using UNIX since the late 80s; Linux since the mid-90s; virtualization since the early 2000s and spent the past few years working in the cloud space.
Location
Alexandria, VA, USA
Education
B.S. Psychology from Pennsylvania State University
ls is good for finding stuff when you basically know where the target "stuff" is. If you want real power, look at the find command.
Want to see all the files you've modified in the last 3 days?
find <DIR> -mtime -3
Disk is getting full and you want to identify disused files for archival?
find <DIR> -mtime +<DAYS>
Want to know where various DVD images you downloaded got to?
find <DIR> -type f -name "*.iso"
Want to find all files that are actually symlinks?
find <DIR> -type l
Want to see what files have the world-write permission set on them?
find <DIR> -perm /0002 -type f
The possibilities are near endless, especially once you add find's -exec built-in function or pipeline your find to other tools via xargs (e.g., find <DIR> -type f | xargs grep -l <STRING> will provide you a list of files that contain a given string).
ls
is good for finding stuff when you basically know where the target "stuff" is. If you want real power, look at thefind
command.find <DIR> -mtime -3
find <DIR> -mtime +<DAYS>
find <DIR> -type f -name "*.iso"
find <DIR> -type l
find <DIR> -perm /0002 -type f
The possibilities are near endless, especially once you add
find
's-exec
built-in function or pipeline yourfind
to other tools viaxargs
(e.g.,find <DIR> -type f | xargs grep -l <STRING>
will provide you a list of files that contain a given string).This is incredibly helpful! Thanks so much, I'm going to try these out ASAP!