≡ Menu

awk command

Bash: Pass Shell Variables To awk

How do I pass shell variables to awk command or script under UNIX like operating systems?
[click to continue…]

HowTo: Convert Between Unix and Windows text files

How can I convert newline [ line break or end-of-line (EOL) character ] between Unix and Windows text files?
[click to continue…]

Howto: Call Shell Script function In echo statement

I need to call the function called foo() using echo command in the same statement. How do I all or invoke the function using the echo statement?
[click to continue…]

Linux / Unix: Awk Print Variable

How do I print variables using Awk interpreted programming language under Linux or Unix like operating systems?
[click to continue…]

UNIX / Linux: awk Add Two Numbers

How do I add two numbers using awk? How do I calculate all incoming number stream on fly and display the total using awk?
[click to continue…]

How To Use awk In Bash Scripting

How do I use awk pattern scanning and processing language under bash scripts? Can you provide a few examples?
[click to continue…]

Awk Print Line After A Matching /regex/

How do I a print line after matching /regex/ using awk under Linux / UNIX operating systems? I'd like print the line immediately after a line that matches /regex/ but not the line that matches itself.
[click to continue…]

Finding All Hosts On the LAN From Linux / Windows Workstation

Q. How do I find out if all host computers on the LAN are alive or dead from a Linux or Windows XP computer? My network subnet range is 192.168.1.0/24 and I'm using dual boot Debian Linux / XP SP2 computer.
[click to continue…]

HowTo: Read a File Line By Line Using awk

How do I read a file line by line using awk utility under Unix / Linux operating systems?
[click to continue…]

Move or migrate user accounts from old Linux server to a new Linux server

Q. How do I Move or migrate user accounts to from old Linux server a new Cent OS Linux server including mails? This new system a fresh installation.

A. You can migrate users from old Linux server to new Linux sever with standard commands such as tar, awk, scp and others. This is also useful if you are using old Linux distribution such as Redhat 9 or Debian 2.x.

Following files/dirs are required for traditional Linux user management:
* /etc/passwd - contains various pieces of information for each user account

* /etc/shadow - contains the encrypted password information for user's accounts and optional the password aging information.
[click to continue…]