• Register
  • Members
  • Forums
  • Contact Us

FreshMacApps.com

Mac help is our mission.

  • Home
  • Mac App Reviews
  • Best Free Mac Apps
  • Awesome Deals
  • Mac User Tutorials
  • GeekTool Script Vault
  • More Mac User Resources
  • Contact Us

Terminal Tutorial: Identity

0
  • by FreshMacApps
  • in Networking · Terminal · Tutorials
  • — 26 Nov, 2012

FreshMacApps Terminal Tutorial

Mac Terminal Icon

Using the Command-Line to find Account Identity

 

Welcome back to FreshMacApps Tutorials. Today we will be covering commands that you can use in the Terminal to discover your identifying information for the account you are currently logged in as. 

 

 whoami

 

This first command allows you to discover the account name which you are currently logged in as. Although it is possible to use this for nefarious purposes(like finding out more information on an account you should not have access to), it has real legitimate uses. In systems with multiple users, which you need to switch between it can get easy to lose your bearing. To double-check type the following command into your command-line interface: 

 

whoami

 

Sample output:

host: ~ your_user$ whoami  
Your_User_Account

 

Additionally, if you find yourself in an unfamiliar place in the filesystem, or if you lose trace of where you are you can always type in the following command to get your current directory:

pwd

 

This command stands for “present working directory” and it will print out where you are in the filesystem. 

 

Sample output:

/Users/your-user-name/Downloads/

 

To find out which user owns the permissions on files in your current directory you can type in:

ls -l

 

This will print out the files in the directory, plus the user/group owners of those files. 

 

Sample output:

 drwx------ 37 users user 1258 Oct 1 23:01 Dropbox
 -rw-r--r-- 1 root user 17920 Oct 7 09:55 Desktop DD 
 -rw-r--r-- 1 root user 113090 Oct 3 21:28 Desktop 
 drwx------ 9 user user 306 Jul 25 22:05 Documents 
 drwx------ 53 user user 1802 Jun 11 17:38 Library 
 drwx------ 50 user user 1700 Sep 10 12:44 Movies 
 drwx------ 20 user user 680 Jul 8 20:22 Music 
 drwx------ 25 user user 850 Sep 20 22:52 Pictures 

 

ifconfig

 

Okay, that’s relatively basic, but what about more advance information IP or MAC addresses. To display this information type the following into your Terminal window: 

 

ifconfig 

 

Now I won’t put a full sample output but I will show you know how to figure out which address is which. There were will be several readouts listing different information. Look for the en0 option. In the option en0 there should be listed ether and inet (not inet6). They should look something like:

 

ether 00:12:cb:c6:24:e2
inet 272.346.2.5

 

There will also be a broadcast IP which is the full IP listed at the end of the inet readout. Another trick you can use to get all your hardware port addresses is to enter the following into your command-line interface:

 

networksetup -listallhardwareports

 

The readout from that command will look something like the following.

 

Sample output:

Hardware Port: Bluetooth
Device: Bluetooth 0
Ethernet Address: N/A
Hardware Port: Ethernet
Device: en1
Ethernet Address: 1b:o1:1x:B1:z3:bx
Hardware Port: Bluetooth PAN
Device: en0
Ethernet Address: N/A
LAN Configurations

 

 

Well there you have it. These are a few ways to find out the identity of the account you are logged in as. If you have any questions or comments please feel free to contact us, or leave a comment below.

Last updated by FreshMacApps at January 21, 2013.

Share
    • Facebook

      33 Fans

      Like
    • Twitter

      0 Followers

      Follow
  • Login

    Log In
    Register
  • Sponsored

  • Recently Published

    • Spring 2013 Mac App SuperBundle
    • Programming Python on Mac OS X: Part 1
    • Mac App Bundle for Spring 2013
    • Apple’s Very Own Zero Day Exploit
    • Snapheal
  • Home
  • Tutorials
  • Utilities
  • Terminal
  • Networking
  • Terminal Tutorial: Identity

Copyright © 2013 FreshMacApps.com All rights reserved.

    • FreshMacApps
    • Twitter
    • Facebook
    • Tumblr
    • Technorati

Thank you

Your feedback has been received.

Close