Giter Club home page Giter Club logo

useful-unix-commands's Introduction

Collection of useful unix commands and tool I've used over the years for work and projects

  • Search for a pattern string in a directory
grep -rnw /path/to/dir -e 'pattern_string_to_match'

  • Let the Terminal speak
say -v ?

to list the voice options.

say -v Alex --r=150 hello sir

  • Ping a remote host
ping www.HOSTNAME.COM

  • How long is the HOST up
uptime

Sample Output of uptime:

11:50 up 6 days, 21:41, 4 users, load averages: 3.20 15.22 11.69


  • Check disk usage of a directory
du -sh /path/to/directory

Sample output of du: 678M /Users/HOSTNAME/Documents/

This means that my documents folder has occupied 678 MB of space on disk


  • Check the weather in any city
curl http://wttr.in/LOCATION

Enter your city name in LOCATION


  • Download a file from the internet

We can use wget for this. Do a brew install wget on macOS or apt-get install wget on Linux

wget -O windows-security.pdf https://d1.awsstatic.com/whitepapers/aws-microsoft-platform-security.pdf

The command above downloads the pdf file at the URL resource, renames it and saves it in the current directory.

Sample Output:

Resolving d1.awsstatic.com (d1.awsstatic.com)... 13.225.6.181 Connecting to d1.awsstatic.com (d1.awsstatic.com)|13.225.6.181|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1221064 (1.2M) [application/pdf] Saving to: ‘windows-security.pdf’

windows-security.pdf 100%[======================================================================================>] 1.16M 885KB/s in 1.3s

2019-10-07 12:10:42 (885 KB/s) - ‘windows-security.pdf’ saved [1221064/1221064]


useful-unix-commands's People

Contributors

pippermonkey avatar svram avatar

Watchers

 avatar

Forkers

pippermonkey

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.