I want to use the stat
command to get information on a file. I did this:
Josephs-MacBook-Pro:Desktop Joseph$ echo 'hello' > info.txt
Josephs-MacBook-Pro:Desktop Joseph$ stat info.txt
16777220 21195549 -rw-r--r-- 1 Joseph staff 0 6 "Dec 21 20:45:31 2014" "Dec 21 20:45:30 2014" "Dec 21 20:45:30 2014" "Dec 21 20:45:30 2014" 4096 8 0 info.txt
The 3rd and 4th lines are the output I got. This happens whenever I use the stat
command. Meanwhile everyone on the internet gets stuff like:
File: `index.htm'
Size: 17137 Blocks: 40 IO Block: 8192 regular file
Device: 8h/8d Inode: 23161443 Links: 1
Access: (0644/-rw-r--r--)
Uid: (17433/comphope) Gid: ( 32/ www)
Access: 2007-04-03 09:20:18.000000000 -0600
Modify: 2007-04-01 23:13:05.000000000 -0600
Change: 2007-04-02
16:36:21.000000000 -0600
I tried this on Terminal and iTerm 2 and in a fresh session.
On the same laptop, I connected to my CentOS server and put in the same commands. It worked perfectly. This leads me to believe that the terminal application isn't the problem.
I'm on a MacBook Pro (Retina, 15-inch, Late 2013) with OS X Yosemite version 10.10.1
What is going on and how can I fix this?
Best Answer
Using the
-x
option forstat
should give you similar output:To make this the default, you can create an alias and save it to
~/.bashrc
: