Linked Questions

3 votes
3 answers
11k views

I am currently not on a Linux machine. Would the following command produce my wanted result? ls | grep ".pdf" | wc
KOB's user avatar
  • 253
-1 votes
1 answer
77 views

Create a script to ask a user for the name of a folder and have the script return the number of files found within the folder. If folder doesn't exist, display error message to the screen I've gotten ...
Nathan Rampado's user avatar
361 votes
21 answers
955k views

I have a directory with a large number of files. I don't see a ls switch to provide the count. Is there some command line magic to get a count of files?
Blake's user avatar
  • 3,797
225 votes
12 answers
244k views

How do I move all files in a directory (including the hidden ones) to another directory? For example, if I have a folder "Foo" with the files ".hidden" and "notHidden" inside, how do I move both ...
Cory Klein's user avatar
  • 19.4k
88 votes
5 answers
168k views

I get the following error when trying to ls *.txt | wc -l a directory that contains many files: -bash: /bin/ls: Argument list too long Does the threshold of this "Argument list" dependent on distro ...
user avatar
36 votes
2 answers
20k views

Using the following command, could someone please explain what exactly is the purpose for the ending curly braces ({}) and plus sign (+)? And how would the command operate differently if they were ...
Ryan Prentiss's user avatar
3 votes
4 answers
2k views

Related: What's the best way to count the number of files in a directory? I have a system with a largish number of files in a directory $ ls -god xml drwxrwsrwx 7 7070720 Mar 12 11:51 xml If ...
RedGrittyBrick's user avatar
4 votes
2 answers
710 views

I'm using this script to save the number of files in a main folder, but it also counts the subfolders inside that main folder. nfiles=$(ls -1 /home/userA/mainfolder | wc -l) Any advice how I can ...
Tak's user avatar
  • 549
-2 votes
2 answers
120 views

#!/bin/bash echo " Enter the name of your directory. You should enter the absolute path to the directory if it is not found in the current directory!" read location echo $location filecount=$( find $...
نور المدني's user avatar
0 votes
2 answers
126 views

I have the following alias defined in my .bashrc alias lsfc='ls -l "$@" | tee /dev/tty | grep -v / | echo "File count: `wc -l`"' which is intended to give me the number of ...
David Shaw's user avatar