Quantcast
Channel: nixCraft
Browsing all 39 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

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...

View Article



Image may be NSFW.
Clik here to view.

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...

View Article

Image may be NSFW.
Clik here to view.

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?Read answer to: "How To Use awk In Bash Scripting"    

View Article

Image may be NSFW.
Clik here to view.

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?Read answer to: "UNIX / Linux: awk Add Two Numbers"    

View Article

Image may be NSFW.
Clik here to view.

Linux / Unix: Awk Print Variable

How do I print variables using Awk interpreted programming language under Linux or Unix like operating systems?Read answer to: "Linux / Unix: Awk Print Variable"    

View Article


Image may be NSFW.
Clik here to view.

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?Read answer to: "Howto: Call Shell Script function In...

View Article

Image may be NSFW.
Clik here to view.

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?Read answer to: "HowTo: Convert Between Unix and Windows text files"    

View Article

Image may be NSFW.
Clik here to view.

Bash: Pass Shell Variables To awk

How do I pass shell variables to awk command or script under UNIX like operating systems?Read answer to: "Bash: Pass Shell Variables To awk"    

View Article


Image may be NSFW.
Clik here to view.

awk / cut: Skip First Two Fields and Print the Rest of Line

I'd like to skip first two or three fields at the the beginning of a line and print the rest of line. Consider the following input:This is a test Giving back more than we take I want my input file...

View Article


Image may be NSFW.
Clik here to view.

Linux: Find Out What Partition a File Belongs To

How do I find out that /users/f/foo/file.txt file belongs to a specific partition?Read answer to: "Linux: Find Out What Partition a File Belongs To"    

View Article

Image may be NSFW.
Clik here to view.

Linux Command: List All Users In The System

I'm a new Linux sys admin and I'm unable to find the command to list all users on my RHEL server. What is the command to list users under Linux operating systems?Read answer to: "Linux Command: List...

View Article

Image may be NSFW.
Clik here to view.

Linux / Unix AWK: Read a Text File

How do I read a text file using awk pattern scanning and text processing language under Linux / Unix like operating systems?Read answer to: "Linux / Unix AWK: Read a Text File"    

View Article

Image may be NSFW.
Clik here to view.

Unix / Linux Shell: Get Third Field Separated by Forward Slash (/) Delimiter

I'm writing a shell script for automation purpose. The output the path of the current working directory is stored in $PWD or it can be obtained using the pwd command. How do I find out find out 3rd...

View Article


Image may be NSFW.
Clik here to view.

Linux / Unix sed: Delete Word From File / Input

I've a file as follows: This is a test. One bang two three Foo dang Bar 001 0xfg 0xA 002 0xA foo bar 0xfG I'm done How do I delete all "words" from the above file which ends with a particular letter...

View Article

Image may be NSFW.
Clik here to view.

awk: warning: escape sequence '\'

I'm trying to match words using GNU awk command and getting the following error: echo 'foo bar this that blah' | awk '{gsub("\<regex-word\>", "NEW-WORD");print}' But getting the following...

View Article


Image may be NSFW.
Clik here to view.

Linux / Unix: Sed / Grep / Awk Print Lines If It Got 3 Words Only

I have a sample data file: This is a test. Unix is Best. No Linux is the Best. Space in simple understanding is an area or volume. Outer space . I need the output: Unix is Best. Outer space . How do I...

View Article

Image may be NSFW.
Clik here to view.

Awk Find And Replace Fields Values

I have a data as follows : foo bar 12,300.50 foo bar 2,300.50 abc xyz 1,22,300.50 How do I replace all , from 3rd field using awk and pass output to bc -l in the following format to get sum of all...

View Article


Image may be NSFW.
Clik here to view.

Linux: Find Out What Process Are Using Swap Space

The top and free command display the total amount of free and used physical and swap memory in the server. How do I determine which process is using swap space under Linux operating systems? How do I...

View Article

Image may be NSFW.
Clik here to view.

Bash Shell: Remove (Trim) White Spaces From String / Variable

I have a bash variable as follows: output="$(awk -F',' '/Name/ {print $9}' input.file)" How do trim leading and trailing whitespace from bash variable called $output? How do I trim trailing whitespace...

View Article

Image may be NSFW.
Clik here to view.

Linux / Unix: Add Line Numbers To Files

I know how to display line numbers using vim text editor. How do display line numbers in the left side for any text file under Unix or Linux operating systems?Read answer to: "Linux / Unix: Add Line...

View Article
Browsing all 39 articles
Browse latest View live




Latest Images