Some basic commands for Linux beginners who switched to Linux from Windows operating system


This article is all about Linux tips for beginners who switched to Linux operating system from Windows operating systems and it is also helpful for window users who want to learn Linux. In today’s world, Microsoft windows is a most usable operating system for personal and commercial usable PCs because of it’s graphical user interface many of other operating systems are also available on the internet but they either does not contain the graphical user interface or they are not user-friendly. But nowadays many of people’s uses Linux for personal and commercial work because Linux has a command line interface that is easy in use and it is more secure than others. So we use Linux for personal computers and commercial computers. 

Now here we will learn about why we use Linux operating system instead of windows operating system and we also learn some basic commands which help you in learn Linux operating system.

1. Run levels in Linux operating system

When you install any version of Linux operating system on your computer instead of another operating system. It will, by default boot up in the graphical user interface because Linux also has a graphical user interface with the command line interface. Now you can go on the command line interface simply by pressing Alt+Ctrl+f1 and then enter in your root account by its username and password and then you can saw all the run levels on your Linux operating system by going to the file /etc/inittab this file shows us the all available run levels and the last line tells us about what run level is currently set by default on your system

Run given below command to saw all the run levels on your screen by this command you also can change settings

[root@localhost ~]# vim /etc/inittab

now you saw that this output will be shown on your screen
# Default runlevel. The runlevels used by RHS are: 
# 0 - halt (Do NOT set initdefault to this) 
# 1 - Single user mode 
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking) 
# 3 - Full multiuser mode 
# 4 - unused 
# 5 - X11 
# 6 - reboot (Do NOT set initdefault to this) 
# 
id:5:initdefault:

here in this last line id:5:initdefault: is shown the current run level on your operating system in this line you can saw that default level id set to ID:5 which means your system is set to the graphical mode by default because option 5 shows x11 which indicate graphical mode. If you want to change your boot mode from graphical to command mode then simply change the run level by replacing 5 instead of 3 in the above last line like id:3:initdefault and then save this file on your system.

2. How to create users and saw login users on a terminal and also show the all created users on your system

We know that in Linux operating system we have two types of users one is root user which is indicated by the # symbol and one is the general user which is indicated by the $ symbol. Like in windows we called Administrator and local.

To create users and also set passwords for that user in your Linux operating system use this given below command

[root@localhost ~]# useradd rahul 
[root@localhost ~]# passwd rahul 
Changing password for user rahul. 
New UNIX password: 
BAD PASSWORD: it is too short 
Retype new UNIX password: 
passwd: all authentication tokens updated successfully. 
[root@localhost ~]# useradd satish 
[root@localhost ~]# passwd satish 
Changing password for user satish. 
New UNIX password: BAD PASSWORD: it is based on a dictionary word 
Retype new UNIX password: 
passwd: all authentication tokens updated successfully. 
[root@localhost ~]#

Now to open a new terminal by using Ctrl+Alt+f2 key and then login on that terminal from any 
of the user which is created by us in above step. now go on that terminal and use given below 
commands
[rahul@localhost ~]#who i am
rahul    tty2       2017-01-19 05:18 (192.168.91.1)

Now to check all users and also check on which terminal they are logged in use given below command

[rahul@localhost ~]#who
rahul    tty2       2017-01-19 05:18
root     :0         2017-01-19 04:31

Now to remove and change password for any of user use given below command

[root@localhost ~]# passwd -d rahul
Removing password for user rahul.
passwd: Success
[root@localhost ~]#

Now to saw all the users on your system use given below command

[root@localhost ~]#cat /etc/passwd
now you can saw that a long list of codes saw on your screen now you saw that in the last
lines in this code your username will be stored example given below
rahul:x:500:500::/home/rahul:/bin/bash
satish:x:501:501::/home/satish:/bin/bash

Now to remove a user account from your Linux operating system use given below command

[root@localhost ~]# userdel rahul
[root@localhost ~]# userdel satish
and now you can check that thses users will be removed from your system or not by using given 
below command
[root@localhost ~]# cat /etc/passwd

Now to show all the files and folders on your system then use given below command and also saw output of that command

[root@localhost ~]# ls -lh
total 60K
-rw------- 1 root root  987 Jan 15 02:23 anaconda-ks.cfg
drwxr-xr-x 2 root root 4.0K Jan 15 02:30 Desktop
-rw-r--r-- 1 root root  29K Jan 15 02:22 install.log
-rw-r--r-- 1 root root 3.6K Jan 15 02:21 install.log.syslog

THAT’S IT 

If you have any queries related to any command in above article solved out through comment section and in next tutorial we also can learn about how to create files and folders by different methods in Linux.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s