#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Smile Single count of files from multiple commands


    I am executing the below command. It is working properly, displaying all file names
    However, I'd like to revise this command to receive the total number of files listed.
    For example, the "ls" command has 3 total files, and the find command has 15 total files. I want the combined total (18)

    ls /ImageRight/*.[Tt][Xx][Tt] && find /ImageRight/Import/FUP/fupMonitor/backup -type f | grep -i "/i.*\.FUP"
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,413
    Rep Power
    1871
    You could pipe the whole lot through "wc -l"
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,477
    Rep Power
    1752
    Or use the -c option on the grep?
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo