The netstat command in Linux is a very useful tool when dealing with networking issues. This command is capable of producing information related to network connections, routing tables, interface statistics etc. This utility also helps the network administrators to keep an eye on the invalid or suspicious network connections. In this article we will understand the basics of this command using some practical examples.
The syntax of this command is :
1. Display routing information maintained by kernel... [More]
Does you job requires you to frequently search for patterns in files through Linux command line? Or, do you feel frustrated when you have to open files in UI editors to search for strings or patterns on Linux? Well, if yes then the Linux grep command is for you. This command can be used to search a pattern in one or more files directly from the command line.
In this article, we will understand the usage of Linux grep command through practical examples.
Before jumping on to the examples, lets first take a look on... [More]
In one of the earlier articles at this blog ( here ), we learned the Linux user login management. The article explained how user login and password are managed in Linux. Continuing on the same lines. In this article, we will learn how users are managed in Linux. This article will try to cover basics of Linux user management through command line tools as well as through GUI. Note that since I work on Linux Mint so the GUI part would be applicable only to the Linux debain distributions.
Command Line tools for Linux user / group... [More]
In this article we will study about the Linux open() system call that opens a file (or device). This system call can also be used for creating a file before opening it.
The prototype of the open() function is :
int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
The argument 'pathname' (as the name suggests) is the complete (or relative) path of the file on system.
Since there is also a cap on maximum length of a file name or maximum length of file path in Linux. So, lets say if the... [More]
The Linux command 'stat' is used for displaying status information of Linux files and file systems. In this article, we will discuss the usage of stat command with examples.
stat command syntax
The syntax of stat command is :
stat [OPTION]... FILE...
stat command examples
1. A basic example
In the simplest form, the stat command can be used by supplying a file name as an argument :
$ stat testdisk.log
Size: 1014 Blocks: 8 IO Block: 4096 regular file
Device: 805h/2053d Inode:... [More]
Have you ever thought what happens behind the doors when a user login happens in Linux? Where is the login information for a user is kept in Linux and how the validation of user credential takes place? Well, if not, then I would suggest you to read on as in this article we will discuss how user login management and validation takes place in Linux.
The /etc/passwd file
Well, this is the file in Linux system that contains all the relevant information related to user login. If we peek inside this file, this is what it looks like on my... [More]
(Written by Ping Lee, Henry Chuang, Charlotte Yaou, Winson Chao, and Gary Hsueh)
To get the most from the article, you should have a basic knowledge of SNORT, Linux and a working Linux system on which you can practice the commands covered in this article. Also you should have some networking knowledge such as TCP/IP, iptables, etc.
What Is IPS (Intrusion Prevention System)?
Intrusion Detection System (IDS) is a device which monitors packets on your network. IDS reports attack behaviors based on security... [More]
There are times when you would want to kill a process due to the
any reason like its high CPU usage, high memory usage or simply you
believe that its a virus or a malware. There are various
commands/utilities available in Linux for doing this. One such command
is 'killall'. Lets discuss the 'killall' utility in this article
through some examples.
Before jumping on to the examples, lets briefly take a look at it s
description from the man page :
killall sends a signal to all processes running any of the... [More]
While going through an article on Linux text processing commands, I came across Linux sort command. I found this command interesting enough to read more about it and try out some of it's examples. So here in this article, I'll share my understanding on Linux sort command through some examples.
Before jumping on to examples, here is an excerpt of information from the man page of sort command:
sort - sort lines of text files
sort [OPTION]... [FILE]...
sort [OPTION]... --files0-from=F
As a Linux user, sometimes it is required to know some basic information like :
Time of last system boot List of users logged-in Current run level etc Though this type of information can be obtained from various files in the Linux system but there is a command line utility 'who' that does exactly the same for you. In this article, we will discuss the capabilities and features provided by the 'who' command.
The basic syntax of the who command is :
who [OPTION]... [ FILE | ARG1 ARG2 ]
Examples of 'who' command
1. Get... [More]
Configuring and administrating Linux by using command line utilities is the most popular and preferred way. If you have ever used Linux for your personal or professional work, you would have definitely used the command line.For example, to check the contents of a directory, most users prefer using the 'ls' command rather using the GUI. Most of these command line utilities are written in 'C' language and accept flags and arguments for accepting inputs from user.
For example :
The output of 'ls' command (for a... [More]
A Process is one of the most important fundamental concepts of the Linux operating system. This article focuses on the basics of Linux processes.
A process is an instance of a program running in Linux. This is the basic definition that you might have heard before. Though its simple enough to understand but still lets elaborate a bit for the beginners.
Lets quickly create a hello world program in C language :
printf("\n Hello World\n");
// Simulate a... [More]
The other day when I was searching for some file in my Linux system, I got a result with name 'TheLinuxCommandLine'. I was not sure what type of file was that as ' vim TheLinuxCommandLine ' produced the following output :
3006 0 obj^M<>stream^M
While I got a clue from the word 'PDF' in the output above that it could be a PDF file but then I thought that there should be utility that could gracefully tell the type of file supplied to it as input. I searched a bit and found a Linux command line... [More]
The htop utility in Linux allows you to interactively monitor the processes in real time. It's very similar to top but has some extra features that makes it an even better command line utility for process monitoring. Here is an excerpt from the man page of htop : Htop is a free (GPL) ncurses-based process viewer for Linux. It is similar to top, but allows you to scroll vertically and horizon‐ tally, so you can see all the processes running on the system, along with their full command lines. Tasks related to processes (killing, ... [More]
Most of the people who use Linux on regular basis tend to use command line a lot. This is because once you get used to it, its very easy to do stuff from command line. Now, if a person spends most of his/her time on command line then he/she should start learning all the available short cuts, tips and tricks that Linux command line has to offer. This will not only save time but will also make command line experience interesting. In this article, I will list out a few tricks that I use on regular basis.
Linux command line tips and... [More]