command

How to create a temporary file in Linux

1.0 Temporary Files Quite often, we need temporary files in our programs. Some intermediate data needs to be stored and the file can be discarded when the process terminates. There are multiple ways of creating temporary files in Linux. The best way to create a temporary file in Linux is to use the O_TMPFILE flag …

How to create a temporary file in Linux Read More »

Error while executing the dig command

1.0 Error While executing the dig command, the sendmsg() failed: Operation not permitted error was printed. $ dig example.com ../../../../lib/isc/unix/net.c:581: sendmsg() failed: Operation not permitted ../../../../lib/isc/unix/net.c:581: sendmsg() failed: Operation not permitted … 2.0 Solution The error was resolved after adding the following iptables rules. iptables -I OUTPUT 1 -p udp -s 127.0.0.1 -d 127.0.0.1 -j …

Error while executing the dig command Read More »

tr command in Linux

1.0 tr The tr command is a filter which reads the standard input, translates or deletes characters and writes on its standard output. The tr command syntax is, tr [OPTION]… SET1 [SET2] tr transliterates characters from SET1 into corresponding characters of SET2 in input and writes resulting text on the standard output. For example, to …

tr command in Linux Read More »

grep Command in Linux

1.0 grep grep is a program for searching a given string pattern in files. It searches the files for the pattern and prints the lines that contain strings matching the pattern. For example, $ # grep pattern filenames … $ grep ‘hbox’ find.c GtkWidget *window, *scrolled_win, *hbox, *vbox, *find; hbox = gtk_hbox_new (FALSE, 5); gtk_box_pack_start …

grep Command in Linux Read More »

Shell Scripting Tutorial

1.0 Shell Script bash is the commonly used shell in GNU-Linux. bash can be run interactively, as a login shell or as an interactive process from a terminal emulator like the gnome-terminal. bash can be run non-interactively by running a bash script. A shell script, or bash script, is a list of commands written to …

Shell Scripting Tutorial Read More »

An Introduction to Shell in Linux

1.0 SHELL A shell provides a user interface to a computer system. There are two types of shells, the command line interface (CLI) and the graphical user interface (GUI). In this tutorial, we describe the command line interface shell only and refer to it simply as shell. A CLI shell is a programmable command interpreter …

An Introduction to Shell in Linux Read More »