Author Topic: Simplicity of Linux  (Read 17959 times)

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+31)
  • *****
  • Posts: 14,478
Re: Simplicity of Linux
« Reply #90 on: January 10, 2017, 09:59:58 PM »
You've no idea just how handy that little string was when I needed it.  Have a program that traverses a directory tree, reads metadata and build a database from it.  You can then make changes in the db and write them back to the underlying files.  Only problem is prog handles all media types so the processing would take hours and build a large db whereas I was only interested in a small subset of files scattered across approx 9TB of files.  Solution - change ownership and deny prog access to files I don't want processed. When done, revert ownership and permissions. Sorted everything inside 20 mins. :2thumbs:
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+31)
  • *****
  • Posts: 14,478
Re: Simplicity of Linux
« Reply #91 on: March 20, 2017, 05:08:24 PM »
Increment the modified timestamp of all folders and files in a directory tree by a given time interval using their existing timestamp as a base

Code: [Select]
find . -print0 | xargs -0 -I '{}' touch -m -r '{}' -d '+1 second' '{}'
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline BWS

  • Administrator
  • Trade Count: (+1)
  • *****
  • Posts: 15,687
Re: Simplicity of Linux
« Reply #92 on: March 20, 2017, 05:23:05 PM »
^^ Why did you need to do that ?
Whoever originally coined the word 'Lisp' and put an 'S' in it's spelling, is a Douchebag !!

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+31)
  • *****
  • Posts: 14,478
Re: Simplicity of Linux
« Reply #93 on: March 20, 2017, 05:41:22 PM »
^^ Why did you need to do that ?

I've got my tagger set to preserve mod time when I make changes and I've got Roon set to regard a file's mod time as the import date...so as long as I always use touch before moving tunes to my server I can always browse albums in the sequence I got them (as well as many other sort order's Roon provides).  If Roon doesn't see a change in last mod time it will not rescan tag contents in existing files.   This triggers a forced rescan to pull in tag changes.
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline dekardy

  • Trade Count: (+16)
  • AVForums Veteran
  • ***
  • Posts: 273
Re: Simplicity of Linux
« Reply #94 on: March 20, 2017, 06:08:51 PM »
Code: [Select]
-d '+1 second' '{}'

That's very clever.  I never knew about the "-d" option.  Very handy.  Guess I should read man pages more :shh:.

Offline BWS

  • Administrator
  • Trade Count: (+1)
  • *****
  • Posts: 15,687
Re: Simplicity of Linux
« Reply #95 on: March 21, 2017, 09:24:26 AM »
Very simple command, more for maintenance and cleaning up, use it all the time to clean up orphaned log files that take up space

Change the head number to increase the number of files. This will output the biggest files in a directory and its subdirectories.

I realize I may be telling you how to suck eggs, but some may not know it but need it


Code: [Select]
find /path/to/dir/ -printf '%s %p\n'| sort -nr | head -10

find . -printf '%s %p\n'| sort -nr | head -10
Whoever originally coined the word 'Lisp' and put an 'S' in it's spelling, is a Douchebag !!

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+31)
  • *****
  • Posts: 14,478
Re: Simplicity of Linux
« Reply #96 on: March 21, 2017, 10:13:11 AM »
^^^ you assume I'm a Linux gun, fact is I'm just a few steps ahead of a newbie...hence this thread :D
« Last Edit: March 21, 2017, 01:05:20 PM by Rotten Johnny »
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+31)
  • *****
  • Posts: 14,478
Re: Simplicity of Linux
« Reply #97 on: June 11, 2017, 10:29:56 AM »
Invoke concurrent instances of a command leveraging multiple CPU cores

In this case I'm re-encoding all FLAC files in a directory tree, four at a time instead of one at a time:

Code: [Select]
find -type f -name \*.flac -print0 | xargs -0 -n1 -P4 flac -f -8 --preserve-modtime --verify --no-padding
Change -P4 to -Px where x is the number of CPU's in your machine.
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+31)
  • *****
  • Posts: 14,478
Re: Simplicity of Linux
« Reply #98 on: July 08, 2017, 12:51:20 PM »
because I keep forgetting this...  :fuse:

touch all files in a directory tree changing date and time stamp to now:

Code: [Select]
find . -exec touch {} \;
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+31)
  • *****
  • Posts: 14,478
Re: Simplicity of Linux
« Reply #99 on: July 24, 2017, 08:11:36 AM »
and because I keep forgetting this also   :wallbreak:

Transcode Monkeys Audio (.ape) files to FLAC format

Firstoff install shntool if not already installed, now for the business
Code: [Select]
shntool conv -o flac *.ape
or

Code: [Select]
shnconv -o flac *.ape
or

Code: [Select]
for i in *.ape; do mac "$i" - -d | flac -o "${i%*.ape}.flac" -; done
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.