C-Shell
A simple shell written in C.
Loading...
Searching...
No Matches
ls.c File Reference
#include <dirent.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include "../internal_commands.h"

Functions

char * get_details (const char *const path)
 
int print_dir_entries (const char *const path, bool show_hidden, bool show_details)
 
int ls (int nargs, char **args)
 List directory contents.
 

Variables

int opterr
 
int optind
 
int optopt
 
char * optarg
 

Function Documentation

◆ get_details()

char * get_details ( const char *const path)

◆ ls()

int ls ( int nargs,
char ** args )

List directory contents.

List information about the FILEs (the current directory by default).

Options:

  • -a - do not ignore entries starting with .
  • -l - use a long listing format

◆ print_dir_entries()

int print_dir_entries ( const char *const path,
bool show_hidden,
bool show_details )

Variable Documentation

◆ optarg

char* optarg
extern

◆ opterr

int opterr
extern

◆ optind

int optind

◆ optopt

int optopt