Category Archives: Basic Linux

this categories in include basic Redhat Linux article

how to increase swap memory after installation Linux

Hello guys today in this article we are going to learn how to increase swap memory in linux after installation. As well we know swap memory is play very important roll in linux  operating system Actually swap memory is use some space of heard disk space as a ram , but  its a very important think that how space we create for swap memory. All Linux Administrator and engineers always recommend we need configure swap area just double to physical memory. For example we have 4 GB physical memory then we need to configure 8 GB swap area or partition during Linux installation.  so let we now we are focus on our article heading. for example let’s assume we have 8 GB Linux Server or Desktop operating system we realized that our system need to increase physical memory so here we increase 8 GB Physical memory so here everything is normal our system is work perfectly and good but according to Linux expert rules we have to need just dual swap are to physical memory. so in this case we have two option 1st we will create extra swap partition or if we don’t have heard disk space we can also use file as a swap space its a very simple process so without wasting time we are learn how its possible.

(notice- in this tutorial all commands fire by root account you can also fire through other user you just use sudo  )

1 we will create directory where we hold swap file (its not necessary you can hold anywhere in your system ) 

mkdir -v /var/cache/swap

2 then we will go in this directory through this commands

cd /var/cache/swap

3 next here we will create any Empty file according to our Requirement using dd Command here my requirement is 8 GB swap area so look below Commands

dd if=/dev/zero of=swapfile bs=1K count=8M

4 then next we provide 600 permission 

chmod 600 swapfile

5 next we will Convert newly created file into a swap space file.

mkswap swapfile

6 then here we enable swap file and look this is work ?

sudo swapon swapfile
top -bn1 | grep -i swap

7 then we next we will stop swap file and entry in main swap file 

swapoff swapfile 

then we add entry this file is /etc/fstab 

echo "/var/cache/swap/swapfile none swap sw 0 0" | tee -a /etc/fstab

9 then we on swapfile using blow Commands 

 swapon -va

if you have any problem in this tutorial please comments here i will solve your problem

thank you

Writer- Vishnu Sharma (Linux and Network system Administrator)


How to Write and compile C Programs in RedHat Linux Server

Hello guys in this tutorial we are going to learn how to write and Compile C program in RedHat Linux Server.Its a very simple process you just need to following Simple Steps. At Fast we will Install C Compiler in Linux Server. we will install C Compiler through Yum Server. If you don’t have any idea about YUM server so please click and look how to install yum server in Redhat LInux Serverc labguage Step 1 Here i assume that  you have configured YUM Server in redhat linux, then you  will install C -Compiler  through below Commands

[root@localhost ~]# yum install gcc* -y 

Step 2 then we will write C Program like this

[root@localhost ~]# vim vishnu.c
void main()
printf("hello this is my linux server c programming demo');

Step 3 then we will compile Program below Commands

[root@localhost ~]# gcc vishnu.c -o cprogram

Step 4 now if we don’t found any error in this  program then we will run below commands 

[root@localhost ~]# ./cprogram
hello this is my linux server c programming demo

if you have any Problem in this process please comments here i will solve your problem

Thank you

Vishnu Sharma

How to broke/Split any file in redhat Linux Server

hello guys today we will learn how can we split any file in our linux machine its a very simple method .before we know why we split any file some time we need to send  any important data through E-mail but our data is very large. so we cant’t send through Email .so we can broke many parts in our data file and send. receiver will be collect all broke data file and make original data file. that plus point is we can split any extensions file like MP3, mp4, jpg .png.text .text PDF  everything .so let we will start just follow mefile split

Step 1 before we will create any file in 200MB size and then we will split in nine (9) parts 

[root@localhost ~]# dd if=/dev/sda of=demo.txt bs=2M count=100
100+0 records in
100+0 records out
209715200 bytes (210 MB) copied, 2.96287 seconds, 70.8 MB/s

now we have Demp.txt  file its size  is 210 mb .

Step2 now we will split in nine (9) parts through this commands 

( Note-Actually split commands is work on  bytes so  here we gave our split size 25000000kb )

[root@localhost expirment]# split -b 25000000 demo.txt
[root@localhost expirment]# ls
demo.txt  xaa  xab  xac  xad  xae  xaf  xag  xah  xai

Step3 now we will delete our demo.txt file

[root@localhost expirment]# rm -rf demo.txt
[root@localhost expirment]# ls
xaa  xab  xac  xad  xae  xaf  xag  xah  xai

here we dont’t have demo .txt file

Step4 now we can create original file through all broken parts   

[root@localhost expirment]# cat x*> demo.txt

when we will look our directory we found our demo txt file

[root@localhost expirment]# ls
demo.txt  xaa  xab  xac  xad  xae  xaf  xag  xah  xai

its a very useful and simple method if you have any problem in this method comments here i will solve your problem

Thank you

By Vishnu sharma

How to Compress and Decompress any file in Redhat Linux Server

hello friends today we will learn how to Compress and Decompress any file in Linux .Linux Server in File compression very powerful we can can Compress any file through many methods here i show you some Powerful method .You just follow simple step

compress data in linux

Step i create some text file and then i compress and compress through TAR method
[root@localhost ~]# touch a1.txt
[root@localhost ~]# touch a2.txt
[root@localhost ~]# touch a3.txt
[root@localhost ~]# touch a4.txt

Continue reading

How to open any ios file in Redhat linux

hello guys here we will learn how can we open any ios file in linux.Here we open iso file and copy some data or folder .it is very help full for linux because we can make YUM.(if u want to know what is yum ?and how to configure redhat linux server so click on link)  And we can also install important packge in linux .so it is very important how to open iso file in redhat linux. If u want to know how can we receive iso file in linux so click how can we transfer windows file in linux .when we receive iso file we will open like this Continue reading

How to create user and group in linux redhat server

hii guy today we will learn and discuss that how can we create group and user in linux server and also learn how to provide  different -2 permission every user or group on specify  file .For example we look any company or organisation  employ schedule in some person can read only schedule .but some person can manipulation in schedule .so we will learn how to do it basically like this work depend on read ,write. execute permission . Continue reading

how to configure file security in linux redhat

hello guys today we will discuss about file security in Linux redhat .we can configure file password very easy. this process in we can provide file password before file create and after file create .so let we start how to possible this before we will make one simple text file through VIM commands Continue reading