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

后端 未结 25 1762
遇见更好的自我
遇见更好的自我 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:40

    Best answers from the Community


    Traverse a directory tree and print out paths to any files that match a regular expression:

    find . -exec grep -l -e 'myregex' {} \; >> outfile.txt 
    

    Invoke the default editor(Nano/ViM)

    (works on most Unix systems including Mac OS X) Default editor is whatever your "EDITOR" environment variable is set to. ie: export EDITOR=/usr/bin/pico which is located at ~/.profile under Mac OS X.

    Ctrl+x Ctrl+e
    

    List all running network connections (including which app they belong to)

    lsof -i -nP
    

    Clear the Terminal's search history (Another of my favourites)

    history -c
    

提交回复
热议问题