i need a little help with the ls command
Hello all,
As for a hobby project i want to create a textfile of some files on my linux fileserver, but i need it to be in a certain format to import it in a database. The server runs on knoppix 3.3. I want to use the ls command for that, but i can't get it the way i want. :cry: (URL could be something like //bigmofo1/linux/knoppix.iso) I want to have it in this format : Filename, size, URL, date created. If anyone can give me a hand i'd appreciate it very much, thank you :) |
Well, you could use awk with something along the lines of
Code:
ls -lh | awk '{printf "%s %s %s\n", $8, $5, $6}' > outputfile.txt Cheers, mj |
You might want to take a look at the du command.
|
Thank you very much for the reply. I will have a look at the du command, after i have been studying the awk command. I have a need to understand why it behaves like this, i might even learn something :). I hope it works !!
Thnx again ! |
All times are GMT -5. The time now is 08:52 AM. |