Some fun with the ls command

ls # lists all files
ls *.php # lists all php files
ls t* # lists all files starting with t
ls t*.php #lists all files starting with t and have a .php extension
ls ? # lists all files having a one character filename
ls tes? # lists all files starting with tes and having a 4 character filename
ls [pqrs]* # lists all files starting with p, q, r or s
ls [p-s]* # lists all files starting with p, q, r or s
ls [!p-s]* # lists all files starting with any character other than p, q, r or s
ls [^p-s]* # lists all files starting with any character other than p, q, r or s

Leave a Reply