bash - Need Assistance Understanding ls -d command in linux -


i'm trying wrap head around 'ls -d' command.

i run command 'ls -d' in given directory , '.'

i run command 'ls -d */ , directories

i run command -ls -d * , files, including aren't directories.

the man page states this:

list directories themselves, not contents 

can please explain how switch supposed work?

the things understand are:

  • ls lists current directory, otherwise known ., default.
  • ls -d makes ls show directory it's listing, not contents of directory.

the behaviors describe follow that:

  • ls -d showing . showing directory you're in -- default target of ls no arguments given.
  • ls -d */ tells shell run ls each directory under current 1 passed argument; ls -d shows entries each of arguments, behaving report.
  • ls -d * tells shell run ls each entry in current directory passed argument. ls lists 1 entry each such argument, not showing contents of each argument directory name otherwise would.

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -