PDA

View Full Version : Qual e' l'equivalente Linux di questo comando DOS


vampirodolce1
13-10-2006, 16:16
dir *.
ossia l'elenco delle sole directory invece che di directory e files.

Grazie.

KABAL
13-10-2006, 16:21
man ls

vampirodolce1
13-10-2006, 16:38
So usare ls, ma non so come esplicitare quell'opzione.
L'unica cosa che ho trovato e' qualcosa tipo find ./ -type d, potrebbe andare?

Scoperchiatore
14-10-2006, 19:57
So usare ls, ma non so come esplicitare quell'opzione.
L'unica cosa che ho trovato e' qualcosa tipo find ./ -type d, potrebbe andare?

usa anche
man bash
man test

quando hai qualche dubbio con i comandi bash. La shell in linux (bash č la pių usata) č qualcosa di molto pių complesso che in windows.


Comunque, in questo caso non hai proprio neanche provato ad apire man ls, dato che:

NAME
ls - list directory contents

SYNOPSIS
ls [OPTION]... [FILE]...

DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuSUX nor --sort.

Mandatory arguments to long options are mandatory for short options too.

-a, --all
do not ignore entries starting with .

-A, --almost-all
do not list implied . and ..

--author
with -l, print the author of each file

-b, --escape
print octal escapes for nongraphic characters

--block-size=SIZE
use SIZE-byte blocks

-B, --ignore-backups
do not list implied entries ending with ~

-c with -lt: sort by, and show, ctime (time of last modification of file status information) with -l: show ctime and sort by name otherwise: sort by ctime

-C list entries by columns

--color[=WHEN]
control whether color is used to distinguish file types. WHEN may be `never', `always', or `auto'

-d, --directory
list directory entries instead of contents, and do not dereference symbolic links

-D, --dired
generate output designed for Emacs' dired mode

-f do not sort, enable -aU, disable -lst

-F, --classify
append indicator (one of */=>@|) to entries

--file-type
likewise, except do not append `*'

--format=WORD
across -x, commas -m, horizontal -x, long -l, single-column -1, verbose -l, vertical -C

--full-time
like -l --time-style=full-iso

-g like -l, but do not list owner

-G, --no-group
like -l, but do not list group

-h, --human-readable
with -l, print sizes in human readable format (e.g., 1K 234M 2G)

--si likewise, but use powers of 1000 not 1024
....

Davide.Prina
15-10-2006, 13:05
$ ls -l | grep ^d

Ciao
Davide

ilsensine
15-10-2006, 13:41
L'unica cosa che ho trovato e' qualcosa tipo find ./ -type d, potrebbe andare?
find -type d -maxdepth 1
Senza maxdepth ti elenca l'intero albero delle directory.

nb restituisce anche "." (la directory corrente)