Communicate with other users in your terminal using “write” command

If you are only user on a system this tutorial is not meant for you. However, you can learn from it. This tutorial is meant for the system admin who might need users information and need to communicate with users. System admin can actually do so using the Terminal with “write” utility.

who: list users on system

This utility simply list the users who is using the system. Remember, all the users who is using the system must be connected to a network with logged in date and time.

who

w: list users on system(Detail information)

This utility also list the logged in users with the the additional information on how long the user has been idle, how much computer processor time each user has used during login session and the commands each user are running.

There’s a similar utility like “w” called “finger.” You need to install finger utility in your system. It is available in repository of all Linux systems.

w

Write: send messages to logged in user of same system

This is the utility that we are waiting for. Write sends a message to another logged in user. The syntax is:

write username [terminal]

The username is the username you want to communicate with. The terminal is optional which is the device name. You can display the user names and device names of logged in users by using who, w or finger commands.

To establish the two way communications both the user should execute write command. To quit messaging hit “Ctrl+D”.

By default, accepting messages are turned off for security reasons. You must allow other users to send you message. Use the following command:

mesg y

You can block messages using following command:

mesg n

 

Advertisements

Five Basic Linux Commands For Beginners

Linux as an open source operating system has been favoured by those who have the technical know-how and are fed-up of Microsoft Windows lack of freedom as well as privacy. But compared to Windows, Linux requires commands that need to be used for basic functions such as setting date or time, changing password or even logging out of the system.

While the professionals are aware of these commands and steps, when it comes to beginners on the Linux platform, they could have some tough time figuring out the methods.

Starters must make sure that they press Enter to invoke these commands. Incase you get stuck with any particular command, then add –help at the end of your command. E.g. clear—help.

Following set of commands will enable any beginner Linux user to master the art of using the open source platform.

Command 1 : clear

With Linux, there is always the possibility of typing lots of commands, which begs for clean window for you to focus on the job. All one needs to do is type clear and the command prompt is cleaned up.

The use of clear is also helpful when long commands are typed in and user does not want to get confused by other details on the window.

Command 2: date

By typing date, followed by the two digit month, the two digit date, the two digit time, and two digit minutes, you could change the date and time settings on the system. Kindly note that the command is helpful when you are logged in as root. Otherwise you will get an “Operation not permitted” reply.

Command 3: df

We have become accustomed to keeping a check on the space available on our system, be it Windows or Linux desktop. You could check the available disk space on your Linux system by typing df, which offers file system disk space.

Command 4: logout

As the name itself suggests, typing log-out will log you out of the system. This command is used to disconnect from Linux machine or to log-out from a specific user session on the system. User must remember that leaving accounts logged on may lead to security issues.

It is highly recommended to use log-out when the task is finished.

Command 5: passwd

Changing passwords have become an essential utility these days with the amount of system hacking and attacks being reported. For Linux users, the code is ‘passwd’ and press enter, which will show you the ‘Change password’ window for your name. You will be first asked to type in the old password and press enter. Type the new password of your choice, twice and voila, it’s done.

And some other usefull commands-

man man : will bring up the manual entry for the man command, where man is manual.

su : Super User rights from within the terminal

sudo : Super user run this command

ls : List directory contents

cd : Change directory.

cd /dirname : Jump change to directory or folder.

apt-get install : Gets app from web and installs (for ubuntu).

Yum install : Gets app from web and installs (for Fedora).

apt-get update : Updates the database from the repositories(for ubuntu).

yum update : Updates the database from the repositories(for Fedora).

reboot : Reboots system

halt : Turn off the system.

exit : Exits from terminal or moves back a user level

cp oldfilename newfilename : Copies a file from oldfile to newfile.

mv oldfile newfile : Will overwrite the oldfile with the newfile

rm filename : Is used to delete files.

rm -R filename :To remove a directory, you must use the -R option

lsb_release -a: The lsb_release command with the -a option prints version information for the Linux release you’re running

cal : Prints the calender.

Pwd : Prints the current working directory.

If you are planning to go a step ahead. Then you might consider learning shell scripting.

Open a text file and write the script that you want to run and make it executable so that when ever you execute that command you will the whole process written in the text file executes.

In UBUNTU for example consider you want to open a terminal from one terminal through terminal from the written script. Then in a text file write the following code

#!/bin/sh

gnome-terminal;

echo “new terminal has been opened”

Once you have done save it with a extension (.sh) and now you will have to make it executable type this command in a terminal

chmod +x filename.sh

Then,

Run it using

./filename.sh