Sponsored by Travelzoo
Take Advantage of Ridiculously Low Holiday Airfares view!
travelzoo.com - Flights $52 and up for Thanksgiving, Christmas & New Year. But move on it now.
61 Comments
- m0zzie, on 09/26/2008, -0/+17while it seems pretty simple to those of us who've been using linux for quite some time, i think you'll find that a lot of the newer users (those who have switched from windows to the very user-friendly linux distros for their desktops) do not actually have a very good understanding of searching via the command-line. i've been asked quite a number of times by various people who've switched, how to actually efficiently and easily search for files.
- RoboDonut, on 09/25/2008, -0/+13#6 - ZSH + extended globbing.
echo ./**/*.(h|c|cpp) - r0b1, on 09/26/2008, -0/+10Maybe people who work in Unix as part of their jobs?
- tvanwyk, on 09/26/2008, -0/+8People who have two hands.
- m0zzie, on 09/26/2008, -2/+10well then no offense, but your opinion is very uninformed, and partially retarded.
good day to you. - WorldGroove, on 09/26/2008, -2/+9Do this in Konqueror:
________
for f in `find ./src/WiiKit/myProject/ -type f -exec grep -l __WIIMOTE_LEFTARROW *.cpp`
do
cat $f | sed 's/WIIMOTE/WIIREMOTE/' > tmp
mv $f $f.orig
mv tmp $f
done; - morgrar, on 09/26/2008, -1/+8CLI is far more powerful than that rodent thing.
- HonoredMule, on 09/26/2008, -1/+7All of the above failed to locate the configuration file I needed to edit on my remote server. :(
- rowjimmy, on 09/25/2008, -1/+7whereis only works for programs/executables/etc
- 10goto10, on 09/25/2008, -2/+7My search has a dog.
- obsaysditto, on 09/25/2008, -1/+5good start for anyone who is trying to use the terminal instead of point and click
- papastout, on 09/25/2008, -2/+6whereis - easiest to use, and most direct in response
- juliohm, on 09/26/2008, -0/+4well, to be fair... this is, indeed, under the Linux section... unlike Google or iPhone which seem to be everywhere these days...
- PhailQuail, on 09/26/2008, -0/+4I like using find, because you can use it to execute a program for each file that you find
find -name "*.dll" -exec rm {} ; - juliohm, on 09/26/2008, -0/+4locate is da *****
- inactive, on 09/26/2008, -0/+3It made the front page of Digg because of the big Obama advertisement.on the site.
- AmaDaden, on 09/26/2008, -0/+3That does not mean they know them all. I've been using Linux for 3 years now and because of this article i just learned about which. For the longest time I was just using find and comparing it to the out put of PATH manually. I, like many people, am self taught in Linux and most aspects of computers. It's easy to just never stumble across a handy command that you have needed but never knew about.
- freedomics, on 09/26/2008, -0/+3The -exec option to the find command is an extremely useful option for performing batch tasks. For example, "find /home/steve -type f -ctime +30 -exec mv {} /data/archive ;" will find all files in directory /home/steve that are older than 30 days and move them to a directory called /data/archive.
Slightly related to the article is the lsof command, which lists open files and can be used to find files that are actively being used by a process. "lsof -u apache" will find all files currently opened by user apache. There are a ton of options to the lsof command, making it a very valuable troubleshooting tool. - rkef, on 09/26/2008, -0/+3\;
- NAvAP, on 09/26/2008, -0/+3For those mac haters, look up http://launchy.net works wonders.
Runs on windows and linux. - hojothum, on 09/26/2008, -0/+2I find this format very useful:
find . -type f -name "*.xml" -exec grep "keystore" {} ; -print
(this example find all files with the xml extension under the current directory that contain the text "keystore") - RBrenner14, on 09/26/2008, -14/+16Top Five Ways to Search for Files:
1) Not the terminal.
2) Not the terminal
3) Not the terminal
4) The Pirate Bay
5) Not the terminal - inactive, on 09/26/2008, -0/+2linuxhaxor has to be the worst site ever. its like its run by 10 year olds who downloaded ubuntu, grabbed the first unix quick start pocket guide they could find and made a website. the fact that it always makes the front page says even more about digg.
- norge1970, on 09/26/2008, -1/+3thanks for the post... I "found" it helpful
- AmaDaden, on 09/26/2008, -0/+2Two groups. People who want to use tools that have little or no GUI (very common in Linux) and people who want to write scripts (would be more common if people realized just how simple it is).
I agree that you should not NEED to use the command line but the truth is that it's very powerful and quick after you get the hang of it. Personally I have found running grep and find via cygwin to be by far the fastest and simplest way to search for things when running XP.
As for scripts there are many thing that people do every day that a little scripting can speed up. For example I read somewhere around 20 web comics(yeah I know, it's a lot). So what I did was I made a quick one line script that starts up firefox and opens up to the home page of all 20 of my comics. It may not sound like much but it saves me the trouble of manually opening up 20 links every morning. With out my basic knowledge of the command line I would not have been able to write this and would be losing an extra 5 minutes before work every morning to clicking links.
Yes the command line is scary but just like learning to read and learning basic math it's a good skill to have and not all that hard once you get started - tvanwyk, on 09/26/2008, -1/+3Ironic. The fact that you can make moronic statements like that on Digg is largely thanks to the skill of professional networkers in console configuration of routers and switches.
Just sayin'. - peevegrider, on 09/26/2008, -1/+3Now I realize not everyone who uses Ubuntu claims to know *nix like the back of their hand and yet has no idea what you can do with the *nix, but Jesus wtf have they done to the user base?
- evanfrey, on 10/05/2008, -0/+1doh!
- inactive, on 09/26/2008, -0/+1BUT WHAT ABOUT FASTCATE
- r0b1, on 09/26/2008, -0/+1Uh...
$man find - Aurabolt, on 09/26/2008, -0/+1slocate
- rchargel, on 09/26/2008, -0/+1remember to occasionally run updatedb or locate will be out of date.
find is better, but it does throw a lot of warnings if your searching recursively through directories you may not have access to. - OneEyedParrot, on 09/26/2008, -0/+1I much prefer the hard disk platter and magnetometer method, although these utilities do have their use.
- evanfrey, on 09/26/2008, -0/+1in path....
- tvanwyk, on 09/26/2008, -0/+1Yeah. The fact that updatedb is usually only updated once (or even a few times) a day means its DB can be useless (not always).
Hourly cron job might be a good idea. - mrBitch, on 09/28/2008, -0/+1correct, so it should look like this :
find -name "*.dll" -exec rm {} \; - mrBitch, on 09/28/2008, -0/+1launchy is pretty good, but not anywhere remotely in the same league as spotlight or (even better still) quicksilver.
- bradleyland, on 09/26/2008, -0/+1For cleaning up those pesky dll files that keep finding their way on your your Linux box?
btw, don't forget to escape the semi-colon at the end or `-exec` will think you mean to include it in the command you're passing. - twigboy, on 09/26/2008, -0/+1obviously.
- javaroast, on 09/26/2008, -0/+1And if the find output is very long xargs is your friend.
- alphabethsoup, on 09/26/2008, -0/+1Uh. Yeah, these are definitely common, useful commands. Part 2: How to use 'ls'. Part 3: The incredible 'whoami' command.
If you don't know these commands even exist, and thus can't use 'man' to figure out how to use them (coming up in Part 4!), just go buy 'Linux for Dummies' or any basic book you can find on how to utilize a shell. - Stonekeeper, on 09/26/2008, -1/+2You win Moronic Windows User of the day. Congratulations!
- tdmoney, on 09/27/2008, -0/+1a few pretty good tips here for newbies
- apophenic, on 09/26/2008, -1/+2http://www.overcompensating.com/posts/20080207.htm ...
- inactive, on 09/26/2008, -0/+1Finding large files and directories in Linux http://sharjeelsayed.blogspot.com/2008/04/dealing- ...
- zwaldowski, on 09/26/2008, -1/+1The fastest one I've always used with a terminal is "cd path" and then "ls | grep name" and then "ls ./*/ | grep name" and so on. A little kludgy, but it's cross platform in OS X and Linux/Unix.
- cbeagle, on 09/26/2008, -1/+1Where did anyone say that Digg is a news site? Go back to slashdot and leave us alone!
- evanfrey, on 09/26/2008, -1/+1find -name "*.dll" -exec rm {} /;
- makario, on 09/03/2009, -1/+1Gnome Do's better, IMO.
- Atsumori, on 09/26/2008, -1/+11. Never been to Slashdot
2. Watch any diggnation and hear Kevin Rose say that it's a news site.
So FU -
Show 51 - 62 of 62 discussions




What is Digg?