Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

find and exec command in linux

find . -name "*.mp3" -exec mp3info {} ;
find: ‘mp3info’: No such file or directory
Copy
Comment

linux command find executable

which <executable>

#Example:
which sudo

# sudo : acronym for superuser do or substitute user do
## sudo runs an elevated prompt without a need to change your identity.
## Depending on your settings in the /etc/sudoers file :
### you can issue single commands as root or as another user.
Comment

find and exec command in linux

function mp3info() {
    TRACK_NAME=$(basename "$1")
    FILE_DATA=$(file "$1" | awk -F, '{$1=$2=$3=$4=""; print $0 }')
    echo "${TRACK_NAME%.mp3} : $FILE_DATA"
}
Copy
Comment

find and exec command in linux

$ export -f mp3info
$ find . -name "*.mp3" -exec bash -c "mp3info "{}"" ;
01 - Das Trinklied vom Jammer der Erde :      128 kbps  44.1 kHz  Stereo
02 - Der Einsame im Herbst :      128 kbps  44.1 kHz  Stereo
03 - Von der Jugend :      128 kbps  44.1 kHz  Stereo
04 - Von der Schönheit :      128 kbps  44.1 kHz  Stereo
05 - Der Trunkene im Frühling :      128 kbps  44.1 kHz  Stereo
06 - Der Abschied :      128 kbps  44.1 kHz  Stereo
Copy
Comment

PREVIOUS NEXT
Code Example
Shell :: how to uninstall app from android phone programmatically 
Shell :: command to restart a system service 
Shell :: sed commands 
Shell :: check on cmd all installed version 
Shell :: ubuntu command line change line in file 
Shell :: TSC_DEADLINE disabled due to Errata; please update microcode to version: 0x22 
Shell :: stress-ng install on redhat 
Shell :: Rename git branch while working in the branch 
Shell :: windows xp enable remote desktop cmd 
Shell :: fold all lines in vim 
Shell :: github as database 
Shell :: dpkg command 
Shell :: pull from other branch 
Shell :: free ssl certificate for nginx 
Shell :: github claims I have a large file that 
Shell :: how to boot from grub rescue 
Shell :: format new disc linux 
Shell :: merge two branches in git command 
Shell :: linux -ltr 
Shell :: how to clone repo and change name 
Shell :: ionic icon dimensions 
Shell :: Do you need to install EsLint after intalling the extension 
Shell :: linux grep regex return match 
Shell :: how to get the filename without extension 
Shell :: How to use alias in Linux bash 
Shell :: bash print file permissions 
Shell :: pdf compressor linux 
Shell :: gnu octave ubuntu 
Shell :: git hub 
Shell :: sms_autofill flutter 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =