From 1fad5ca3bdefa8a618fd7066ead423caadce1174 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca Date: Mon, 8 Nov 2021 11:47:02 +0100 Subject: [PATCH] Add notes on testing file & directory existance --- Bash/Bash Commands.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Bash/Bash Commands.md b/Bash/Bash Commands.md index 274cff8..bd4cda8 100644 --- a/Bash/Bash Commands.md +++ b/Bash/Bash Commands.md @@ -127,8 +127,9 @@ find [start-position] -type f -name FILENAME # search for a file named "filenam find [start-position] -type d -name DIRNAME # search for a directory named "dirname" find [path] -exec {} \; # execute command on found items (identified by {}) -[ -f "path" ] # test if a file exists -[ -d "path" ] # test if a folder exists +[[ -f "path" ]] # test if a file exists +[[ -d "path" ]] # test if a folder exists +[[ -L "path" ]] # test if is symlink ``` ### Other