How to find a file in Linux?
In this tutorial, we will use some commands that help us to find files in Linux. These commands are: echo ls find whereis locate List files using echo command Many people are not aware of echo command potential. This will come very handy when listing files in a given directory where ls, find and other commands are not available in rescue mode. This is because echo is a built-in command and available in any basic Linux machine. The echo command uses Bash shell expansion to list files in a given directory. To list files in a given directory use below command. [10:23:38] [VPS1-centos7] root:/bin # echo *test gr2fonttest grub2-fstest mysqltest sctp_test View files using ls command The simplest way is to use ls command if you are looking inside a directory of files [10:23:38] [VPS1-centos7] root:/bin # ls *test* gr2fonttest grub2-fstest gtester gtester-report mysqltest sctp_test snmptest test testgdbm testparm varnishtest You can use several options with ls. The most used options are : -l : list -a : all files even hidden ones -h : human readble -r : reverse order while sorting -t : sorts output based on the date of modification of the file [10:28:07] [VPS1-centos7] root:/bin # ls -ltr *test* -rwxr-xr-x. 1 root root 30488 Jun 9 2014 testgdbm -rwxr-xr-x. 1 root root 32520 Jun 10 2014 sctp_test -rwxr-xr-x. 1 root root 147576 Mar 16 2015 varnishtest...
Read More