Como organizar as pastas por nome no shell do linux? [RESOLVIDO]

1. Como organizar as pastas por nome no shell do linux? [RESOLVIDO]

Perfil removido
removido

(usa Nenhuma)

Enviado em 15/10/2012 - 12:13h

Qual o comando eu uso para organizar as pastas by name no shell do linux?


  


2. Re: Como organizar as pastas por nome no shell do linux? [RESOLVIDO]

Alberto Federman Neto.
albfneto

(usa openSUSE)

Enviado em 15/10/2012 - 12:39h

tem vários jeitos, com ls, com comando sort etc...

mas o mais simples
no dir onde quer ver a ordem alfabetica

$ ls -la

A opções -la significam,l de long-list, lista e a de all, tudo.

Veja no meu exemplo


albfneto@sabayon ~ $ ls -la
total 535
drwxrwxrwx 128 root root 5304 Out 15 12:32 .
drwxrwxrwx 4 root root 96 Out 3 14:00 ..
drwxrwxrwx 2 root root 80 Abr 3 2011 .AbiSuite
drwxrwxrwx 2 root root 208 Jun 9 16:08 .acetoneiso
drwxrwxrwx 3 root root 80 Abr 3 2011 .adobe
-rw-r--r-- 1 albfneto albfneto 840 Jul 8 20:20 .alsaequal.bin
drwx------ 9 albfneto albfneto 384 Nov 9 2011 .amsn
drwxr-xr-x 4 albfneto albfneto 928 Out 7 23:17 .aMule
drwxr-xr-x 4 albfneto albfneto 896 Out 14 23:11 .aMuleAdunanzA
drwxrwxrwx 2 root root 144 Mar 26 2012 Área de Trabalho
-rw-r--r-- 1 root root 396 Jul 6 22:27 .asoundrc
drwx------ 2 albfneto albfneto 48 Ago 24 2011 .autosave
drwxrwxrwx 3 root root 96 Jun 9 16:03 .avidemux
drwxr-xr-x 11 albfneto albfneto 728 Out 6 16:36 .azureus
drwxrwxrwx 2 root root 48 Abr 3 2011 .balsa
-rw------- 1 albfneto albfneto 1689 Out 15 12:17 .bash_history
-rw-rw-rw- 1 root root 127 Mar 30 2010 .bash_logout
-rw-rw-rw- 1 root root 193 Mar 30 2010 .bash_profile
-rw-rw-rw- 1 root root 758 Ago 22 2010 .bashrc
drwxrwxrwx 2 albfneto albfneto 3224 Mai 7 2011 .bcast
-rw-rw-rw- 1 root root 1302 Nov 20 2010 .blackboxrc
drwxrwxrwx 2 root root 120 Abr 3 2011 .bmp
-rw-rw-rw- 1 albfneto albfneto 5883 Abr 26 2011 .bzr.log
drwxrwxrwx 8 root root 240 Out 7 23:14 .cache
-rw-rw-rw- 1 root root 238 Mai 4 12:37 .cairo-clockrc
drwxrwxrwx 2 albfneto albfneto 72 Mai 15 2011 .Checks
drwxrwxrwx 4 root root 240 Abr 3 2011 .christine
drwxr-xr-x 3 albfneto albfneto 72 Set 29 2011 .color
drwxrwxrwx 67 root root 2128 Set 27 10:02 .config
drwxrwxrwx 2 root root 80 Abr 3 2011 .conkygui
-rw-rw-rw- 1 root root 2607 Out 20 2010 .conkyrc
-rw-rw-rw- 1 root root 3047 Ago 6 2010 .conkyrc.copia1
-rw-rw-rw- 1 root root 3997 Ago 6 2010 .conkyrc.copia2
-rw-rw-rw- 1 root root 4002 Ago 6 2010 .conkyrc.copia3
drwx------ 2 albfneto albfneto 80 Jul 10 2011 .cups
drwxrwxrwx 3 root root 80 Abr 3 2011 .dbus
drwxrwxrwx 5 root root 488 Jul 8 16:57 Desktop
-rw-rw-rw- 1 root root 178 Jun 9 15:56 .devede
-rw-rw-rw- 1 root root 100 Ago 16 00:29 .directory
-rw-r--r-- 1 albfneto albfneto 0 Out 15 12:32 dir.sorted
-rw-r--r-- 1 root root 27 Jun 16 2011 .dmrc
drwxr-xr-x 2 albfneto albfneto 48 Out 6 12:49 Documentos
drwxrwxrwx 2 root root 80 Abr 3 2011 .dooble
drwxrwxrwx 4 root root 240 Mai 1 21:57 Downloads
drwxr-xr-x 2 albfneto albfneto 48 Mai 9 01:02 dwhelper
drwxrwxrwx 3 root root 72 Abr 3 2011 .e
drwx------ 6 albfneto albfneto 344 Mar 26 2012 .e16
drwxrwxrwx 2 root root 248 Abr 3 2011 .efreet
drwxrwxrwx 2 albfneto albfneto 1720 Dez 4 2011 .electricsheep
drwxrwxrwx 4 root root 128 Jun 4 2011 .emerald
drwxrwxrwx 2 albfneto albfneto 192 Mai 6 2011 .endeavour2
drwxr-xr-x 5 albfneto albfneto 136 Abr 22 10:47 .entropy
-rw-rw-rw- 1 root root 16 Jul 25 2010 .esd_auth
drwxrwxrwx 6 root root 200 Abr 5 2011 .evolution
drwxrwxrwx 2 root root 296 Mai 10 17:58 .filezilla
drwxrwxrwx 3 albfneto albfneto 72 Abr 28 2011 .fltk
drwxrwxrwx 2 root root 312 Abr 3 2011 .fluxbox
drwxrwxrwx 2 root root 4336 Out 10 23:56 .fontconfig
-rw-rw-rw- 1 root root 1584 Jul 18 2010 .fonts.cache-1
-rw-rw-rw- 1 root root 516 Jul 18 2010 .fonts.conf
drwxr-xr-x 2 albfneto albfneto 80 Abr 13 2012 .Foxit
drwxr-xr-x 5 albfneto albfneto 136 Out 1 2011 FrostWire
drwxrwxrwx 6 root root 608 Out 6 16:36 .frostwire4.20
drwxr-xr-x 5 albfneto albfneto 392 Ago 9 2011 .frostwire5
drwxr-xr-x 2 albfneto albfneto 48 Dez 4 2011 .fvwm
drwxr-xr-x 4 albfneto albfneto 120 Dez 4 2011 .fvwm-crystal
drwxrwxrwx 5 root root 120 Out 15 11:17 .gconf
drwxrwxrwx 2 root root 80 Set 6 12:48 .gconfd
drwx------ 6 albfneto albfneto 144 Jun 11 12:30 .gdesklets
drwxrwxrwx 7 root root 272 Abr 3 2011 .gdesklets.copia
-rw-rw-rw- 1 root root 50 Set 25 2010 .gimmagerc
drwxrwxrwx 22 root root 896 Jul 28 2011 .gimp-2.6
drwxr-xr-x 23 albfneto albfneto 1032 Abr 1 2012 .gimp-2.7
drwxr-xr-x 24 albfneto albfneto 1000 Ago 9 14:07 .gimp-2.8
drwxrwxrwx 2 root root 128 Abr 3 2011 .gimv
drwxrwxrwx 5 root root 248 Out 15 11:43 .gkrellm2
drwxrwxrwx 2 root root 80 Abr 3 2011 .gkrellm-reminder
-rw-rw-rw- 1 root root 0 Out 9 13:01 .gksu.lock
drwxrwxrwx 4 root root 112 Abr 3 2011 .gnome
drwxrwxrwx 14 root root 504 Out 2 13:20 .gnome2
drwxrwxrwx 2 root root 48 Abr 3 2011 .gnome2_private
drwxrwxrwx 3 root root 208 Ago 15 2011 .gnupg
drwxrwxrwx 5 root root 120 Mar 26 2012 GNUstep
drwxrwxrwx 6 root root 336 Out 5 14:54 .googleearth
drwx------ 2 albfneto albfneto 48 Jun 1 21:04 .gphoto
drwxrwxrwx 2 albfneto albfneto 80 Mai 9 2011 .grsync
drwxrwxrwx 2 root root 128 Out 2 13:21 .gstreamer-0.10
drwxrwxrwx 2 root root 80 Abr 3 2011 .gstreamer-0.8
-rw-r--r-- 1 albfneto albfneto 129 Out 9 11:56 .gtk-bookmarks
-rw-rw-rw- 1 root root 227 Out 2 2010 .gtk-custom-papers
-rw-rw-rw- 1 root root 21916 Jul 18 2010 .gtk_qt_engine_rc
-rw-r--r-- 1 albfneto albfneto 419 Jul 13 2011 .gtkrc-2.0
lrwxrwxrwx 1 albfneto albfneto 25 Jul 13 2011 .gtkrc-2.0-kde4 -> /home/albfneto/.gtkrc-2.0
-rw-rw-rw- 1 albfneto albfneto 974 Jun 16 2011 .gtk-recordmydesktop
drwx------ 2 albfneto albfneto 48 Abr 3 2011 .gvfs
drwxrwxrwx 2 root root 144 Out 9 05:06 .hardinfo
-rw-rw-rw- 1 root root 470 Ago 22 2010 .history
drwxr----- 2 albfneto albfneto 112 Out 15 11:18 .hplip
-rw-r--r-- 1 albfneto albfneto 581 Ago 27 2011 .htoprc
-rw------- 1 albfneto albfneto 101872 Out 9 11:56 .ICEauthority
drwxrwxrwx 3 root root 80 Abr 3 2011 .icons
-rw-r--r-- 1 root root 85 Out 15 12:16 iface
drwxr-xr-x 3 albfneto albfneto 120 Abr 30 16:46 Imagens
-rw-rw-rw- 1 root root 951 Jun 9 16:18 .isomaster
drwxrwxrwx 4 root root 112 Abr 3 2011 .java
-rw-r--r-- 1 albfneto albfneto 294 Mar 25 2012 .JavaPowUpload.properties
drwxrwxrwx 6 root root 352 Abr 3 2011 .kde4
-rw-rw-rw- 1 root root 535 Jul 12 2011 .kderc
drwxrwxrwx 3 root root 216 Abr 3 2011 .keytouch2
-rw-rw-rw- 1 albfneto albfneto 35 Mai 13 2011 .lesshst
lrwxrwxrwx 1 albfneto albfneto 38 Ago 4 11:40 libblas.so.0 -> /usr/lib64/blas/reference/libblas.so.0
drwxrwxrwx 3 albfneto albfneto 72 Abr 26 2011 .libreoffice
drwx------ 2 albfneto albfneto 288 Mar 30 2012 .lincity-ng
drwxrwxrwx 3 root root 104 Abr 3 2011 .Livestation
drwxrwxrwx 3 root root 120 Abr 3 2011 .local
drwxrwxrwx 3 root root 80 Abr 3 2011 .macromedia
-rw-r--r-- 1 albfneto albfneto 5 Out 15 11:17 .magneto.lock
-rw-rw-rw- 1 root root 3245 Set 18 2010 .mailcap
drwxrwxrwx 3 root root 72 Abr 3 2011 .metacity
drwxrwxrwx 5 root root 304 Abr 11 2012 .miro
drwxrwxrwx 3 albfneto albfneto 72 Abr 26 2011 .mission-control
drwxr-xr-x 5 albfneto albfneto 296 Out 10 2011 .mldonkey
drwxr-xr-x 2 albfneto albfneto 48 Jul 20 2011 Modelos
drwxrwxrwx 3 root root 72 Abr 3 2011 Movies
drwxrwxrwx 6 root root 184 Abr 3 2011 .mozilla
drwxrwxrwx 2 root root 72 Abr 3 2011 .mplayer
-rw-r--r-- 1 albfneto albfneto 0 Mai 31 2011 .mtab.fuseiso
drwxr-xr-x 4 albfneto albfneto 280 Out 12 2011 .mucommander
drwxrwxrwx 2 albfneto albfneto 48 Mai 11 2011 Music
drwxr-xr-x 2 albfneto albfneto 48 Jul 20 2011 Música
-rw-rw-rw- 1 root root 1143 Jul 18 2010 .nanorc
drwxr-xr-x 2 albfneto albfneto 48 Jul 20 2011 .nautilus
drwxrwx--x 2 albfneto albfneto 592 Mar 31 2012 notices
drwxrwxrwx 4 root root 104 Nov 23 2011 .nv
drwxrwxrwx 2 root root 104 Abr 3 2011 .nvclock
-rw-rw-rw- 1 root root 1121 Ago 28 01:05 .nvidia-settings-rc
drwxrwxrwx 3 root root 72 Abr 3 2011 .ooo3
-rw-rw-rw- 1 root root 824 Set 28 2010 .openalrc
drwxrwxrwx 19 root root 1328 Out 6 16:36 .opera
drwxr-xr-x 19 albfneto albfneto 1544 Jul 17 13:09 .opera-next
drwxrwxrwx 3 root root 72 Abr 3 2011 .pki
drwxrwxrwx 2 albfneto albfneto 48 Mai 11 2011 Podcasts
drwxrwxrwx 2 albfneto albfneto 72 Ago 2 2011 .poedit
drwxrwxrwx 3 root root 72 Abr 3 2011 ponto.firefox
drwxr-xr-x 2 albfneto albfneto 48 Jul 20 2011 Público
drwxrwxrwx 2 root root 584 Abr 3 2011 .pulse
-rw-rw-rw- 1 root root 256 Jul 25 2010 .pulse-cookie
drwxrwxrwx 6 root root 304 Jun 2 22:45 .purple
drwxrwxrwx 2 albfneto albfneto 80 Mai 11 2011 .putty
-rw-rw-rw- 1 root root 917 Jul 18 2010 .pystartup
drwxr-xr-x 4 albfneto albfneto 256 Out 11 00:09 .qnext
drwxrwxrwx 2 root root 280 Abr 3 2011 .qt
-rw-rw-rw- 1 albfneto albfneto 967 Jun 4 2011 .qt-recordmydesktop
drwxr-xr-x 4 albfneto albfneto 104 Set 22 19:09 .qupzilla
-rw-rw-rw- 1 root root 9968 Nov 27 2010 .recently-used.xbel.DKR1MV
drwxrwxrwx 6 root root 280 Jun 4 2011 .screenlets
drwxr-xr-x 4 albfneto albfneto 256 Mai 24 03:29 .scribus
-rw------- 1 albfneto albfneto 52 Jun 1 20:58 .serverauth.19919
drwx------ 4 albfneto albfneto 128 Ago 31 20:53 .speech-dispatcher
drwxrwxrwx 2 root root 80 Abr 3 2011 .spumux
drwxr-xr-x 3 albfneto albfneto 152 Ago 28 2011 .streamtuner
drwxrwxrwx 3 root root 152 Abr 3 2011 .subversion
drwxrwxrwx 2 root root 192 Abr 3 2011 .superkaramba
drwxr-xr-x 3 albfneto albfneto 72 Mar 31 2012 .swt
drwxrwxrwx 3 root root 104 Abr 3 2011 .themes
drwxrwxrwx 5 root root 120 Abr 3 2011 .thumbnails
drwxrwxrwx 3 root root 96 Abr 3 2011 .tilda
drwxrwxrwx 5 root root 120 Abr 3 2011 .torcs
drwxr-xr-x 2 albfneto albfneto 48 Nov 7 2011 .ultracopier
drwxrwxrwx 2 albfneto albfneto 48 Mai 11 2011 Videos
drwxrwxrwx 2 root root 136 Abr 3 2011 .wireshark
drwxr-xr-x 2 albfneto albfneto 18464 Mar 27 2012 .wmakerconf
drwxrwxrwx 2 root root 144 Abr 3 2011 .wmWeatherReports
-rw-r--r-- 1 albfneto albfneto 42 Out 15 12:12 .wvdial.conf
-rw------- 1 albfneto albfneto 266 Out 15 11:16 .Xauthority
drwxrwxrwx 13 root root 328 Mai 4 12:57 .xbmc
drwxrwxrwx 2 root root 112 Abr 3 2011 .xchat2
drwxrwxrwx 2 root root 48 Abr 11 2012 .xine
-rw-rw-rw- 1 albfneto albfneto 10686 Dez 4 2011 .xscreensaver
-rw------- 1 albfneto albfneto 122929 Out 15 12:35 .xsession-errors
-rw-rw-rw- 1 root root 35441 Ago 22 2010 .zcompdump
-rw-rw-rw- 1 root root 0 Ago 22 2010 .zsh_history
-rw-rw-rw- 1 root root 5923 Ago 22 2010 .zshrc
-rw-rw-rw- 1 root root 161 Ago 22 2010 .zshrc.copia


ou o que vc quer é organizar mesmo? nesse caso, precisa apagar elas e regravar automaticamente no disco rígido, em ordem alfabética de nomes, em resumo, teria de desfragmentar o HDD.
não conheço desfragmentadores para Linux, Linux que eu saiba, não fragmenta.


3. ordenação

alvaronet
alvaronet

(usa Fedora)

Enviado em 15/10/2012 - 13:43h

A ordenação por nome é o padrão do comando ls ...
Veja a lista completa de opções em: ls --help ou man ls






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts