Page loading ... ... Please wait!

banner gif

Cannot store cookies.
Sorry, but in that case your language and font size preferences cannot be saved. :-(

Beklager - der er ingen dansksproget version af denne side.

Mac OS X tricks

Contents

Use find, and lsto find, and display a sorted list of files:

In Terminal:

find <find arguments and options> -print0 2>/dev/null | xargs -0 ls <ls options>

>Example:

Find all files in, and below the current directory where "Zabadak" is part of the file name and list them sorted by modification time with the latest modified file first:

find . -name *Zabadak* -print0 2>/dev/null | xargs -0 ls -lth

[ 2018-07-15 ]

Use tar to create a compressed file including the relative path to all files in a subdirectory

Example:

Save a copy of all files from the "Cassette Tapes/The New Seekers/In Perfect Harmony/" subdirectory below "/Volumes/MUSIC_COLLECTION/Users/Christian/My Documents/My Music Original Files/" in a compressed file below "My Music Original Files/" in the home directory (below "~/My Music Original Files/"):
cd "/Volumes/MUSIC_COLLECTION/Users/Christian/My Documents/My Music Original Files"
tar -jcvf ~/"My Music Original Files/Cassette_Tapes~The_New_Seekers~In_Perfect_Harmony.tar.bz2"  "Cassette Tapes/The New Seekers/In Perfect Harmony/"

[ 2018-07-15 ]

Use find, grep, and lsto find, and display a sorted list of files containing a specific string:

Example:

List all files ending on .pl or .pm found recursively in the current directory (.) containing the string use CL::ooDebug, and list them in long format sorted in ascending order according to the latest modification time (mtime):
sudo ls -lTtr `sudo find . -type f \( -iname "*.pl" -o -iname "*.pm" \) -exec grep -l 'use CL::ooDebug' /dev/null {} \;`

[ 2018-07-15 ]

Christian Lange