LinuxHelps.com

A blog for Linux Lovers.

Archive for the 'Linux Helps' Category


SED and AWK command

Wednesday, December 28th, 2011
Linux Helps | No Comments »

sed (stream editor)
Sed is a non-interactive editor. Instead of altering a file by moving the cursor on the screen, you use a script of editing instructions to sed, plus the name of the file to edit. You can also describe sed as a filter.
Let’s have a look at some examples:
[...]

Stderr and Stdout Redirection.

Monday, January 11th, 2010
Linux Helps | No Comments »

1.) stdout to a file
The output of a command will redirect to another file.
Eg:          ls -l > list.txt
2.) stderr to a  file
The following command will redirect the  stderr ouput of a program to a new file.
Eg:       grep sibu * 2> grep-errors.txt
Here, a file called ‘grep-errors.txt’ will be created and it will contain what you [...]

History with Time and Date.

Saturday, June 20th, 2009
Linux Helps | 2 Comments »

History with Time and Date
The command history will give you the list of command which you executed earlier. By default you won’t get the the command execution time and date.
If you wish to have a history details with time and date please do the following.
Open /etc/bashrc file and add the following line.
Export HISTTIMEFORMAT=”%h%d [...]

Zombie process

Thursday, June 18th, 2009
Linux Helps | No Comments »

Zombie process is an inactive computer process, according to wikipedia article, “…On Unix operating systems, a zombie process or defunct process is a process that has completed execution but still has an entry in the process table, allowing the process that started it to read its exit status. In the term’s colorful metaphor, the child [...]

Yum Commands

Sunday, May 24th, 2009
Linux Helps | No Comments »

YUM packages updater (Fedora, RedHat and like)
yum install package_name download and install a rpm package
yum localinstall package_name.rpm That will install an RPM, and try to resolve all the dependencies for you using your repositories.
yum update update all rpm packages installed on the system
yum update package_name upgrade a rpm package
yum remove package_name remove a rpm [...]

RPM commands

Sunday, May 24th, 2009
Linux Helps | No Comments »

rpm -ivh package.rpm install a rpm package
rpm -ivh –nodeps package.rpm install a rpm package ignoring dependencies requests
rpm -U package.rpm upgrade a rpm package without changing configuration files
rpm -F package.rpm upgrade a rpm package only if it is already installed
rpm -e package_name.rpm remove a rpm package
rpm -qa show all rpm packages installed on the system
rpm [...]

File search commands

Sunday, May 24th, 2009
Linux Helps | No Comments »

find  / -name file1 - search file and directory into root filesystem from ‘/’
find / -user user1 - search files and directories belonging to ‘user1′
find /home/user1 -name \*.bin - search files with ‘. bin’ extension within directory ‘/ home/user1′
find /usr/bin -type f -atime +100 - search binary files are not used in the last [...]

User management commands

Sunday, May 24th, 2009
Linux Helps | No Comments »

Users and Groups
groupadd group_name create a new group
groupdel group_name delete a group
groupmod -n new_group_name old_group_name rename a group
useradd -c “Name Surname ” -g admin -d /home/user1 -s /bin/bash user1 create a new user belongs “admin” group
useradd user1 create a new user
userdel -r user1 delete a user ( ‘-r’ eliminates home directory)
usermod -c “User FTP” -g [...]

Difference between soft link and hard link

Tuesday, March 10th, 2009
Linux Helps | No Comments »

Hard Links :
1. All Links have same inode number.
2.ls -l command shows all the links with the link column(Second) shows No. of links.
3. Links have actual file contents
4.Removing any link ,just reduces the link count , but doesn’t affect other links.

Soft Links(Symbolic Links) :
1.Links have different inode numbers.
2. ls -l command shows all links with [...]

To set fsck on next reboot.

Tuesday, March 10th, 2009
Linux Helps | No Comments »

fsck is used to check and optionally repair one or more Linux file systems. All you need to do is just create empty file /forcefsck.
#touch /forcefsck
By creating /forcefsck file you will force the Linux system to perform a full file system check.