LinuxQuestions.org
Review your favorite Linux distribution.
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, 07:29 PM   #1
anniehswong
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, 08:00 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174
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 08:02 PM.
 
Old 09-09-2017, 08: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: 17,386
Blog Entries: 27

Rep: Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405Reputation: 5405
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, 09:22 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,695

Rep: Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548
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, 09:22 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,695

Rep: Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548
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, 09: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: 17,386
Blog Entries: 27

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

Rep: Reputation: 323Reputation: 323Reputation: 323Reputation: 323
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 02:57 PM.
 
Old 09-11-2017, 11:20 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,860

Rep: Reputation: 2596Reputation: 2596Reputation: 2596Reputation: 2596Reputation: 2596Reputation: 2596Reputation: 2596Reputation: 2596Reputation: 2596Reputation: 2596Reputation: 2596
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 09:42 PM
clarification desiretolearn Programming 5 02-03-2014 03:57 AM
[SOLVED] I need some clarification JackNielson Linux - Newbie 5 04-22-2011 05:06 AM
I just need some clarification Duneatreides Linux - Newbie 2 03-12-2007 05:48 AM
clarification on find + xargs rm command dtra Linux - General 2 05-17-2006 05:56 AM

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

All times are GMT -5. The time now is 06:44 PM.

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