Get all files with a certain extension linked to on a page

wget -r -nd -q -A "*.ext"
Change *.ext to the appropriate extension

By: phracker
2014-07-04 18:28:07

These Might Interest You

  • Meaning of switches (see man page too): v verbose p ignore mode (permissions) o ignore owner, group t ignore time of modification Disadvantage: If you modify any linked file, this will propagate to all other files which occupy the same space. Show Sample Output

    hardlink -vpot .
    knoppix5 · 2012-04-09 12:40:38 0
  • Shows all linked file and destinations. The 'ls -l' command lists the files in long (1 file per line) format, and the grep command displays only those lines that starts with an l (lower case L) -- a linked file. Updated: Remove reference to hard links because this command does not apply to hard link as others kindly pointed out. Show Sample Output

    ls -l | grep ^l
    haivu · 2009-04-02 17:47:36 2
  • Very useful to get rid of backup files or wrong extension files that lure in your folders In this example first I do two searches for all filenames of the two extensions .jpg and .png, then delete the extension and only output the now duplicate files. I loop with these results and print a log and delete the file with the extension I dislike. Show Sample Output

    for f in `comm -1 -2 <(sort <(find contrib/image/ -name *.png | sed 's/\.[^.]*$//')) <(sort <(find contrib/image/ -name *.jpg | sed 's/\.[^.]*$//'))`;do rm "$f.png" && echo "deleted: $f.png";done
    TheoNaciri · 2017-11-28 15:48:15 0
  • Changing a file extension to a new one for all files in a directory.

    rename .oldextension .newextension *.oldextension
    haithamg · 2009-02-10 16:58:05 3

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? 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

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.


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: