Linux commands - SouthGreenPlatform/tutorials GitHub Wiki


Authors Christine Tranchant-Dubreuil
Research Unit UMR DIADE
Institut

Description

This page describes some linux commands

Keywords : find

Date : 02/07/2017


Summary


List empty directory with find commands

  • Find the empty directory
[durreuic@cobalt174 output]$ find . -type d -empty 
./GL/2_bwaSampe
./GL/1_bwaAln
./GG/2_bwaSampe
  • Check that the directory are empty with xargs
[durreuic@cobalt174 output]$ find . -type d -empty | xargs ls
./FR/1_bwaAln:

./FR/2_bwaSampe:

./FS/1_bwaAln:
Nb : xargs is a command on Unix used to execute command lines from standard input. Commands such as grep and awk can accept the standard input as a parameter, or argument by using a pipe. However, others such as cp a disregard the standard input stream and rely solely on the arguments found after the command.