Find code and diagrams at:

To find files and configurations in Linux you can use the find and whereis commands.

Whereis who’s you the folders where data for applications are stored. Find allows you to search for files and folders on the system.

Whereis:

Find:

Whereis

whereis php – shows where PHP files are stored.
You can run whereis from any directory and do not need to use sudo.
Find

Find allows you to search your system for files and folders. If you receive permission issues or an odd response try using sudo.
sudo find / -name ‘test.txt’ – command / location to start from (if left blank find starts from the folder you are in / argument / file being searched for.
-name – case sensitive search
find -name ‘test.txt’
-iname – case insensitive search
find -iname ‘test.txt’
-user – searches based on user owner
find -user ‘bob’
-cmin – searches based on time since a file was modified
find -cmin -10

Nguồn: https://codeigniterbrasil.com

Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-linux/

22 Comments

Tone Baxter

April 28, 2020

Not to oversimplify it but just remember your config files are always found in the /etc folder and to find your last modified files including hidden files use ls -lrt ( just food for thought)

Reply

Marian Orleans

April 28, 2020

Thanks for the clear explanations.

Reply

Sam Ben

April 28, 2020

Great content

Reply

Arul T

April 28, 2020

Nice video 👌

Reply

SynthFrost

April 28, 2020

Haven't watched you in ages! Glad to see you are still alive Eli!🙏😂

Reply

defialpro

April 28, 2020

If you need to copy a file from anywhere in the system to cwd, then do cp $(locate file.txt) . You can also pretty much use any command with this syntax like chmod or even change the locate to a find.

Reply

defialpro

April 28, 2020

Protip: do a compgen -c to list all available binaries

Reply

DarkSoldier

April 28, 2020

Hello , Eli greetings from Ecuador, thanks you for all your interesting work and contribution to the knowledge of many people around the world.

Reply

G H

April 28, 2020

Good to see you doing instructional videos again!

Reply

Steve

April 28, 2020

In addition to using 'whereis' you can also use 'locate' and 'which'. 'find' searches intensively and recursively , 'whereis' and 'which' , only search inside those directories that are mentioned in your PATH variable and only those with executable permissions set. 'locate' is usually for searching a database quickly, its great when you have no idea where something is because of the way its able to index the system. This is a beginner Linux series right. Your teaching 'apt apt-get' , not to confuse anyone but since this series is based on a Ubuntu Server… You have another option for installing software , they're called 'snaps' . 'snaps' are distro agnostic , meaning they work on any linux system debian,arch,gentoo no matter what the base is , snaps are applicable. I am going to suggest one , first install 'sudo apt-get -y install snap snapd' , and then 'snap install cheat' . MAN pages can be confusing , they almost never give actual examples on how to use a command. By typing 'cheat thecommand' it will tell you what the command is and several actual examples on how to use the command. For example 'cheat find' and you will get several examples and explanation of the 'find' command. There is a similar package called 'tldr' , if for some reason its not in your default repos grab it from the net and install the binary. It functions the same way as 'cheat' , for example 'tldr tar' or 'tldr find' . With these examples you can try out CLI utils with your own files because you now know all of the functions and their proper syntax. As a side note , I wouldn't just run any command especially with ROOT permissions, use discretion.

Reply

the wanderer

April 28, 2020

Seriously Eli, thank you so much for this. I'm loving this series.. it's great to see someone who is actually explaining Linux as a normal guy not some stuck up dev… thanks again man!

Reply

Mustafa Darrar

April 28, 2020

HI Eli – I used to follow your channel years ago, learn a lot from you, but contents of your channel changed after you came back from a road trip. Last I watched your video, you were dropping f-bomb, more power to you but not the stuff I want to watch on YouTube. Today, so good to see you talking about technology again.

Reply

WickedWeb DesignRI

April 28, 2020

Ya know Eli, I could have used this like 10 years ago when I first found your videos 😉 Instead I took the "Try Harder" route.

Reply

Mr. Tech Guy

April 28, 2020

A very very very useful tutorial…

💯💯💯💯💯

Reply

Brad Olson

April 28, 2020

Aren't .ini files a windows thing? I've seen them in my Win 10 box but not in my Linux Boxes.

Reply

The Simple Rules S

April 28, 2020

Thank you for the value last 5 years

Reply

The Simple Rules S

April 28, 2020

Welcome back mr E

Reply

Perhaps

April 28, 2020

@3:21
"In the real world, you use google".

Please do not promote google, its browser, etc. As a Linux instructor, as a Linux administrator, as a Linux enthusiast, you should understand how google is the polar opposite for open source, non intrusive Linux. google does everything that is contrary to the Linux code of ethics. google made their fortune on spying on the world; on eliminating privacy for all.

Please, instead, mention duckduckgo.com (or the non tracking, non spying, search engine of your choice).

Thank you.

Reply

debeeriz

April 28, 2020

thanks just what l wanted to know, are the quotation marks neccessary, mine seems to work without them

Reply

Justin Morbe

April 28, 2020

Fear enough 10x

Reply

Łukasz Waligórski

April 28, 2020

Important video. A bit too long but does the job

Reply

Raging Lion

April 28, 2020

1st like….. 1st comment yayyyy……🤙🤙🤙👍👍

Reply

Leave a Reply