How To Access Facebook From The Command Line [Linux]

Last time, we show you how to tweet from the command line. But if you are more of a Facebook person and that you also want to look cool with the console, you might wonder if the same solution exists for you. The answer is yes!

fbcmd is a little PHP software that allows you to access your Facebook account from the command line. Except for a few missing features, fbcmd is incredibly complete.

There are no packages available yet for your distribution (except for Arch) so you will have to install the program manually.

You will then have to download fbcmd with that:

Initialize the installation:

And finally install it:

The whole process is explained in the official wiki, you can also visit the troubleshooting page in case of problem, or even leave a comment.

And just when you thought that you were done, trying to launch the program from the console with

you should get something like this

fbcmd-auth_error

As you can read, you have to grant authorization to fbcmd at multiple levels. Basically, launch

And give the basic authorization. Then, type:

You should generate a code that you copy paste into

Finally, manage the permissions with

You can always check which permissions were granted with

Pretty tedious I give you that, but at least you know what you are doing. Fbcmd is now ready to be used.

The general syntax for using fbcmd is

The keyword here is “command.” As I said before, except for a few missing features, fbcmd is very complete. What I really mean is that you can do as much as with the web interface, except for sending private messages, pokes, or accept friend requests.

Since you can do so much, let me give you a few examples of what you may want to do first. I invite you to search on your own if you want to perform a specific action.

  • To change your status, type

(note that you can tag some by putting his name after a ‘@’ in the message)

  • To show the posts from others on your wall, use
  • To see all your friends, try

This also embodies the search function, as you can precise a string sequence as an argument and it will return the friends with that string in their name.

And if you just want to know who is online, the command is

  • To display the last X messages in your inbox, the syntax is
  • To check out the stream stories, use

You can then like any post with

  • To add a picture, type

As you can see, fbcmd is very interesting to use. It remains very complex, and I guess that the command line is more appropriate for something simpler, like Twitter. But it still remains super cool to access Facebook that way. However, the program heavily depends on the official API which means that the functions can be modified by Facebook itself. Right now, the policy does not let us accept friends via the API, but that might change in the future.

What do you think about fbcmd? How do you compare it to TTYtter? Do you have any questions? Please let us know in the comments.