Highlighted
Flight Engineer
Flight Engineer
  • 390 Views

how to find the current week number with 'cal' command in linux and current week days

Jump to solution

hi all,

 

i tried and there is ncal command  and leave about ncal command one of the Linux OS.

Currently my requirement to find the current week number with 'cal' command , current day count  of the year and that week related days(from Monday to Sunday) .

if any one knows , could you please share . i tried with 'cal' command but unable to print current week number and current day of the year . 

 

if possible , could you please share . its for general purpose  .

Currently checked  on   RHEL - 7.6 (Maipo) 64-BIT  one of the machine and ignore the version of the OS and need to use with cal command . i think might be some options are not installed properly . but 'cal' command is working as good . so please provide above request .

i hope clearly explained about my issue . 

i am waiting for your valuable reply .

 

Regards,

Jeesshansree

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Flight Engineer Flight Engineer
Flight Engineer
  • 379 Views

Re: how to find the current week number with 'cal' command in linux and current week days

Jump to solution

Hello

Here is two variants of answer to your question:

1) cal -jw  give you a pseudo-graphical answer, not numerical

2) date +%j   ;  date +%U  ;  date +%u  give you answer n numerical form. Be carefull with date +%U - number of weeks start with 00, not traditional 01

View solution in original post

Reply
Loading...
2 Replies
Highlighted
Flight Engineer Flight Engineer
Flight Engineer
  • 380 Views

Re: how to find the current week number with 'cal' command in linux and current week days

Jump to solution

Hello

Here is two variants of answer to your question:

1) cal -jw  give you a pseudo-graphical answer, not numerical

2) date +%j   ;  date +%U  ;  date +%u  give you answer n numerical form. Be carefull with date +%U - number of weeks start with 00, not traditional 01

View solution in original post

Reply
Loading...
Highlighted
Flight Engineer
Flight Engineer
  • 326 Views

Re: how to find the current week number with 'cal' command in linux and current week days

Jump to solution

Hi @Alexandre ,

 

Thank you for your valuable information .

 

 

Regards ,

Jeesshnasree

0 Kudos
Reply
Loading...
Join the discussion
You must log in to join this conversation.