This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

date test

By: a guest on Jul 19th, 2012  |  syntax: None  |  size: 1.04 KB  |  views: 52  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. bash-4.2$ touch -t 200103040506.07 jgoldschrafe
  2.  
  3. bash-4.2$ ls -l jgoldschrafe
  4. -rw-r--r-- 1 root root 0 Mar  4  2001 jgoldschrafe
  5.  
  6. bash-4.2$ stat jgoldschrafe
  7.   File: 'jgoldschrafe'
  8.   Size: 0               Blocks: 0          IO Block: 4096   regular empty file
  9. Device: 801h/2049d      Inode: 1932288     Links: 1
  10. Access: (0644/-rw-r--r--)  Uid: (    1/    root)   Gid: (    1/    root)
  11. Access: 2001-03-04 05:06:07.000000000 +0200
  12. Modify: 2001-03-04 05:06:07.000000000 +0200
  13. Change: 2012-07-19 17:54:30.000000000 +0300
  14.  Birth: -
  15.  
  16. bash-4.2$ stat -c %Y jgoldschrafe
  17. 983675167
  18.  
  19. bash-4.2$ stat -c %Y jgoldschrafe | date +%Y%m%d
  20. 20120719
  21.  
  22. bash-4.2$ date -d@$(stat -c %Y jgoldschrafe) +%Y%m%d
  23. 20010304
  24.  
  25. bash-4.2$ date --version
  26. date (GNU coreutils) 8.17
  27. Copyright (C) 2012 Free Software Foundation, Inc.
  28. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
  29. This is free software: you are free to change and redistribute it.
  30. There is NO WARRANTY, to the extent permitted by law.
  31.  
  32. Written by David MacKenzie.
clone this paste RAW Paste Data