Comments on: 7 Quirky ‘ls’ Command Tricks Every Linux User Should Know https://www.tecmint.com/linux-ls-command-tricks/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 23:15:21 +0000 hourly 1 By: dragonmouth https://www.tecmint.com/linux-ls-command-tricks/comment-page-1/#comment-1590289 Thu, 16 Sep 2021 20:19:23 +0000 http://www.tecmint.com/?p=12112#comment-1590289 You do not provide a screenshot of "ls --format=vertical". There is a screenshot of every other command.

]]>
By: Manuel Malagon https://www.tecmint.com/linux-ls-command-tricks/comment-page-1/#comment-1515822 Fri, 04 Jun 2021 12:24:43 +0000 http://www.tecmint.com/?p=12112#comment-1515822 Is it possible to sort by extension then alphabetically? In other words, sort alphabetically by extension.?

]]>
By: Darren Evans https://www.tecmint.com/linux-ls-command-tricks/comment-page-1/#comment-1505100 Wed, 26 May 2021 06:24:28 +0000 http://www.tecmint.com/?p=12112#comment-1505100 In reply to paolo.

In Bash shell doing

ls a(1).jpg

results in the error message

bash: syntax error near unexpected token `('

In Bash and tcsh (and most other shells), parentheses have to be escaped or enclosed in quotes. Wildcards must not be enclosed in quotes or they will not be expanded by the shell.

So for filenames containing parentheses eg a(1).jpg b(1).jpg, this ls command will work

ls *"(1).jpg"

or if you prefer to have the quotes just around the critical part

ls *"(1)".jpg

If you files names contained quotes (double or single), then you would have to escape the quotes themselves to list them.

]]>
By: Darren Evans https://www.tecmint.com/linux-ls-command-tricks/comment-page-1/#comment-1505054 Wed, 26 May 2021 06:08:19 +0000 http://www.tecmint.com/?p=12112#comment-1505054 The different file/directory/link/socket etc indicator styles are only seen with the -F option.

The -p option only appends a slash to the name of directories.

One of my preferred options is –group-directories-first which does exactly what it says.

]]>
By: Duncan https://www.tecmint.com/linux-ls-command-tricks/comment-page-1/#comment-1502697 Tue, 25 May 2021 16:17:32 +0000 http://www.tecmint.com/?p=12112#comment-1502697 In reply to Brian Eschner.

I’m guessing that it’s any change of the terminal window size, not just going full-screen. That will reset a bunch of spacing-related stuff, obviously including the terminal tabs set.

I’d suggest setting the bash PROMPT_COMMAND (or possibly one of PS0/PS1/PS2) environmental variable to include your desired tabs command so it’s run automatically at each prompt. See the bash manpage or info pages for the details.

]]>