Jump to content

Calling Kumar4world


jefferson1

Recommended Posts

Another linux question for you bro 

@kumar4world

oka folder lo files unnai mp4

some files have two digit numeric number and .mp4        examlple-> 24.mp4

Some files ki string.mp4 undi , example -> xyz.mp4

i need count of files with numeric

and i need count of files with string

 

grep -irl *.mp4"  | wc-l chesthe whole count vasthundi.... i am unable to distinguish

Link to comment
Share on other sites

28 minutes ago, jefferson1 said:

Another linux question for you bro 

@kumar4world

oka folder lo files unnai mp4

some files have two digit numeric number and .mp4        examlple-> 24.mp4

Some files ki string.mp4 undi , example -> xyz.mp4

i need count of files with numeric

and i need count of files with string

 

grep -irl *.mp4"  | wc-l chesthe whole count vasthundi.... i am unable to distinguish

 

$ ls | grep mp4
0abc.mp4
2def.mp4
abc.mp4
def.mp4

 

$ ls | grep mp4 | awk -F '.' '{print $1}' | grep [0-9]
0abc
2def

 $ ls | grep mp4 | awk -F '.' '{print $1}' | grep -v [0-9]
abc
def

 

finally:
ls | grep mp4 | awk -F '.' '{print $1}' | grep [0-9] | wc -l
ls | grep mp4 | awk -F '.' '{print $1}' | grep -v [0-9] | wc -l

  • Upvote 1
Link to comment
Share on other sites

49 minutes ago, kumar4world said:

 

$ ls | grep mp4
0abc.mp4
2def.mp4
abc.mp4
def.mp4

 

$ ls | grep mp4 | awk -F '.' '{print $1}' | grep [0-9]
0abc
2def

 $ ls | grep mp4 | awk -F '.' '{print $1}' | grep -v [0-9]
abc
def

 

finally:
ls | grep mp4 | awk -F '.' '{print $1}' | grep [0-9] | wc -l
ls | grep mp4 | awk -F '.' '{print $1}' | grep -v [0-9] | wc -l

thanks for the help... oka small correction

lets say we have a folder structure like month/day/hour wise

ex: 04/23/00

04/23/01

04/23/02.... 04/23/23

 

04/23... which is yesterday date

 

can we run the same thing on this folder(04/23) to get the count from the sub directories

Link to comment
Share on other sites

19 minutes ago, jefferson1 said:

thanks for the help... oka small correction

lets say we have a folder structure like month/day/hour wise

ex: 04/23/00

04/23/01

04/23/02.... 04/23/23

 

04/23... which is yesterday date

 

can we run the same thing on this folder(04/23) to get the count from the sub directories

 

 

 find 04/23 -name "*.mp4" | awk -F"/" '{print $NF}' | awk -F '.' '{print $1}' | grep [0-9]

 find 04/23 -name "*.mp4" | awk -F"/" '{print $NF}' | awk -F '.' '{print $1}' | grep -v [0-9]

Link to comment
Share on other sites

26 minutes ago, kumar4world said:

 

 

 find 04/23 -name "*.mp4" | awk -F"/" '{print $NF}' | awk -F '.' '{print $1}' | grep [0-9]

 find 04/23 -name "*.mp4" | awk -F"/" '{print $NF}' | awk -F '.' '{print $1}' | grep -v [0-9]

unfortunately this is not returning results bro

 

as of now, the folder as .mp4 9 files

numeric.mp4 are 5 files

text.mp4 are 4 files

 

 

ls | grep mp4 | awk -F '.' '{print $1}' | grep [0-9] | wc -l  ( this is giving me whole total of mp4)...resulst 9
ls | grep mp4 | awk -F '.' '{print $1}' | grep -v [0-9] | wc -l ( this is giving 0 value) 

 

Link to comment
Share on other sites

46 minutes ago, jefferson1 said:

unfortunately this is not returning results bro

 

as of now, the folder as .mp4 9 files

numeric.mp4 are 5 files

text.mp4 are 4 files

 

 

ls | grep mp4 | awk -F '.' '{print $1}' | grep [0-9] | wc -l  ( this is giving me whole total of mp4)...resulst 9
ls | grep mp4 | awk -F '.' '{print $1}' | grep -v [0-9] | wc -l ( this is giving 0 value

 

 find 04/23 -name "*.mp4" | awk -F"/" '{print $NF}' | awk -F '.' '{print $1}' | grep [0-9]

 find 04/23 -name "*.mp4" | awk -F"/" '{print $NF}' | awk -F '.' '{print $1}' | grep -v [0-9]

 

These two should work, please direct message me your directory structure and we can solve it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...