Linux

Lsof find open files

Lsof command examples

lsof is a cool command to find all the open file list, the same command is also used to find the deleted files which is a major reason of overflowing of disk space. But actually the diskspace in not full. The below examples of lsof command will give you a brief  ..

Drop caches pagecache inodes

Linux clear Virtal memory

How to clear virtual memory in linux? Before clearing or free cache memory, execute the sync command in order to make sure all cached objects are freed. # sync To free pagecache # echo 1 > /proc/sys/vm/drop_caches To free dentries and inodes: # echo 2 > /proc/sys/vm/drop_caches To free pagecache, dentries and inodes   ..

Sudo defaults env_keep always_set_home

Script store output as same user not as root

# grep 'Defaults env_keep += "HOME"' /etc/sudoers Defaults env_keep += "HOME" Add the below lines in /etc/sudoers Defaults always_set_home Defaults:username !requiretty,!always_set_home Script to modify sudoers file: # sed -i 's/Defaults:username !requiretty/Defaults: username !requiretty,!always_set_home/' /etc/sudoers   ..

What is domain name

Basic info before registering a domain name

Domain Name: A Domain Name is a unique name that you choose for your web site. All websites are identified only by their names called as domain names (e.g: google.com, w3calculator.com). The domain names have to be registered for having the ownership for that name. Domain name and ip addresses of web  ..

Simple script to remove apache log

Clear apache log file

The below script will help you to find and remove apache log ls -t apache2/error.log* | while read f; do ls -lh $f; n=$(echo $f | cut -d . -f3); echo $n; if test "$n" -gt 20 ; then echo "y : rm $f"; rm -rf $f; fi ;done #  ..

Count log errors based on time

Find error in log file based on time

The below command is used to find the number of access details or number of request based on time. # cat access.log | cut -d ':' -f1,2 | uniq -c Output: 1 Mar 5 10:23 1 Mar  ..

Rename png to jpg file

Change file name from png to jpg

The below script will help you to convert all the specified png files to jpg files. This is a simple single line script, which helps you to rename jpg files to png files or as the files you wish. # for img in *.png; do convert  ..

Prepare survey test report of server

Generate device report

How to prepare the survey report in Linux server? How to prepare the Test report in linux server? How to generate device report in linux server? Below are the steps followed to create the Survey report and Test report of a server. This steps will help you to generate the test report for  ..

Single command to create multiple test files

Example create x number of test files

At time for testing purpose or when we do a study test we might require to create some thousands of files, abut actually we might not have such a testing environment. In linux machine you can achieve this by executing the below simple commands. For this kind of testing or  ..

Ls command to find file size

List files comsuming more space

Normally we list the files by using ls command, but most of the time we use du command to find the file size of a file. The ls command can also be used to find the file size. The below is a simple example to list the file size of  ..

Error RPC cannot make a procedure call create failed

Program not registered storage backup

While running the backup on offline storage you might get the error like this sometimes, In order to resolve the error you can follow the below steps. Follow the below steps to resolve the error RPC warning: RPC cannot make a procedure call: Create failed: Program not registered 1) Verify that the  ..

How to check fiber channel wwn of server

Find the WWN's of LINUX server

What is the command to find the WWN in linux? How to find fibre channel is present in Linux machine or not? How to find and external storage device is added to linux server? In storage normally a user need to find the WWN or world wide number of a fibre channel, before  ..

Recovery from kernal panic boot rescue

Simple steps to recover from kernal panic

How to recover linux machine from kernel panic error? Kernel panic boot rescue:when there is a kernel panic on server, we might need to have a serious look on it, That too if its a production box then you must consider it very seriously. Normally the below steps are used at  ..

Error no process left sysinit inittab missing

Rc.sysinit or inittab file missing

What to do when I receive /etc/inittab file missing error? what to do when I get /etc/rc.d/sysinit.d file missing? When you receive the error, follow the below steps to recover or reinstall the inittab script or initscripts 1) Boot Linux from CD 2) You will get boot promt on screen. 3) Type linux rescue   ..

Error kernel file not found

Reinstalling kernal file not found error

How to reinstall the kernel? To test this really if you are interested, make sure you have backup of your system and be ready to install the machine.remove the /vmlinux.... and /initrd image from the machine. and you will get this error. 1) Boot Linux from CD 2) You will get boot promt  ..

< Previous 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Next >

Tech Bluff