Category: Linux Terminal

Added: 22nd of July 2020

Viewed: 184 times

List files in a directory using the ls command

The ls command is almost identical the dir command for listing files in a directory. From what I have seen the only difference is that the ls command can colourise the output

To use the ls command for example listing the contents of a directory use the folllowing command


ls


The ls -l command will display the file permission, owner and group, filesize and modification date and the filename
ls -l


To list a specific file type, for example only .txt files, we could enter the following command
ls -l *.txt


We can also output the listing to a text file for example
ls -l *.jpg > output.txt


You can get furter information about the ls command by enterting the following command in the terminal
ls --help

Other Tips & Tutorials

Linux Terminal

Create a simple cronjob in Linux

Posted: 20th of October 2020

Views: 82

Linux Terminal

Create a new folder and file using the mkdir and touch commands using the terminal in Linux

Posted: 16th of August 2020

Views: 155

Linux Terminal

Convert a PDF document to text or html using pdftotext, pdftohtml in Linux using the terminal

Posted: 3rd of August 2020

Views: 189

Linux Terminal

List files in a directory using the ls command

Posted: 22nd of July 2020

Views: 184

Linux Terminal

How to access HP Linux Imaging and Printing System set up on Ubuntu using the terminal

Posted: 13th of November 2019

Views: 510

Linux Terminal

Where are the log files located in Linux

Posted: 16th of October 2019

Views: 578

Linux Terminal

Oracle VirtualBox, Unable to insert virtual optical disk

Posted: 11th of October 2019

Views: 1942

Linux Terminal

Oracle VirtualBox only displaying 32-bit version(s), when setting up new Virtual Machine on Linux

Posted: 11th of October 2019

Views: 671

Linux Terminal

The Linux uptime command

Posted: 3rd of October 2019

Views: 715

Linux Terminal

Using GParted in Linux to format a hard drive, flash drive, SD Card

Posted: 17th of September 2019

Views: 1053