Tag Archives: linux ls

ls -r reverse order in linux/unix

The ls -r command in Linux reverses the order of the listing, showing the oldest files first when sorted by modification time or the alphabetically last files when sorted by name. Here’s what the -r option does in different contexts: … Continue reading

Posted in File & Directory, Ls Command | Tagged , , , | Comments Off on ls -r reverse order in linux/unix

Linux `ls` and `grep` Command Usage: 10 Practical Examples

In Linux, you can use a combination of the ls and grep commands to filter the output of ls based on specific patterns or strings. This is particularly useful for searching through directory contents for files that match certain criteria. … Continue reading

Posted in File & Directory, Ls Command | Tagged , , , , | Comments Off on Linux `ls` and `grep` Command Usage: 10 Practical Examples

How to Sort Files by Type in Linux: Complete Guide

In Linux, the ls command does not have a built-in option to sort files by type directly. However, you can use a combination of ls with other commands to achieve a sort by file type. Here’s how you can do … Continue reading

Posted in File & Directory, How to, Ls Command | Tagged , , , | Comments Off on How to Sort Files by Type in Linux: Complete Guide

How to Use the ls Command to Sort Files and Directories in Linux

In Linux, the ls command sorts files and directories by name in alphabetical order by default. Here are some examples of how to use ls to sort by name: Remember that the -r option reverses the sort order when used … Continue reading

Posted in File & Directory, How to, Ls Command | Tagged , , , | Comments Off on How to Use the ls Command to Sort Files and Directories in Linux

linux ls sort by size

In Linux, to sort files by size using the ls command, you can use the -S option, which sorts the output by file size, largest first. Here are some examples: The ls -S command is particularly useful when you want … Continue reading

Posted in File & Directory, Ls Command | Tagged , , | Comments Off on linux ls sort by size

Linux `ls` Command: 9 Ways to Sort File & Directory

In Linux, the ls command lists directory contents, and you can sort the output using various options. Here are some common ways to sort the output of the ls command: Remember that some of these options require a long listing … Continue reading

Posted in File & Directory, Ls Command | Tagged , , | Comments Off on Linux `ls` Command: 9 Ways to Sort File & Directory

ls -r command in Linux

ls -r option lists all files and directories in the current directory in reverse order. Continue reading

Posted in File & Directory | Tagged , , , | Comments Off on ls -r command in Linux

ls -l command in Linux

ls -l option lists all files and directories in the current directory in long listing format. Continue reading

Posted in File & Directory | Tagged , , , | Comments Off on ls -l command in Linux

ls -a command in Linux

ls -a option lists all files and directories in the current directory, including hidden files starting with “.” Continue reading

Posted in File & Directory | Tagged , , | Comments Off on ls -a command in Linux

How to display full path/absolute path with ls command

linux ls full path, you can use the ls -d option combined with the environment variable $PWD. syntax: ls -d $PWD/* Continue reading

Posted in Internet Technology | Tagged , , | 1 Comment

list directory with ls command in linux/unix

In linux, with the ls command -d option, you can only list the directories of the current directory, not recursively. Continue reading

Posted in Internet Technology | Tagged , | Comments Off on list directory with ls command in linux/unix

Sort files or folders by size with ls command in linux/unix

The Linux ls -S option can be sorted by size from largest to smallest, or the ls -rS option can be sorted by size from smallest to largest. Continue reading

Posted in Internet Technology | Tagged , | Comments Off on Sort files or folders by size with ls command in linux/unix

How to display the file size in megabytes with ls in linux/unix

Display the file size in megabytes, which can facilitate us to browse the file storage size. Syntax: ls -lh , to display the file size in bytes, kilobytes, megabytes … Continue reading

Posted in How to | Tagged | Comments Off on How to display the file size in megabytes with ls in linux/unix

How to list hidden files and folders in linux/unix

In linux/unix, when it comes to listing files and folders, everyone will think of the ls command.  Yes, there are many options for the ls command, and we can use different options to meet various needs. For example, the “-a” … Continue reading

Posted in How to | Tagged | Comments Off on How to list hidden files and folders in linux/unix

List directories recursively in linux/unix

Recursive listing of directories can help us begin to understand the current directory structure. In linux/unix, we can use any of the following commands to list files and directories recursively: ls command find command tree command du command Use the … Continue reading

Posted in How to | Tagged , , , | Comments Off on List directories recursively in linux/unix