| /Bookmarks /Die 10 Tops Tipps zur Linux-Console /Historie /Links /ScriptSeiten /Snippets |
meine Bookmarks zu mobbing und die Artikel au den Folgeseiten leigen alle bei del.icio.us
seltene ls Befehle
ls -trl Der Parameter -t sortiert die Ausgabe nach Zeit der Dateierzeugung
ls -turl Zeigt die Dateien an, auf die zuletzt zugegriffen wurde.
In Debian, the Bash package comes with a totally awesome collection of customized tab completions. However, they are not turned on by default. To turn them on in a single account, you can put the line "source etc/bash_completion" in your ~.bashrc file, or you can turn them on globally by editing the /etc/bash.bashrc file and uncommenting the relevant lines.
You'll get magic smart tab completion for cd, apt-get, ssh, mplayer, and numerous other programs. You'll wonder how you ever did without it. 'apt-get' tab completion in particular rocks like nothing else. For example, if you type 'apt-get remove x[TAB]' you'll get a complete list of installed packages starting with x. When installing, you'll get a list of available but not yet installed packages. You'll likely not be able to stand using apt-get without tab completion anymore.
http://www.planetpenguin.de/artikel-56.html
Sortieren mit ls
Auch wenn der Befehl ls den meisten Leuten bekannt ist wissen viele nicht, wie man die Sortierung der Ausgabe verändern kann: ls -c sortiert nach Datum der letzten Änderung der Satusinformationen. ls -f deaktiviert die Standardsortierung und Zeigt auch . und .. an. ls -S sortiert nach Dateigröße. ls -t sortiert nach dem Datum der letzten Änderung. ls -U keine Sortierung. ls -u sortiert nach Zugriffszeit. ls -X sortiert nach Dateierweiterung
Alternativ kann man auch mit der Option --sort=Argument eine Sortierung wählen. Gültige Argumente dafür sind: none, extension, size, time, version, status, atime, access und use.
Test ob ein Parameter übergeben wurde
#!/bin/sh if [ ! -f $1 ]; then echo "Usage: $0 " exit fi echo "Sorting $1" sort -t ' ' -k 4.9,4.12n -k 4.5,4.7M -k 4.2,4.3n -k 4.14,4.15n -k 4.17,4.18n -k 4.20,4.21n $1 > $1.sorted
für spezielle Infos über die bash unter osx
Linux/Bash (last edited 2010-01-16 18:20:41 by DetlevLengsfeld)