Wie erstelle ich eine Terminalverknüpfung, um einen bestimmten Ordner zu öffnen?

2168
Michael Prescott

Ich habe kürzlich zu einem Mac gewechselt und möchte meinen Workflow ein wenig verbessern. Ich muss oft Skripts mit dem Terminal ausführen, die sich in verschiedenen Ordnern befinden.

Wie erstelle ich so etwas wie Windows-Verknüpfungen, die die Terminal-App starten, wobei das ursprüngliche Arbeitsverzeichnis auf einen bestimmten Ordner eingestellt ist?

4

2 Antworten auf die Frage

2
Richard Hoskins

Sie könnten Applescript schreiben und als Anwendung speichern.

z.B

tell application "Terminal" do script "cd ~/Clients/Yoyodyne/" end tell 
2
Fizwidget

If you want Terminal to start in the same directory each time, the following solution is probably best. If you want multiple different shortcuts for different directories, the above solution is better.

When running Terminal, navigate to:

Preferences > Settings > Shell > Startup

From there, simply tick "Run command: " and type the appropriate terminal command in the box (for example, cd ~/Desktop/ changes to your desktop folder).

Now whenever you start Terminal, it will change to that directory.