Wie finde ich den Pfad für eine bestimmte Datei?
Wie finde ich das Verzeichnis für eine Datei?
In meiner Unix-Shell weiß ich, wie man den Befehl ls
, aber er zeigt nur den Namen der Datei. Ich brauche auch den Weg. Wie bekomme ich es?
3
3 answers
echo "$PWD/filename"
gibt den Namen des Dateinamens einschließlich des Pfads aus.
5
Author: Michael Hoffman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2011-10-10 22:29:27
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2011-10-10 22:29:27
3
Author: slhck,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2011-10-10 22:40:54
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2011-10-10 22:40:54
In Linux können Sie readlink -f
; auf BSDs realpath
könnte funktionieren.
2
Author: user1686,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2011-10-11 12:33:18
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/techietown.info/template/agent.layouts/content.php on line 61
2011-10-11 12:33:18