Mittwoch, 2. Dezember 2015

Useful Mac OS commands

This blog is a cheat slip of commands I use on a regular basis, but where I also google for all the time.

Start quick and dirty http Server to allow access to download a file
- cd to the folder you like to expose a file via http i.e.
$ cd Downloads

- identify your external IP address:
$ ifconfig

Issue the following python command:
$ python -m SimpleHTTPServer 8080

Now your file should be downloadable via
http://your-public-IP-address:8080/your-filename
 


Safely remove files in trash (esp. for El Capitan)
# srm -rfv -m  

Highlight the files in trash and drag into terminal behind the command. Remember to have a blank space behind the "m" and the path to the first file.
 

where
r  - (recursiv - removes the contents of directories)
f  - (force - never prompt, ignore non existing files)
v - (verbose - explain, what is beeing done)
m - (overrite with 7 US DoD complient passes)