LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-09-2017, 08:29 PM   #1
anon132
LQ Newbie
 
Registered: Sep 2017
Posts: 1

Rep: Reputation: Disabled
need clarification on the command ls -dF


Sorry if this is a silly question but I'm really new at this

ls -d [[:upper:]]*

I know the command above will list all the directories that start with an uppercase but what does but what does ls -dF [[:upper:]]* mean?

I looked it up but the explanation makes no sense to me.. it mentioned something about appending?
 
Old 09-09-2017, 09:00 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, Debian 12, Devuan & MX Linux
Posts: 9,528
Blog Entries: 15

Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
I've never used that cmd before so I'm not sure.

After running it in my terminal it returned this:

Code:
└─ $ ▶ ls -dF
./
Most of the time the ./ is the character that you would type for a script to run. An example would be....
Code:
./name of script
Otherwise the ./ is used with the ./configure command to compile software from a tar bz.

Is there a text file that you wanted to append?

I didn't find any man page for dF only df-

https://www.systutorials.com/docs/linux/man/1-df/

Last edited by Ztcoracat; 09-09-2017 at 09:02 PM.
 
Old 09-09-2017, 09:39 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,723
Blog Entries: 28

Rep: Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275
From man ls:

Code:
-d, --directory
list directories themselves, not their contents

(snip)

-F, --classify
append indicator (one of */=>@|) to entries
I played with the command a bit. Those two switches do not seem to work and play well together, but I did not take the time to do extensive testing.
 
Old 09-09-2017, 10:22 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,314

Rep: Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172
Quote:
Originally Posted by anniehswong View Post
ls -d [[:upper:]]*

I know the command above will list all the directories that start with an uppercase
Be careful presuming what you think you know - it will do that, but run this then rerun the your command.
Code:
touch Afile.txt
Quote:
but what does but what does ls -dF [[:upper:]]* mean?

I looked it up but the explanation makes no sense to me.. it mentioned something about appending?
Run both with and without the "F" - with the extra file from my command above it may be more obvious. A simple google returned this as first hit; it explains the symbols, no sense me repeating it.
 
1 members found this post helpful.
Old 09-09-2017, 10:22 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,314

Rep: Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172Reputation: 4172
Quote:
Originally Posted by anniehswong View Post
ls -d [[:upper:]]*

I know the command above will list all the directories that start with an uppercase
Be careful presuming what you think you know - it will do that, but run this then rerun the your command.
Code:
touch Afile.txt
Quote:
but what does but what does ls -dF [[:upper:]]* mean?

I looked it up but the explanation makes no sense to me.. it mentioned something about appending?
Run both with and without the "F" - with the extra file from my command above it may be more obvious. A simple google returned this as first hit; it explains the symbols, no sense me repeating it.
 
1 members found this post helpful.
Old 09-09-2017, 10:41 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,723
Blog Entries: 28

Rep: Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275Reputation: 6275
Thanks, syg00.
 
Old 09-11-2017, 02:59 PM   #7
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 383Reputation: 383Reputation: 383Reputation: 383
Welcome to LQ!!!

I think the confusion is: that -d does not limit ls to directories;
It just doesn't descend ('look') into dirs, so I think of -d as meaning:
Don't Descend (instead of Directories).

The -F is a seperate concept: a 1char graphic, to show some type info:
https://unix.stackexchange.com/quest...d-by-ls-f-mean

Your [[:upper:]] impressed me!!!
I didn't know of it; it even worked in my busybox ash

I'm looking forward to more interesting posts from you.
Glad you are here!!!

p.s. regex will provide fascinating 'twists': I just realized: grep "a*c"
Matches on just c (reads from stdin, until Ctrl+d; try it)
And: mkdir abc; ls a*c gives no output, but: ls | grep 'b*c' finds it
Add (in bash; the {} don't work in my mll ash): touch abc/{,.}z
Then experiment with various combos of: ls -aAdFl

Also note: BB code link at bottom of page, which CODE tag I was too lazy to use

Last edited by !!!; 09-11-2017 at 03:57 PM.
 
Old 09-12-2017, 12:20 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,419

Rep: Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785
FYI "shell globbing" works a little differently to 'regex-ing'; see $search_engine for details
For regexes I highly recommend http://regex.info/book.html, which goes into some depth explaining how not all regex "engines" work the same way.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cURL command clarification dumblinuxuser Linux - Newbie 6 08-09-2016 10:42 PM
clarification desiretolearn Programming 5 02-03-2014 04:57 AM
[SOLVED] I need some clarification JackNielson Linux - Newbie 5 04-22-2011 06:06 AM
I just need some clarification Duneatreides Linux - Newbie 2 03-12-2007 06:48 AM
clarification on find + xargs rm command dtra Linux - General 2 05-17-2006 06:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration