• Skip to primary navigation
  • Skip to content
  • Skip to footer
Tushar Kant Tushar Kant
  • Posts
  • Categories
  • Tags
    Tushar Kant

    Tushar Kant

    A programmer with over a decade of experience in software development and cloud automations.

    • Email
    • GitHub
    • LinkedIn
    • Twitter
    • Website

    Write a shell script to find the number of files in a directory.

    April 29, 2013 less than 1 minute read

    FILE="/tmp/count.txt"
    echo -n "Enter directory name : "
    read dname
    ls $dname > $FILE
    echo "No of files in directory : $(grep [^*$] $FILE -c)"
    rm -f $FILE
    

    Categories: Shell Scripts

    Updated: April 29, 2013

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    Leave a comment

    You may also enjoy

    My Professional Journey

    July 16, 2024 1 minute read

    Mr Bhrama - Artificially Intelligent Personalized Tutor

    July 9, 2024 1 minute read

    Hello Folks, I trust you’re all enjoying the influx of exciting technologies. I’m thrilled to unveil the result of a recent hackathon endeavor – a project I ...

    How do I plan and write CLI Script

    August 21, 2019 8 minute read

    This article takes you from start to end of a regular official week in a Senior Software Engineer’s life, while working for one of my employer. It not only g...

    Gotta Workstation, checkout mine!

    October 28, 2017 6 minute read

    Update:

    • Follow:
    • Feed
    © 2024 Tushar Kant. Powered by Jekyll & Minimal Mistakes.