Easy question to answer. Count commands in terminal
I am completely new to Linux and I am trying to add up information in a directory with the terminal.
in my /dev I am trying to add up characters, blocks, links, directories, and standard files Please help! thanks you |
What have you got so far; show us the code
|
well I don't know where to start, but so far I have listed the files in the dir with:
ls -l |
You'll want these links:
http://rute.2038bug.com/index.html.gz http://tldp.org/LDP/Bash-Beginners-G...tml/index.html http://www.tldp.org/LDP/abs/html/ http://linux.die.net/man/ Note that you title is wrong; you're counting file entries, not cmds :) However, here's a hint Code:
ls -l |grep ^d Check the wc cmd http://linux.die.net/man/1/wc ;) |
And since there's lot of ways of skinning a cat ... have a look
at what you could achieve with find & stat instead of ls |
@chrism01
Thanks that helped out a lot! I was looking for the "command" that would tell me how to count the files, but you got the idea. I figured it out thanks to you. Linux is a mysterious beast. |
Remember to mark question as SOLVED once you have a solution. Also nice if you share the solution so when people search they can learn from you too :)
|
All times are GMT -5. The time now is 11:39 AM. |