tag:blogger.com,1999:blog-8712770457197348465.post7971449358448140313..comments2024-03-19T01:04:48.783-07:00Comments on Javarevisited: 10 Example of find command in UNIX and Linuxjavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger48125tag:blogger.com,1999:blog-8712770457197348465.post-62195824267573317082017-03-23T23:53:23.634-07:002017-03-23T23:53:23.634-07:00find . -name "*equity*" -print
./equity
...find . -name "*equity*" -print<br />./equity<br />./cash equity tradingAnonymoushttps://www.blogger.com/profile/03163529328626873785noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-25368894611096184042016-09-08T02:36:46.116-07:002016-09-08T02:36:46.116-07:00It was very userful blog. Thanks for sharing.It was very userful blog. Thanks for sharing.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-4533579598019598192015-11-02T11:57:12.437-08:002015-11-02T11:57:12.437-08:00@anonomous
If you have a file, why to find that ?...@anonomous<br /><br />If you have a file, why to find that ?Anyways, here is what i tried. You would be required to try more yourself.<br /><br />var=`find . -name "file_name" -print`Vinilhttps://www.blogger.com/profile/16364698093053910442noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-571456263160469592014-05-22T12:53:18.045-07:002014-05-22T12:53:18.045-07:00I have a file name in one of my folder and i want ...I have a file name in one of my folder and i want to assign that file name to a variable after searching in that folder.. can u pls tell me a sample for getting file name to a variable Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-88837988699782122892014-04-02T05:12:24.150-07:002014-04-02T05:12:24.150-07:00great learning experince
Anonymous
I have tried...great learning experince<br /><br />Anonymous <br /><br />I have tried to answer your questions<br /><br />q) what is find command to search a file in linux?<br />ans) find . -type f -name "file1*" <br /><br />What is find command to find a string in file unix<br />ans) same as next question so same answer<br /><br />Q) what is find command to search a string in a file?<br />ans )Gaurav Khuranahttp://www.udzial.comnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-29610517422694357662014-03-27T08:31:31.550-07:002014-03-27T08:31:31.550-07:00On linux find, -exec supports the \+ as well as \;...On linux find, -exec supports the \+ as well as \;<br />This appends the filenames to the same command and consequently executes faster as it doesn't need to spin up a new process each time.<br />For instance:<br />find . -iname '*.txt' -exec rm {} \;<br />would execute<br />rm a.txt<br />rm b.txt<br />...<br /><br />find . -iname '*.txt' -exec rm {} \+<br />would execute<br /Anonymoushttps://www.blogger.com/profile/09187073696828834779noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-29890265188600099332014-03-27T00:42:48.748-07:002014-03-27T00:42:48.748-07:00Instead of xargs -0 one can also use xargs --null ...Instead of xargs -0 one can also use xargs --null option to work with files with space. Its very useful to find some files in directory and then find something inside those files. I love this command truly powerful.<br /><br /><b>find . -name "*.txt" print0 | xargs --null grep "John"</b>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-1668808115415752242014-03-05T07:18:14.094-08:002014-03-05T07:18:14.094-08:00you're not doing yourself any favors for askin...you're not doing yourself any favors for asking for answers to your homework. figuring it out on your own is parting the learning process! read the man page!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-7962760678068519512014-03-04T19:53:26.591-08:002014-03-04T19:53:26.591-08:00what is find command to search a file in linux?
Wh...what is find command to search a file in linux?<br />What is find command to find a string in file unix<br />what is find command to search a string in a file?<br />what is find command to delete files<br />What is find command to find large files in unix<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-51085317066950242702014-01-28T13:39:43.559-08:002014-01-28T13:39:43.559-08:00is there any way to run just ones "find"...is there any way to run just ones "find" and output to 4 different files based on different mtime ?<br /> <br /><br />find /DATA/HR -type f -mtime -30 -ls >> $data_feed/hr/dlt30.dat<br />find /DATA/HR -type f -mtime +30 -mtime -60 -ls >> $data_feed/hr/d30to60.dat<br />find /DATA/HR -type f -mtime +60 -mtime -90 -ls >> $data_feed/hr/Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-64893949595239769572013-01-06T19:52:51.626-08:002013-01-06T19:52:51.626-08:00Hi, I want to find all files which is more than on...Hi, I want to find all files which is more than one month old in Unix box, particularly in log directory and then want to create a tar file or zip file of that with name as file-month-year e.g. app-december-2012.tar or .gz. I have figured out command to find all files which are more than 31 days old in log directory e.g.<br /><br />find . -type f -mtime +31 -print<br /><br />but I don't knowRohannoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-46090123779295753472012-09-20T22:58:35.114-07:002012-09-20T22:58:35.114-07:00Another useful example of find command is that you...Another useful example of find command is that you can you can use find command to find all soft link in any directory on any UNIX based operating system e.g. Linux, Solaris or BSD. by using find -type you can see all symbolic links :<br /><br />find /home/username -type -l -print<br /><br />will display all soft links in /home/username directory. isn't it great use of find command ?Solaris dudenoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-14441891678803844582012-09-03T16:26:06.803-07:002012-09-03T16:26:06.803-07:00@ Anonymous written on August 27.... From my small...@ Anonymous written on August 27.... From my small understanding of unix, you could type a command that uses piping using a keyword: ls /home | grep keyword | more<br />I believe that would show it.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-72274847326433407432012-08-27T02:57:26.864-07:002012-08-27T02:57:26.864-07:00When i use the find command, it gives me the compl...When i use the find command, it gives me the complete path of the file (/home/.../.txt). Is there any way by which I can only get the without the complete path?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-56459285975361765112012-06-27T18:23:47.813-07:002012-06-27T18:23:47.813-07:00fantastic tutorial on find command. You have done ...fantastic tutorial on find command. You have done an awesome job by compiling these examples on find command. I always forget different options like -mtime or -size, now I can simply take a printout of this and have with me.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-59672075388175853122012-06-14T20:10:17.286-07:002012-06-14T20:10:17.286-07:00few of my own find command tips :
man find | grep...few of my own find command tips :<br /><br /><b>man find | grep --context=5 regex </b><br />This is my way to know about any find command line option , it will find word regex and print 5 lines around it, which is more than enough to know about how to use find with regex option<br /><br /><b>find -regex '.*.html'</b><br />-regex allows you to apply regular expression along with find. it Pushkar khannanoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-27865359511958430632012-06-03T18:41:52.368-07:002012-06-03T18:41:52.368-07:00@Anonymous you can use 'ls -lrt' to find l...@Anonymous you can use 'ls -lrt' to find last modified file and time. find can only search files in range of time specified by -mtime I guess.findhttp://en.wikipedia.org/wiki/Findnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-1862692297660325032012-03-21T23:18:58.015-07:002012-03-21T23:18:58.015-07:00unix command to find last modified file and time o...unix command to find last modified file and time of file/directoryAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-1571885181073906932012-03-12T12:16:11.722-07:002012-03-12T12:16:11.722-07:00Very good examples. All are very much useful in th...Very good examples. All are very much useful in the daily work of any one who uses UNIX.Thanks ,,,Prasanthnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-50231029539845838622012-01-29T20:55:05.850-08:002012-01-29T20:55:05.850-08:00I think best example of find command in unix is fi...I think best example of find command in unix is finding files by modified time, creation time etc. but power of unix find command is you can not only find files by names, types, modified time but also on several other attributes of file like finding read only files, finding all executable files in linux etc.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-54153613025445397502012-01-24T17:50:27.445-08:002012-01-24T17:50:27.445-08:00thanks a lot for this find one liners in Linux. I ...thanks a lot for this find one liners in Linux. I have been using your find command in Linux and Unix operating system from last few weeks and it helped me a lot. I also liked your grep command tutorial in Unix and Linux .those are my favorite. please do share some more useful unix and Linux command examples.Joenoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-6748167528345623322012-01-06T13:56:13.765-08:002012-01-06T13:56:13.765-08:00guys ..you can get more details about find command...guys ..you can get more details about find command on<br />unixbasic.blogspot.comAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-13509491221034909092012-01-04T02:26:49.387-08:002012-01-04T02:26:49.387-08:00Hi, my requirment is i want to see the last modifi...Hi, my requirment is i want to see the last modified file in my directory using find?chinukunoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-30801602128420521602011-11-02T05:21:48.700-07:002011-11-02T05:21:48.700-07:00Poor old Unix! Any good file manager could/should ...Poor old Unix! Any good file manager could/should do this with a few clicks without the need of such cryptic commands. Why these commands are not more intuitiv? This is still 1970's style where every bit and byte counted but nowadays it should be more ergonomic and user (not nerd) oriented - even on a text console. It would be great that Unix evolves this way one day.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-87408493534147204242011-10-20T03:02:05.261-07:002011-10-20T03:02:05.261-07:00HI I have one question,
i have some jar files in a...HI I have one question,<br />i have some jar files in a directory and in subdirectories , i need to find the jar having some filename , how come we do using the find command ?Anonymousnoreply@blogger.com