Commands using find (1,252)

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

create a nicely formatted example of a shell command and its output
Shell function which takes a bash command as its input, and displays the following formatted output: EXAMPLE: command OUTPUT: output from command

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

find out how many days since given date
You can also do this for seconds, minutes, hours, etc... Can't use dates before the epoch, though.

Unzip and untar a *.tar.gz file in one go to a specific directory
A *.tar.gz file needs to be unzipped & then untarred. Previously I might have unzipped first with $gunzip -d file.tar.gz and then untarred the result with $tar -xvf file.tar (Options are extract, verbose, file) Using the -z (decompress) option on tar avoids the use of gzip (or gunzip) first. Additionally the -C option will specify the directory to extract to.

Get your outgoing IP address
Instead of opening your browser, googling "whatismyip"... Also useful for scripts. dig can be found in the dnsutils package.

List all installed kernels on Ubuntu except current one
Lists all installed kernels minus the current one. This is useful to uninstall older kernels that take too much space on /boot partition.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

create a progress bar...
A simple way yo do a progress bar like wget.

Find broken symlinks in the current directory and its subdirectories.
This is best run as root to avoid permission denials that can produce false positives. Obviously you can specify a directory in the usual way: $ find -L dirname -type l I can't remember where I read about this or who deserves the credit for it. The find(1) manual page hints strongly toward it, however.

Short one line while loop that outputs parameterized content from one file to another


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: