2019年8月18日 星期日

Linux misc command handbook.

[Process]
     # List process of given executable
          $ pgrep

[User account, group, permission]
     # How do I find out what groups I belong to?
           $ groups []
           or
           $ id -Gn []
     # How to add a user to multiple groups?
           $ usermod -a -G ftp,sudo,example geek

[Date & Time]
     # Set date
     
     date 010100002000.00     
     #MMDDhhmmYYYY.ss Linux command to get time in milliseconds
     
     bash - Linux command to get time in milliseconds - Stack Overflow
          date +"%T.%N" returns the current time with nanoseconds.
               06:46:41.431857000
          date +"%T.%6N" returns the current time with nanoseconds rounded to the first 6 digits, which is microseconds.
               06:47:07.183172 
          date +"%T.%3N" returns the current time with nanoseconds rounded to the first 3 digits, which is milliseconds.
               06:47:42.773

沒有留言: