Hi Board Members,
I am currently taking an online course on udemy.com to refresh my very old Linux skills. So consider me a newbie since it has been fifteen years since I was somewhat proficient.
In the course we are covering the "find" command and my results are not what the instructor is returning. When i use find with a path is returns nothing whether the file is there or not. When I use find from the directory it returns the result. For example:
[adminuser@localhost /]$ find /sbin -name zic
[adminuser@localhost /]$ cd /sbin
[adminuser@localhost sbin]$ find -name zic
./zic
[adminuser@localhost /]$ find /sbin -name lkdfhgod
[adminuser@localhost /]$
[adminuser@localhost /]$ find /sbin
/sbin
[adminuser@localhost /]$
Can someone shed some light on this for me? Thanks!
find commandwith path not returning results
Re: find commandwith path not returning results
Your example doesn't work because /sbin is now a symlink to /usr/sbin in CentOS 7. Using /usr/sbin (the symlink target) works. To make it follow the symlink you'll need to use find -L /sbin -name zic
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: find commandwith path not returning results
Thank you very much! The instructor must be using an older version as he was using /sbin in his examples, without -L.
I finally figured it out a few minutes ago when I did this:
[adminuser@localhost /]$ find /usr -name zic
/usr/sbin/zic
Thank you for confirming that /sbin was not formerly a symlink, that clears up the confusion.
I finally figured it out a few minutes ago when I did this:
[adminuser@localhost /]$ find /usr -name zic
/usr/sbin/zic
Thank you for confirming that /sbin was not formerly a symlink, that clears up the confusion.