Skip to content
The Unix Tips
cat /vishal/brain > theunixtips.com
  • About
  • Contact Me

Category: Bash

Bash/Shell Scripts

Compare files ignoring a field or column using Process Substitution

Posted on August 9, 2016 by Vishal Jain

Using Process Substitution method, two streams of data can be used with `diff`. This allows pre-processing of files to drop some part (e.g. a column/record per ...

Bash/Shell Scripts/Unix Admin

postfix : Configure outgoing relay server

Posted on March 31, 2014 by Vishal Jain

Add name of outgoing/relaying mailhost as `relayhost` in `/etc/postfix/main.cf` and restart postfix.

Bash/Shell Scripts/Unix Admin

Find the process monopolizing the CPU without using “top”

Posted on March 24, 2014 by Vishal Jain

`ps -eo pcpu,pid,ruser,args | sort -r -k1 | less` provides in reverse sort order the `pid` that is taking up most of `pcpu` and the `ruser` (real user) with `ar...

Bash/Shell Scripts/Unix Admin

bash : grep for pattern from certain location in the file

Posted on August 21, 2011 by Vishal Jain

Using dd, the file can be sliced and then grep can be applied for the pattern on that slice.

Bash/Shell Scripts/Unix Admin

bash : search multiple file patterns using single find command

Posted on June 9, 2011 by Vishal Jain

Using a combination of patterns with "-o" and/or -"a" (which OR the pattern or AND the pattern) in find command, one can search for various patterns or combine ...

Bash/OS Interoperability/Shell Scripts/Unix Admin

Howto rollover a file when size exceeds using unix find

Posted on March 27, 2011 by Vishal Jain

Using -size and -exec flags of find command, one can easily find when the logfile has grown above the threshold and move it to another name in one shot.

Bash/Debugging Tools/OS Interoperability/Shell Scripts

Unix : find affected by current working directory

Posted on February 5, 2011 by Vishal Jain

Many Unix variants (including latest Solaris 11 Express) use a version of find that first looks for current working directory. And if that current working direc...

Bash/Shell Scripts

bash : Count number of recurrence of lines

Posted on January 8, 2011 by Vishal Jain

Using sort and uniq commands, one can count number of recurrences of records in a file.

Bash/Debugging Tools/Unix Admin

bash : Self redirect of Script’s output to a file

Posted on September 4, 2010 by Vishal Jain

Using shell builtin exec, ouput and error output streams of a script can be redirected just like ">" or ">>" operators.

Bash/OS Interoperability/Unix Admin

How to find current runlevel on unix system

Posted on July 29, 2010 by Vishal Jain

Linux provides a utility called runlevel but "who -r" is a portable solution which is available across various Unixes.

Posts navigation

1 2 Next »

Recent Posts

  • OTTO – Automate C/C++ CMake for Large Repositories
  • How to persist iptables settings on debian
  • How to Change Console Fonts In Ubuntu for 4K Screen
  • HP Spectre x360 convertible and Linux
  • HOWTO Develop Apache Module in C++

Top Posts

  • xming : Client 4 rejected from IP
  • bash : Self redirect of Script's output to a file
  • VirtualBox : Use Raw Disk to load Windows under Linux
  • perl : find if IP address is in Network range
  • mimikatz : Export non-exporteable Private certificate from Symantec PKI
  • Create Post Excerpt Intelligently in Jekyll
  • HP Spectre x360 convertible and Linux
  • How to Change Console Fonts In Ubuntu for 4K Screen
  • perl : Extract filename from full path

Recent Posts

  • OTTO – Automate C/C++ CMake for Large Repositories
  • How to persist iptables settings on debian
  • How to Change Console Fonts In Ubuntu for 4K Screen
  • HP Spectre x360 convertible and Linux
  • HOWTO Develop Apache Module in C++

Follow Me

  • LinkedIn
  • GitHub
© 2021 The Unix Tips
Powered by WordPress | Theme: Graphy by Themegraphy