/ft_ls

List file and directory structure.

Primary LanguageC

ft_ls

42 school project. Recreation of the "ls" Unix command.

Installation

$ git clone
$ make
  • make (this generates the binary as "ft_ls")
  • run ft_ls as ./ft_ls *flags* *files and folders* as you would run the real ls

Usage

$ ./ft_ls {options} {directories}

Features:

  • the check for ACL's and extended attributes is implemented - @ and + are displayed at the end of file permissions column if required]
  • special file permissions are also implemented [sStT]
  • ft_ls checks if the output is a terminal and displays stats accordingly, using the right format as real ls does
  • correct display of minor, major or filesize depending on file's type
  • flags that can be used with ft_ls: -1AGSRaglort (See the manual for the real ls for more details)
  • all features necessary for the accurate display of stats with the right format using any of the flags that ft_ls is able to use are implemented

Examples

normal use of ft_ls: preview

using bad flags: preview

using the -l flag: preview

using the -l flag on multiple files and folders some which do not exist or don't have read permissions available: preview

using the -a flag: preview

using the -S flag: preview

using the -S flag combined with -r: preview

using ft_ls on the /dev directory: preview

using the -G flag: preview

using the -R flag: preview