Most powerful examples of Unix commands or scripts every programmer should know

后端 未结 25 1463
遇见更好的自我
遇见更好的自我 2021-01-29 18:14

There are many things that all programmers should know, but I am particularly interested in the Unix/Linux commands that we should all know. For accomplishing tasks that we may

25条回答
  •  [愿得一人]
    2021-01-29 18:55

    The fact you can use -name and -iname multiple times in a find command was an eye opener to me.

    [findplaysong.sh]

    #!/bin/bash
    cd ~
    echo Matched...
    find /home/musicuser/Music/ -type f  -iname "*$1*" -iname "*$2*" -exec echo {} \;
    echo Sleeping 5 seconds
    sleep 5
    find /home/musicuser/Music/ -type f  -iname "*$1*" -iname "*$2*" -exec mplayer {} \;
    exit
    

提交回复
热议问题