Dussehra - Special Offer - Upto 50% OFF | OFFER ENDING IN: 0 D 0 H 0 M 0 S

Log In to start Learning

Login via

Post By Admin Last Updated At 2020-06-15
Linux Commands

Since Linux Os support the people to connect the people remotely, it is suggestable to use the Putty session to connect the remote sessions. And the admins can connect these systems using the remote IP through the putty session. As mentioned in the previous session, we will now discuss some administration commands.

/proc/version:This command is used to check the Linux distribution version.linux commands And we can also get the same information with uname –alinux commandsuseradd:This option allows the administrator to add the user in the environmentadduser usernameadduser sai

Then its ask you to enter the password. provide the password to the new user (sai) and also you to retype the password and some user details like full name, phone numbers and so on And after providing, all these details provide the confirmation with Y.

And the administrators can test these users with id username

id sai

With this command, you can get the complete information of the user

Furthermore, the admin checks the default options with username -D. These options are

-g group.m home directory-f inactive (to set the password expiry date)-e expire ( to disable the user after the specified number of days)-s Shell( user default login shell usually /bin/sh).

Like adding, the admin can also delete the users. And you can delete the users through the following command

userdel -r usernameuserdel -r sai

And username -h provides the list of all the options for the user.

cat:

This command is used for displaying

cat file_name

It is used to display the file contents.

How to make the copy content in the other file?

We can achieve this with the following command

cat file_name1 > file_name2.

Here the file_name1 refers to the source file and the file_name2 refers to the destination file

How the append the content?

Assume the file1 and file 2 contains two different files. Now we need to add the file 1 to file 2. And we can add through the following command

cat file_name1 >> file_name2

How to display the specified number of lines in a file?

we use head and tail command to display the specific number of the line. Here the head is used to display the top lines and the tail is used to display the bottom lines

head -x where x is a number > 0tail -x where x is a number > 0

Here the appending starts at the end of the file end. In this case, file1 will be placed in file2 at the end of the file2.

So till now, we have seen the various options in the file. And now, we will discuss the various options that the file contains

Usually, a file can be accessed by three people namely for users, group as well as the other users. And these people have three different options namely read (r), write (w) as well as the execute (X) permissions.

Admins use ls-l filename to display the file permission settings. Admins can change the file permissions using chmod permissions type filename

EX: chmod -r file1

Other than rwx, we people use can also use the numeric arguments. So now let's discuss the commonly used arguments

chmod 400 - This mode allows the read-only permission to the owner.chmod 600- This mode allows the read and writes permission to the owner.chmod 644 - In this mode, it allows the read permission to everyone and the write permission to the userchmod 755 - This allows the read and executes permissions to everyone, read, write as well as the execute permissions to the owner as well as the group.chmod 777- This mode allows the read, write as well as the execute permissions to everyone.

I hope the readers have got a basic knowledge of file permissions. So now lets some

Output Manipulation:

In real-time, in a file, the user may not requires the entire data, but requires the data with some filtration's. So now we will discuss those commands with that filtration's

grep:

In searching for the matching patterns, this command scans the output per line. With this command, people can get a complete line with those patterns.

ex: cat filename | grep "pattern"cat file1| grep balajee

sort:

This command allows you to sort the output lines before displaying. By default, all the files here were sorted in alphabetical order.

ex: sort filename | sortsort file1 | sort

Not only by the name in the file, but the users can also sort the files w.r.t size.

Unique :

As the name suggests, this command is used to display the unique file content/ files in a file/ folder respectively. Moreover, people apply this command to remove the duplicates in the file.

ex: sort file_name | uniqsort file1 | uniq

In order to add the content to the file, we people used to scroll in a windows-like operating system. But this Linux platform does not support any kind of scroll. so we people depend on commands to append the data. Moreover, for the purpose of editing, we people depend on the VI editor. So now we will discuss the popular command that is useful in this editor.

h - moves the cursor to leftI - move the cursor to the rightk - moves upi - move downdd- delete the current line:w - to save the changes made:q - exit from the editor:q! - will exit the editor without saving the changes.i - used to insert the data.a - append the content, the cursor will move one position to the righto - insert a blank under the current cursor position to that line.
Some other commands:
man - used to get the information of the command.-h - used to get the information in a short way.pwd - displays the present working directoryls- shows the folders and files in the current directory.ls -a - shows the list of all files in the directory including the hidden files. These hidden files usually start with a dot (.)mv   - moves the file from source to the destinationrm  - removes the specified filenamerm -r  - used to remove the directorycp  copied the file at the source to the destinationmount  - used to mount the external devices like USB, SD-card, DVD's and so on to the local file systemdf- h: display the mount information size like file size in MB. GB. KB.du -sh /* - display the disk usageps -ef - list all the running process with the full detailstop - displays the process and the system resources informationifconfig - configure the network interfacesiwconfig- configures the wireless interfaces
Network commands
ssh username@ip_address - connect to a remote serverping ip_address - check the target is online and respondingnetstat - to get the information of the network portsdeluser - deletes the userchown user_name: group name directory name - change the owner of the file (or)the directorysu username - changes the username temporarilyusers- prints the username of the logged users.wc- counts the lines, bytes as well as the bytestar - copies and compress the filesdate - display the current datefile - displays the file typesfinger - displays the detailed information to the users who were logged into the accountfree - display the amount of free and the used memory in the systemkill - terminates the running processsleep - suspends the process execution for a specified timew (or) finger - displays the detailed information about the logged in userswho - displays the brief information about the logged in users
How to install the package in Ubuntu machines?
apt -get install apt -get install MySQL

And I hope you were successfully installed the package in your system. And this Linux stuff is enough to get into the AWS. And we will discuss further if anything required. 

Visit Linux Training to master in Linux