In this video, I go over how to find files in Linux terminal. In this Linux Tutorial you will learn everything you ever wanted to know about the find commend and even some stuff you didn’t know you wanted to know.
Basic syntax
-find options starting/path expression
$ find ~ -name media*
Note: -name is CASE SENSITIVE for results
$ find /var/html -name *.html
$ find ~ -type d -iname Downloads
Note: -iname makes it so results are not matched based on CASE.
Advanced syntax
Find Files based on modified in the past 1 day
$ find ~ -mtime -1
Note: cull this down by using | grep partial file name
Or Find Files based on modified in the past 10 minutes
$ find ~ -mmin -10
OR find Files based on modified in the past 10 minutes and greater than 10 megs
$ find ~ -mmin -10 -size +10M
You can also add the -delete command at the end to delete ALL FILES FOUND!!! Use with extreme caution!
Bonus easily find where a program is located with “whereis”
$ whereis gimp
💻 Recommendations 💻
– My Windows Anti-Virus ➜
– My VPN Service ➜
– Website Recommendations ➜
🕹 Live Streams Monday & Friday 🕹
– Twitch ➜
– YouTube Archive ➜
🖥 Contact me 🖥
– Patreon ➜
– Official Site ➜
– Twitter ➜
🚑 Need Help!? Ask our community! 🚑
– Discord ➜
– Reddit ➜
💰 My Amazon Store (YouTube Gear, PC Hardware, and Books I recommend) 💰
–
DISCLAIMER: This video and description contain affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This helps supports the channel and allows us to continue to make videos like this. Thank you for your support!
Nguồn: https://codeigniterbrasil.com
Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-linux/
Xem thêm Bài Viết:
- Hướng dẫn sử dụng hệ điều hành linux siêu tốc – bài 25 Xem cấu hình hệ thống (cpu, ram, hdd)
- Linux cat command summary with examples
- Cài nhiều hệ điều hành Windows và Linux trên một máy tính
- Hướng dẫn tạo USB Boot DLC2019 (NTFS / UEFI) Trên windows 10 ( sử dụng USB 32 GB )
- Hướng dẫn gỡ bỏ Ubuntu sạch sẽ nhất bằng lệnh trên Windows theo chuẩn UEFI-GPT
gilkesisking
April 25, 2020Good stuff Chris. Additional options for find…
-perm 777 ( permissons )
-empty
-maxdepth ( how far down the tree you want to look )
locate command is another good one.
Mark G0usl
April 25, 2020whereis DAMN! just brilliant. Never heard of that one before Very useful thanks
Gary XHLC
April 25, 2020Thank you, even after using Linux for 10 years and trying to puzzle out man pages (which are complete, detailed, factual, and often utterly useless), I'd given up on finding via terminal (except for executables when I can use whereis ) because I never got the command parameters right — I'd either get no result, or the entire disk volume listed!
Jurgen Blick
April 25, 2020Love your stuff
Zellonous
April 25, 2020Helpful. Thank you.
deemon
April 25, 2020What is the widget you use in your right bottom corner that shows core and disk usage?
Shriniwas Kulkarni
April 25, 2020Awesome video on Linux "find" command. learned so much.
If you can, If possible can you make one video on Linux file system or file system hierarchy? and how it works?
Thanks for the video!
footb 4all
April 25, 2020Great,you should be mentioning mlocate command
HewFreBie
April 25, 2020GNU/Linux or Unix-like joke:
sudo whereis cat?
fourdotsYT
April 25, 2020Also find a command with:
$ which <command>
e.g.
$ which mv
/bin/mv
David Heremans
April 25, 2020Chris, you should have used 'media*' between quotes.
If you had a file in your current directory named fi. 'media.jpg' then bash would have replaced your medi* with media.jpg and you would be looking only for that filename.
If you had two filenames starting with media, bash would have replaced media* with those 2 names and the find command would have thrown an error.
So I guess it is time for you to make a video talking about wildcards and globbing 😉
suT3
April 25, 2020Just wondering: why 46GB of swap?
teamvigod
April 25, 2020Should also cover "slocate" command. Super quick, easy and secure way to index and search for files:
https://linux.die.net/man/1/slocate
Anthony Rima
April 25, 2020Congrats on 10k followers! Another great video, I'm loving these
Theodoros Nicolaou
April 25, 2020This is going to be so useful, thanks! Awesome video, as always.
Sebastian Dumbrava
April 25, 2020I see u reached 10k subs. congrats 🙂
tpasi2020UG
April 25, 2020Thank you! Thank you! Thank you! Thank you! Always wanted to learn this. Thank you!
Solo B
April 25, 2020You're killing it Chris!! I love these kinds of videos. However, I'd like them to be a bit more detailed for beginners like me. Also, longer tutorial from you is always awesome!
Cheers.
Lifeless web user
April 25, 2020Can you do a video about what you think ov Richard Stallman?
stuart
April 25, 2020Wait. So the options only use 1 dash "-"?! I thought when the options used words it was 2 dashes "–"? Ex: `ls -h` == `ls –human-readable`
Chris
April 25, 2020Hey Chris,
From a Terminal beginners perspective i feel like you went really really fast in this video, id like to know what every bit of the command does and have time to comprehend that personally, like really overexplaining things would be helpful for it to stick in. Overall though its a wellmade video with great info, thanks 🙂