In fish:
for x in *
echo $x
end
The *
here includes all directories and files, how to list files(or directories) only?
To list all the files or folders, you have to use flutter_file_manager, path, and path_provider_ex flutter package. Add the following lines in your pubspec. yaml file to add this package in your dependency. Add read / write permissions in your android/app/src/main/AndroidManifest.
fish files in ~/. config/fish/conf. d/ . See Configuration Files for the details.
To be able to run fish scripts from your terminal, you have to do two things. Add the following shebang line to the top of your script file: #!/usr/bin/env fish . Mark the file as executable using the following command: chmod +x <YOUR_FISH_SCRIPT_FILENAME> .
fish does not have lots of fancy globbing syntax. However, directories can be iterated like so:
for x in */
echo $x
end
For files, or more sophisticated checks, you can use test
:
for x in *
if test -f $x
echo $x
end
end
or find
:
for x in find . -type f -maxdepth 1
echo $x
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With