Jul 222012
 

ls |awk ‘{print $9}’|sed ‘s/^[\t]*/mv /’ > ListOfFiles.txt

 

  One Response to “Using ls, awk, and sed To Make a List of Files in a Linux Directory and Prepend mv in Front of each line”

  1. […] Other SED, AWK uses. You can use "split" to split a file into several other files. Example: split -l 100 Large.sql (That is a dash and the lowercase letter L). This will split the Large.sql file into several files of 100 lines each. Posted by Robert Holland at 18:49  Tagged with: sed […]