Commande pour savoir si un fichier est vide?
melinda_fish
-
droopy291 -
droopy291 -
bonjour tout le monde! voilà, j'ecris un shell script dans lequel, avant d'effectuer une certaine opération, je voudrais savoir si un fichier "toto" (sachant que quoi qu'il arrive, ce fichier existe) de mon répertoire est vide ou non ... existe-t-il une commande pour faire cela ? avez -vous des idées?...
merci d'avance à tous
merci d'avance à tous
A voir également:
- Fichier non vide
- Fichier epub - Guide
- Fichier bin - Guide
- Fichier rar - Guide
- Fichier .dat - Guide
- Fichier 7z - Guide
5 réponses
ok merci!
et est-ce qu'il serait possible de récupérer le résultat de la commande "ls -s toto" dans la variable NUMBER?
et est-ce qu'il serait possible de récupérer le résultat de la commande "ls -s toto" dans la variable NUMBER?
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Hello,
tu peux t'amuser avec des cut
Moi je gère pas mal de fichiers et j'utilise find.
find $ le chemin_vers_mes_fichiers -print f "%p %s"
Il y a moyen d'optimiser.....
johand@horus:~/tmp/touchtest$ ls -l
total 4
-rw-r--r-- 1 johand johand 0 Jun 17 14:19 brol
-rw-r--r-- 1 johand johand 129 Jun 17 14:18 brol1
johand@horus:~/tmp/touchtest$ find . -name "bro*" -printf "%p %s\n"
./brol 0
./brol1 129
man find
man xargs
Johan
Gates gave you the windows.
GNU gave us the whole house.(Alexandrin)
tu peux t'amuser avec des cut
Moi je gère pas mal de fichiers et j'utilise find.
find $ le chemin_vers_mes_fichiers -print f "%p %s"
Il y a moyen d'optimiser.....
johand@horus:~/tmp/touchtest$ ls -l
total 4
-rw-r--r-- 1 johand johand 0 Jun 17 14:19 brol
-rw-r--r-- 1 johand johand 129 Jun 17 14:18 brol1
johand@horus:~/tmp/touchtest$ find . -name "bro*" -printf "%p %s\n"
./brol 0
./brol1 129
man find
man xargs
Johan
Gates gave you the windows.
GNU gave us the whole house.(Alexandrin)
à +