pythonbeginer pythonbeginer - 6 months ago 16
Bash Question

creating a folder one level above the present location

I need to create a simple shell script to create a folder one level above the present location of the script. I was successful in getting the present location with:

#!/bin/sh
pwd


However, I got stuck how to go one level up to create a folder, suggestions would be helpful.

Answer

Use .. in your path to go up a directory:

#!/bin/sh
mkdir ./../foldername