How can I find a number of files in a folder, assign it to a variable, then echo that variable, all in one command line?
11145
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?
3196
Is there a command line program you can use?
18148
Say I have a directory named foo/. This folder includes subdirectories. How can I delete all the empty directories in one command?
113576
How to list available shells for use by command-line?
96996
Suppose that I have a directory with thousands of files; how could I open all files whose name contains both the strings "red" and "green"?
91419
I'm trying to tidy-up my photos which are, for various historic reasons, scattered all over my system. To enable me to make a start on this task, I've been trying to use the command line to construct a list of all directories that contain one or more jpg files.  I'm certain that I don't have to be concerned about looking for other image file formats, but I do have to allow for jpg appearing in upper and lower case.  I'd like each directory name to appear only once in the final list.  To provide an example, if I have the following directories each of which contain one or more jpg or JPG files....  ~Mike/Pictures ~Mike/Pictures/London/Olympics ~Mike/Pictures/London ~Mike/Pictures/London/Holiday ~Mike/Photos ~Mike/Family History/Swaine   I'd like the results to appear with each directory listed only once - irrespective of the number of image files it might contain - preferably sorted and then written to a file  ~Mike/Family History/Swaine ~Mike/Photos ~Mike/Pictures ~Mike/Pictures/London ~Mike/Pictures/London/Holiday ~Mike/Pictures/London/Olympics   My command line skills are just not up to this!  I can use a lot of the simpler forms of single commands, but once they get complex and/or have to be piped things tend to go wrong.
72552
How do I work recursively through a directory tree and execute a specific command on each file, and output the path, filename, extension, filesize and some other specific text to a single file in bash.
80060
How do I use the UNIX command find to search for files created on a specific date?
9236
How can I do something like this in bash?  if "`command` returns any error"; then     echo "Returned an error" else     echo "Proceed..." fi
1218
OS: Windows 7 64-bit  Here's a hypothetical problem: there's a folder with multiple sub-folders (which themselves may have sub-folders and so on). A program creates/modifies files in any of these folders say at time t=YYYYMMDDHHMM. Is there are simple command to search for all the files created/modified after time t?
8293
Possible Duplicate:          Using \input{filename}, I can input a file canned "filename.tex". I have a directory containing all of the files I want to include. How can I create a for loop, which inputs all of those files?   The contents of the directory sometimes changes (so I do not want to manually specify all of the files). The files are numbered (e.g. file01.tex, file02.tex), so the loop should have no difficulty inputing them in the correct order. Other code will be placed within the for loop (before and after the input command), so I do not want to simply list all of the files at once (e.g. \input{file01,file02}).
31187
I'm trying to ftp a folder using the command line ftp client, but so far I've only been able to use 'get' to get individual files.
33989
How can I copy the names of files in a directory to a text file or to a clipboard?
28963
I thought this would be simple - but it is proving more complex than I expected.  I want to iterate through all the files of a particular type in a directory, so I write this:  #!/bin/bash  for fname in *.zip ; do    echo current file is ${fname} done   This works as long as there is at least one matching file in the directory. However if there are no matching files, I get this:  current file is *.zip   I then tried:  #!/bin/bash  FILES=`ls *.zip` for fname in "${FILES}" ; do     echo current file is ${fname} done   While the body of the loop does not execute when there are no files, I get an error from ls:  ls: *.zip: No such file or directory   How do I write a loop which cleanly handles no matching files?
31208
man echo works. but out of curiosity, does echo have something similar to a --help flag/parameter?
16118
list=`ls -a R*` echo $list   Inside a shell script, this echo command will list all the files from current directory starting with R, but in one line. How can I print each item on one line?  I need a generic command for all the scenarios happening with ls, du, find -type -d, etc.
113848
I got a bunch of files in some directory (along with many other files) that I want to move.   Luckily, all the files I want to move contain a certain identifier in their names, so I can ls | grep IDENTIFIER to get the exact list of files to move.   But, how can I execute mv file /path/to/dest/folder/ at once, and not one by one (there's a lot of files to move)?