Posts

Showing posts from 2014

Linux user management - Create, Remove, modify an user account

Image
User Management is one of the major responsibilities of a System Administrator. The user can either be an account associated with an application or a human being. This post shows how a user account can be created, removed and modified via CLI.

List of alternative Linux/Open-source software

Image
"There are moments in our lives when we find ourselves at cross roads. The choice that we make in those moments can define the rest of our life". At some point you might get fed up with proprietary OS/software and will start thinking about switching to Linux/open source software. Only thing that holds you back is the doubt whether there are any alternates to the software that you have been using for long. This post is intended to address such doubts. credits: stickycomics.com

what is UID and GID in Linux?

Image
In order to log into a Linux computer you would require a user account. Once you log in to the computer you can access the files and folders available in the computer. In a Linux  system, each user is identified by the kernel with a number called User Identifier or UID. During user creation the system generates a UID and maps it with a username. The /etc/passwd file contains UID to username mapping of all users in the system. In most Linux operating system the value  of UID lies between 0 - 499 for system generated users and  500 - 60000 for new users created. The default UID of root user is 0.

echo command

Image
echo is a command used to print a line of text or a string to the terminal. echo command is not limited to *nix operating system. They are also used in other operating systems like Unix, DOS, MS  Windows etc. In Linux echo is usually used in shell scripts to display output while running a script. The syntax of echo command is as follows

How to set / find system date and time in Linux

Image
Inorder to set/find the system date and time in Linux we use the date command. The syntax of date command is

Fedora 20 (Heisenbug) installation walkthrough

Image
Fedora 20 codenamed "Heisenbug" was released on 17 December 2014. You can either order Fedora CD/DVD from a local / online vendor or you can simply download the iso file and burn it in a CD/DVD or usb stick

grep command usage examples.

Image
grep is one of the most widely and frequently used command by linux administrators for their day to day work. Be it finding a specific line among thousands of lines in a code orsearching a log file for errors and warnings, we depend on grep. Following are some examples on typical usages of grep command.

How to print lines matching pattern or string ?

Image
Consider you have a file called dictionary.txt with a huge collection of words and you only want to view line containing the word "tux". To check each word line by line is a tedious task, instead we use the grep command.

Is there any reference or documentation for Linux commands?

Image
When you come across a new word and don't know what it means, you will start looking for its meaning in a dictionary. But what if you have  just heard about a new Linux command and have absolutely no idea what the command does? Where will you look for a reference or documentation to the command?

How to find location or path of a command

In our earlier posts we saw how to find the location of a file with locate command and find command. But how do we find the path of a command in Linux? For that purpose we use the following commands which whereis

How to compare two file ?

In Linux we can compare whether two files are the same or not using more than one command. They are cmp command diff command sdiff command

How to create links in linux?

Image
To create a link file we use the command ln in Linux. Using ln command we can create both hard link and symbolic (soft) link.

What are the different link files in linux ?

Image
A file in Unix/*nix environment consist of two part, a filename part and a data part.  File name is just a reference or a link to the data part. The data part is known as i-node and it is the i-node of a file which stores the information regarding the file like file permission, file location, file size etc... Usually a file's data is accessed by calling the filename. But there are methods by which same data can be accessed using several names. We call these methods Link. Links are divided into 2 types. They are

Linux File System

Image
Just imagine an office environment before the arrival of computers.  All the data connected with the office will be available in paper and kept in a file. In a big organization there will be thousands of file. It will be hard to keep track of all these files unless all the files are kept safely and well organized. This not only helps to track a file easily but also improves work efficiency of the place.  Now lets co-relate the scenario with a computer. Instead of paper files, in a Computer System

what is an inode?

Image
In Unix/*nix every file has a data structure known as i-nodes (index nodes). Each i-node stores all the information regarding a file like File type File mode or permission Number of links User ID Group ID File size Time stamp File deletion time

How to check file type in linux ?

In our last post we saw which are the different file types in linux and how to identify different file types from ls -l output. But we have a command called file to determine the file type. file command tests each file prints the fileype. The syntax for file command is

What are the different file types in linux

Image
"In a UNIX system, everything is a file; if something is not a file, it is a process ." - Unix Philosophy The above quote  is one of the philosophies Linux has inherited from Unix. i.e.  in Linux everything is a file, be it a regular text file, directory or a hardware component like hard disk. In Linux, files are classified in to 7 types. They are Regular Files Directory Block Files Character Files Symbolic Link Files Socket Files Named Pipe Files

How to search and find location of a file in linux ?

In linux there are mainly two methods by which a file's location can be searched. They are locate command find command

How to remove a file in linux ?

rm is one of the basic commands used to remove a file in linux. rm can be used to remove a file, directory, device nodes, links and so on.The rm syntax is given below

How to move or rename a file in linux?

mv (short form for move) command is the linux command used to move a file from one location to another. Just like moving the file location, mv can move file names from one name to another. i.e with mv command can be used to rename a file. The syntax for mv command is as follows

How to copy files or directories from command line in linux ?

For copying files and directories from command l ine we use cp command. The Syntax for cp command is as follows

How to view only first or last few lines in linux ?

In the previous post we saw how to view / display the contents of a text file with more and less commands. What if you don't want to view the entire file contents? Say, you want to view only the first 10 lines of the file. Or you want to see only last few lines of the file. For that purpose we use the commands head and tail.

How to view or display contents of a file in linux one screen at a time?

Image
more and less are paging commands used in Unix/*nix systems to display contents of a file one screen at a time. The difference between more and less is that, less supports both forward and backward navigation through a file. Whereas more supports forward navigation but backward navigation is very much limited.

How to edit a text file from command line in linux ?

In Unix/*nix vi is the standard and widely used commands to edit/create a plain text file from the command line. vim (Vi IMproved ) is another text editor based on vi which can be run from a Command Line Interface as well as a Graphical User Interface. 

Linux Wildcards - Standard

Image
" Unix is simple. It just takes a genius to understand its simplicity. " – Dennis Ritchie One of the advantage of Unix or *nix operating system is its simplicity. Beginners might find it hard to agree with me. But once you have familiarized with the OS and learned how to make use of it, you will discover the simplicity offered by Unix / *nix operating systems. Wildcards are one such concept which make Unix / *nix simple

cat command

cat command is one of the basic linux commands used to concatenate and write files. cat command can be used for the following major purposes View text files Create text files Append, Combine text files Copy a text file  

How to list contents of a directory ?

To list the contents of a directory in linux use the ls command. ls command when used with out any argument will display the contents of the current directory.

How to create a directory in Linux

Image
  In order to create one or more than one directory in Linux we use the command mkdir . For creating a directory you type mkdir followed by the directory name.The command will create a new director y , provided a directory by the same name do not already exist . The syntax to create a directory in Linux is as shown below

What was that command again?

Image
What will you do if you forgot the command name you want to run on your Linux box? Yeah, right! You will google it. But what if you have no access to internet. Don't worry apropos command is there to save you.  The command apropos which means appropriate or relevant in English search the man pages and its description for a keyword and display them on the screen. This command is useful when you are not sure about the exact command you want to use.

what is a Linux Kernel?

Image
We all know that a computer is a machine capable of performing arithmetic and logical operations. The  Operating System manages the hardware and software resources of a computer and provide the services for other programs to run. The operating system has to work closely with the system hardware to get the correct response. In a computer system it is the CPU or the processor which does all the arithmetic and logical operations along with managing the data flow. But CPU or processors are devices that understands only binary data, i.e.  data comprised of only ones (1) and zeroes (0). Where as the user applications are mostly programs written in high level languages like C, C++. So how does the hardware understand the instruction given by a user application written in high level language. Or who translates the high level language to machine level language. The answer is, Kernel.

Things you should know about linux

Image
Hello fledglings!!! Welcome to the world of Linux. Before you start using linux here are a few things that you should know about linux

Linux Basic Commands

Wi th my first  post I am adding some of the basic and most frequently used Linux commands . Most of th e commands mentioned here can be used in numerous methods. Detailed usage of each com mands will be the sub ject of my next posts.