Command ls
This command is part of the posix extensions and needs to be imported to be available to the shell.
See Posix Commands
Name
ls list files and directoriesSynopsis
ls [options] [file ...]
Options
ls takes the same options as xls
-l,-long | Long listing, include all file property attributes |
-a,-all | List all files including hidden files (starts with ".") |
-R,-recurse | Recursively list all files and directories |
Description
Lists the files in the specified directories, or the current directory if no arguments.
The results are formatted similar to the posix ls command except that in the long listing, java doesnt provide group and world permission information, so instead the permissions are listed as they apply to the current user.
Examples
Example simple ls
ls
Result
README.txt _dist _out bin build-lib build.xml doc lib license.txt notices out.txt samples schemas sh_histo src test unix win32 xmlsh.log
ls -l
Result
-rwx 191 2008-11-10 11:18:59 README.txt drwx 0 2009-11-25 09:51:50 _dist drwx 0 2009-11-25 09:51:35 _out drwx 0 2009-11-25 09:51:36 bin drwx 0 2009-11-01 11:57:19 build-lib -rwx 3732 2009-11-14 12:31:37 build.xml drwx 0 2009-11-01 11:56:17 doc drwx 0 2009-11-20 07:56:56 lib -rwx 1540 2009-04-09 09:15:50 license.txt drwx 0 2009-11-24 16:31:34 notices -rwx 3119 2009-11-23 20:44:33 out.txt drwx 0 2009-05-27 11:36:54 samples drwx 0 2008-05-26 20:36:41 schemas -rwx 23 2009-11-23 11:02:38 sh_histo drwx 0 2009-03-20 10:21:07 src drwx 0 2009-10-29 11:14:29 test drwx 0 2009-11-16 15:17:48 unix drwx 0 2009-09-20 07:54:55 win32 -rwx 9770835 2009-11-25 16:21:45 xmlsh.log
Return Value
Returns 0 if the command executed successfully, 1 if there was an error.
Commands
CategoryCommands
CommandsPosix