Linux – Standard I/O Streams ”; Previous Next Standard IO Streams refers to the following three streams which are provided by default by any Linux or Unix system. Stdin Stream Stdout Stream Stderr Stream As explained earlier, In Linux, everything is a file. Like directories, regular files, and even the devices are considered to be special files. Each file has an associated number which is called a File Descriptor or in short an FD and this FD is used to make any input or output operation on the associated file. Stdin , Stdout and Stderr are terminal screen and their file descriptors are 0, 1, and 2 respectively. Stdin Input Stream This is referred to as the standard input and the associated file descriptor is 0. This is also represented as STDIN. The Linux program will read the default input from STDIN. Actually STDIN refers to the computer screen. Most of Linux commands support standard Stdin stream which means instead of using files or command line input, we can feed data to the program directly using STDIN. For example cat command will read input from the screen. Type the following command and start writing something as follows: $ cat This is text which I”m feeding using STDIN directly. This is text which I”m feeding using STDIN directly. $ Here cat command takes standard input and when you go to next line by using Enter key or exit using CTRL+D, it prints the same input to the display which is your standard output. When you write a C, C++ or Java program and halts it to read some input from the screen, then Stdin stream is used to read the data from the input screen. You can send data to Stdin using the input redirection operator < as follows $ cat < inputfile.txt This is text which I”m feeding using STDIN directly. $ Above command reads the input from inputfile.txt and redirect it to Stdin which is finally fed to the cat program to be displayed on the screen. Stdout Output Stream This is referred to as the standard output and the associated file descriptor is 1. This is also represented as STDOUT. The Linux program will write the default output at STDOUT. Whenever a Linux program is executed, it’s output is sent to your computer screen’s File Descriptor which is then you see on the display screen. Alternatively you can send your program output to any file to be saved or to any printer to be printed. Following command sends the output to Stdout so that it can be displayed on your screen: $ ls -l total 8 -rw-r–r– 2 root root 132 May 1 07:18 filename -rw-r–r– 2 root root 132 May 1 07:18 hardlink lrwxrwxrwx 1 root root 8 May 1 07:17 symlink -> filename $ You can redirect your output to be saved in a file output.txt using the output redirection operator > as follows: $ ls -l > output.txt $ Or you can use the following command: $ ls -l 1 > output.txt $ Now none of the output will be displayed on the screen. Here we mentioned 1 > output.txt which means Stdout should be redirected to output.txt file. By default system considers it as Stdout. Next section will differentiate Stdout from Stderr. Stderr Error Stream This is referred to as the standard error and the associated file descriptor is 2. This is also represented as STDERR. The Linux program will write all the error messages at STDERR. By default STDERR is your display screen but just like standard out, it can be redirected to a file to save the error messages. Let’s try the same cat command with a file name which does not exit: $ cat nonexist.txt cat: nonexist.txt: No such file or directory $ Here nonexist.txt file does not exist, so an error is displayed on the screen as stderr by default. You can save this error message using the file descriptor 2 as follows: $ cat nonexist.txt 2>err $ This time your error message is saved in err file. Print Page Previous Next Advertisements ”;
Category: unix
Unix / Linux – Shell Loops
Unix / Linux – Shell Loop Types ”; Previous Next In this chapter, we will discuss shell loops in Unix. A loop is a powerful programming tool that enables you to execute a set of commands repeatedly. In this chapter, we will examine the following types of loops available to shell programmers − The while loop The for loop The until loop The select loop You will use different loops based on the situation. For example, the while loop executes the given commands until the given condition remains true; the until loop executes until a given condition becomes true. Once you have good programming practice you will gain the expertise and thereby, start using appropriate loop based on the situation. Here, while and for loops are available in most of the other programming languages like C, C++ and PERL, etc. Nesting Loops All the loops support nesting concept which means you can put one loop inside another similar one or different loops. This nesting can go up to unlimited number of times based on your requirement. Here is an example of nesting while loop. The other loops can be nested based on the programming requirement in a similar way − Nesting while Loops It is possible to use a while loop as part of the body of another while loop. Syntax while command1 ; # this is loop1, the outer loop do Statement(s) to be executed if command1 is true while command2 ; # this is loop2, the inner loop do Statement(s) to be executed if command2 is true done Statement(s) to be executed if command1 is true done Example Here is a simple example of loop nesting. Let”s add another countdown loop inside the loop that you used to count to nine − #!/bin/sh a=0 while [ “$a” -lt 10 ] # this is loop1 do b=”$a” while [ “$b” -ge 0 ] # this is loop2 do echo -n “$b ” b=`expr $b – 1` done echo a=`expr $a + 1` done This will produce the following result. It is important to note how echo -n works here. Here -n option lets echo avoid printing a new line character. 0 1 0 2 1 0 3 2 1 0 4 3 2 1 0 5 4 3 2 1 0 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 Print Page Previous Next Advertisements ”;
Unix / Linux – System Calls
Unix, Linux System Calls Web This Site Unix for Beginners Unix – Home Unix – Getting Started Unix – File Management Unix – Directories Unix – File Permission Unix – Environment Unix – Basic Utilities Unix – Pipes & Filters Unix – Processes Unix – Communication Unix – The vi Editor Unix Shell Programming Unix – What is Shell? Unix – Using Variables Unix – Special Variables Unix – Using Arrays Unix – Basic Operators Unix – Decision Making Unix – Shell Loops Unix – Loop Control Unix – Shell Substitutions Unix – Quoting Mechanisms Unix – IO Redirections Unix – Shell Functions Unix – Manpage Help Advanced Unix Unix – Regular Expressions Unix – File System Basics Unix – User Administration Unix – System Performance Unix – System Logging Unix – Signals and Traps Unix Useful References Unix – Useful Commands Unix – Quick Guide Unix – Builtin Functions Unix – System Calls Unix – Commands List Unix Useful Resources Unix Useful Resources Selected Reading Computer Glossary Who is Who Copyright © 2014 by tutorialspoint Home References Discussion Forums About TP Unix, Linux System Call List of Unix, Linux System Calls accept access acct add_key adjtimex afs_syscall alarm alloc_hugepages arch_prctl bdflush bind break brk cacheflush chdir chmod chown chroot clone2 clone close connect create_module creat dup2 dup epoll_create epoll_ctl epoll_wait execve exit_group _exit exit _Exit faccessat fattch fchdir fchmodat fchmod fchownat fchown fcntl fdatasync fdetach flock fork free_hugepages fstatat fstatfs fstat fstatvfs fsync ftruncate futex futimesat getcontext getcwd getdents getdomainname getdtablesize getegid geteuid getgid getgroups gethostid gethostname getitimer get_kernel_syms get_mempolicy getmsg getpagesize getpeername getpgid getpgrp getpid getpmsg getppid getpriority getresgid getresuid getrlimit get_robust_list getrusage getsid getsockname getsockopt get_thread_area gettid gettimeofday getuid getunwind gtty idle inb inb_p init_module inl inl_p inotify_add_watch inotify_init inotify_rm_watch insb insl insw intro inw inw_p io_cancel ioctl ioctl_list io_destroy io_getevents ioperm iopl ioprio_get ioprio_set io_setup io_submit ipc isastream kexec_load keyctl kill killpg lchown linkat link listen _llseek llseek lock lookup_dcookie lseek lstat madvise mincore mkdirat mkdir mknodat mknod mlockall mlock mmap2 mmap modify_ldt mount move_pages mprotect mpx mq_getsetattr mremap msgctl msgget msgop msgrcv msgsnd msync multiplexer munlockall munlock munmap nanosleep _newselect nfsservctl nice obsolete oldfstat oldlstat oldolduname oldstat olduname openat open outb outb_p outl outl_p outsb outsl outsw outw outw_p path_resolution pause perfmonctl personality pipe pivot_root poll posix_fadvise ppoll prctl pread prof pselect ptrace putmsg putpmsg pwrite query_module quotactl readahead readdir read readlinkat readlink readv reboot recvfrom recv recvmsg remap_file_pages renameat rename request_key restart_syscall rmdir rtas rt_sigaction rt_sigpending rt_sigprocmask rt_sigqueueinfo rt_sigreturn rt_sigsuspend rt_sigtimedwait sbrk sched_getaffinity sched_getparam sched_get_priority_max sched_get_priority_min sched_getscheduler sched_rr_get_interval sched_setaffinity sched_setparam sched_setscheduler sched_yield security select select_tut semctl semget semop semtimedop sendfile send sendmsg sendto setcontext setdomainname setegid seteuid setfsgid setfsuid setgid setgroups sethostid sethostname setitimer setpgid setpgrp setpriority setregid setresgid setresuid setreuid setrlimit set_robust_list setsid setsockopt set_thread_area set_tid_address settimeofday setuid setup sgetmask shmat shmctl shmdt shmget shmop shutdown sigaction sigaltstack signal sigpending sigprocmask sigqueue sigreturn sigsuspend sigtimedwait sigwaitinfo socketcall socket socketpair splice spu_create spufs spu_run ssetmask statfs64 statfs stat statvfs stime stty swapcontext swapoff swapon symlinkat symlink sync_file_range sync _syscall syscall syscalls _sysctl sysctl sysfs sysinfo syslog tee tgkill time timer_create timer_delete timer_getoverrun timer_gettime timer_settime times tkill truncate tux umask umount2 umount uname undocumented unimplemented unlinkat unlink unshare uselib ustat utime utimes vfork vhangup vm86 vm86old vmsplice vserver wait3 wait4 wait waitid waitpid write writev Advertisements Print Page Previous Next Advertisements ”;
Unix / Linux – Loop Control
Unix / Linux – Shell Loop Control ”; Previous Next In this chapter, we will discuss shell loop control in Unix. So far you have looked at creating loops and working with loops to accomplish different tasks. Sometimes you need to stop a loop or skip iterations of the loop. In this chapter, we will learn following two statements that are used to control shell loops− The break statement The continue statement The infinite Loop All the loops have a limited life and they come out once the condition is false or true depending on the loop. A loop may continue forever if the required condition is not met. A loop that executes forever without terminating executes for an infinite number of times. For this reason, such loops are called infinite loops. Example Here is a simple example that uses the while loop to display the numbers zero to nine − #!/bin/sh a=10 until [ $a -lt 10 ] do echo $a a=`expr $a + 1` done This loop continues forever because a is always greater than or equal to 10 and it is never less than 10. The break Statement The break statement is used to terminate the execution of the entire loop, after completing the execution of all of the lines of code up to the break statement. It then steps down to the code following the end of the loop. Syntax The following break statement is used to come out of a loop − break The break command can also be used to exit from a nested loop using this format − break n Here n specifies the nth enclosing loop to the exit from. Example Here is a simple example which shows that loop terminates as soon as a becomes 5 − #!/bin/sh a=0 while [ $a -lt 10 ] do echo $a if [ $a -eq 5 ] then break fi a=`expr $a + 1` done Upon execution, you will receive the following result − 0 1 2 3 4 5 Here is a simple example of nested for loop. This script breaks out of both loops if var1 equals 2 and var2 equals 0 − Live Demo #!/bin/sh for var1 in 1 2 3 do for var2 in 0 5 do if [ $var1 -eq 2 -a $var2 -eq 0 ] then break 2 else echo “$var1 $var2″ fi done done Upon execution, you will receive the following result. In the inner loop, you have a break command with the argument 2. This indicates that if a condition is met you should break out of outer loop and ultimately from the inner loop as well. 1 0 1 5 The continue statement The continue statement is similar to the break command, except that it causes the current iteration of the loop to exit, rather than the entire loop. This statement is useful when an error has occurred but you want to try to execute the next iteration of the loop. Syntax continue Like with the break statement, an integer argument can be given to the continue command to skip commands from nested loops. continue n Here n specifies the nth enclosing loop to continue from. Example The following loop makes use of the continue statement which returns from the continue statement and starts processing the next statement − Live Demo #!/bin/sh NUMS=”1 2 3 4 5 6 7” for NUM in $NUMS do Q=`expr $NUM % 2` if [ $Q -eq 0 ] then echo “Number is an even number!!” continue fi echo “Found odd number” done Upon execution, you will receive the following result − Found odd number Number is an even number!! Found odd number Number is an even number!! Found odd number Number is an even number!! Found odd number Print Page Previous Next Advertisements ”;
Unix / Linux – Shell Functions ”; Previous Next In this chapter, we will discuss in detail about the shell functions. Functions enable you to break down the overall functionality of a script into smaller, logical subsections, which can then be called upon to perform their individual tasks when needed. Using functions to perform repetitive tasks is an excellent way to create code reuse. This is an important part of modern object-oriented programming principles. Shell functions are similar to subroutines, procedures, and functions in other programming languages. Creating Functions To declare a function, simply use the following syntax − function_name () { list of commands } The name of your function is function_name, and that”s what you will use to call it from elsewhere in your scripts. The function name must be followed by parentheses, followed by a list of commands enclosed within braces. Example Following example shows the use of function − Live Demo #!/bin/sh # Define your function here Hello () { echo “Hello World” } # Invoke your function Hello Upon execution, you will receive the following output − $./test.sh Hello World Pass Parameters to a Function You can define a function that will accept parameters while calling the function. These parameters would be represented by $1, $2 and so on. Following is an example where we pass two parameters Zara and Ali and then we capture and print these parameters in the function. Live Demo #!/bin/sh # Define your function here Hello () { echo “Hello World $1 $2” } # Invoke your function Hello Zara Ali Upon execution, you will receive the following result − $./test.sh Hello World Zara Ali Returning Values from Functions If you execute an exit command from inside a function, its effect is not only to terminate execution of the function but also of the shell program that called the function. If you instead want to just terminate execution of the function, then there is way to come out of a defined function. Based on the situation you can return any value from your function using the return command whose syntax is as follows − return code Here code can be anything you choose here, but obviously you should choose something that is meaningful or useful in the context of your script as a whole. Example Following function returns a value 10 − Live Demo #!/bin/sh # Define your function here Hello () { echo “Hello World $1 $2” return 10 } # Invoke your function Hello Zara Ali # Capture value returnd by last command ret=$? echo “Return value is $ret” Upon execution, you will receive the following result − $./test.sh Hello World Zara Ali Return value is 10 Nested Functions One of the more interesting features of functions is that they can call themselves and also other functions. A function that calls itself is known as a recursive function. Following example demonstrates nesting of two functions − Live Demo #!/bin/sh # Calling one function from another number_one () { echo “This is the first function speaking…” number_two } number_two () { echo “This is now the second function speaking…” } # Calling function one. number_one Upon execution, you will receive the following result − This is the first function speaking… This is now the second function speaking… Function Call from Prompt You can put definitions for commonly used functions inside your .profile. These definitions will be available whenever you log in and you can use them at the command prompt. Alternatively, you can group the definitions in a file, say test.sh, and then execute the file in the current shell by typing − $. test.sh This has the effect of causing functions defined inside test.sh to be read and defined to the current shell as follows − $ number_one This is the first function speaking… This is now the second function speaking… $ To remove the definition of a function from the shell, use the unset command with the .f option. This command is also used to remove the definition of a variable to the shell. $ unset -f function_name Print Page Previous Next Advertisements ”;
Unix / Linux – Shell Substitution ”; Previous Next What is Substitution? The shell performs substitution when it encounters an expression that contains one or more special characters. Example Here, the printing value of the variable is substituted by its value. Same time, “n” is substituted by a new line − Live Demo #!/bin/sh a=10 echo -e “Value of a is $a n” You will receive the following result. Here the -e option enables the interpretation of backslash escapes. Value of a is 10 Following is the result without -e option − Value of a is 10n The following escape sequences which can be used in echo command − Sr.No. Escape & Description 1 \ backslash 2 a alert (BEL) 3 b backspace 4 c suppress trailing newline 5 f form feed 6 n new line 7 r carriage return 8 t horizontal tab 9 v vertical tab You can use the -E option to disable the interpretation of the backslash escapes (default). You can use the -n option to disable the insertion of a new line. Command Substitution Command substitution is the mechanism by which the shell performs a given set of commands and then substitutes their output in the place of the commands. Syntax The command substitution is performed when a command is given as − `command` When performing the command substitution make sure that you use the backquote, not the single quote character. Example Command substitution is generally used to assign the output of a command to a variable. Each of the following examples demonstrates the command substitution − Live Demo #!/bin/sh DATE=`date` echo “Date is $DATE” USERS=`who | wc -l` echo “Logged in user are $USERS” UP=`date ; uptime` echo “Uptime is $UP” Upon execution, you will receive the following result − Date is Thu Jul 2 03:59:57 MST 2009 Logged in user are 1 Uptime is Thu Jul 2 03:59:57 MST 2009 03:59:57 up 20 days, 14:03, 1 user, load avg: 0.13, 0.07, 0.15 Variable Substitution Variable substitution enables the shell programmer to manipulate the value of a variable based on its state. Here is the following table for all the possible substitutions − Sr.No. Form & Description 1 ${var} Substitute the value of var. 2 ${var:-word} If var is null or unset, word is substituted for var. The value of var does not change. 3 ${var:=word} If var is null or unset, var is set to the value of word. 4 ${var:?message} If var is null or unset, message is printed to standard error. This checks that variables are set correctly. 5 ${var:+word} If var is set, word is substituted for var. The value of var does not change. Example Following is the example to show various states of the above substitution − Live Demo #!/bin/sh echo ${var:-“Variable is not set”} echo “1 – Value of var is ${var}” echo ${var:=”Variable is not set”} echo “2 – Value of var is ${var}” unset var echo ${var:+”This is default value”} echo “3 – Value of var is $var” var=”Prefix” echo ${var:+”This is default value”} echo “4 – Value of var is $var” echo ${var:?”Print this message”} echo “5 – Value of var is ${var}” Upon execution, you will receive the following result − Variable is not set 1 – Value of var is Variable is not set 2 – Value of var is Variable is not set 3 – Value of var is This is default value 4 – Value of var is Prefix Prefix 5 – Value of var is Prefix Print Page Previous Next Advertisements ”;
Unix / Linux – Shell Builtin Mathematical Functions ”; Previous Next The most of the part of this tutorial covered Bourne Shell but this page list down all the mathematical builti-in functions available in Korn Shell. The Korn shell provides access to the standard set of mathematical functions. They are called using C function call syntax. Sr.No. Function & Description 1 abs Absolute value 2 log Natural logarithm 3 acos Arc cosine 4 sin Sine 5 asin Arc sine 6 sinh Hyperbolic sine 7 cos Cosine 8 sqrt Square root 9 cosh Hyperbolic cosine 10 tan Tangent 11 exp Exponential function 12 tanh Hyperbolic tangent 13 int Integer part of floating-point number Print Page Previous Next Advertisements ”;
Unix / Linux – File Links
Linux – File Links ”; Previous Next What are File Links in Linux? Linux links provide a mechanism to create a shortcut or alternative name for an existing file or directory, which means you can create multiple names for the same file or directory in Linux to make their access and usage very easy based on your requirements. Linux/Unix provides two types of links: Soft links or Symbolic Links Hard Links Symbolic Links A symbolic in Linux is also called Soft Link or Symlink. This is a special file in Linux which points to another file or a directory. This original file or directory could be available on either the same file system or different file system. Symlink is like a shortcut in Windows which contains the path of the original file and not the contents. You can access original file data using any of the available Symbolic link on this file and removing the symlink does not affect the target file. But If you delete the original file, then all the Symbolic links on this file will be broken and your data will not be accessible any more. How to Create a Symbolic Link Following is the syntax to create a symbolic link on an existing file: $ ln -s file/directory symlink Here file or directory can be a full file path or directory and symlink will be the name of symbolic link which will point to the file or directory. To start with, lets create a simple file file.txt as follows: $ echo ”Hello, World!” > file.txt Now we can create a soft link on this file using the following command: $ ln -s file.txt soft-link $ ls -l total 4 -rw-r–r– 1 root root 14 May 1 20:11 file.txt lrwxrwxrwx 1 root root 8 May 1 20:11 soft-link -> file.txt Here notice the first character of permission string lrwxrwxrwx, it is l which means this file is a symbolic link. Now you can access the content of file file.txt using soft-link and update it”s content which will reflect in original file.txt. How to remove a Symbolic Link You can use either unlink or rm command to remove an existing symbolic link. As long as your are removing symbolic link, its not going to impact the original file but if you delete the original file, then it will create broken symbolic links available on that file. Following command will delete soft-link which we had create in previous section: $ unlink soft-link $ Finding Broken Symbolic Links You can use the following find command to find all the broken symbolic links: $ find /path/to/directory -xtype l This will list all broken symlinks in the /path/to/directory directory. You can use -delete option to delete the found broken links $ find /path/to/directory -xtype l -delete Hard Links Hard links are also shortcuts to files but a hard link cannot be created for a folder or file available on a different file system. Hard link is a mirror copy of the original file. Deleting the original file will not impact anything, because the hard link file, will act as a mirror copy of the original file. How to Create a Hard Link Following is the syntax to create a hard link on an existing file: $ ln filepath hardlink Here filepath can be a full file path of the original file and hardlink will be the name of hard link which will point to the file. Let’s create a hard link on file.txt file using the following command: $ ln file.txt hard-link $ ls -li total 8 72744984 -rw-r–r– 2 root root 14 May 1 20:11 file.txt 72744984 -rw-r–r– 2 root root 14 May 1 20:11 hard-link Here notice the inode number 72744984 which is same for both the files. Number after permission string is 2 which means, there are two copies of the same file. If you will create one more hard link on this file file.txt, then this number will become 3. Now you can access the content of file file.txt using hard-link and update its content which will reflect in file.txt. How to remove a Hard Link You can use either unlink or rm command to remove an existing hard link. Removing hard link or original link will not impact another file because hard link creates a mirror copy of the original file. Following command will delete soft-link which we had create in previous section: $ unlink hard-link $ ls -li total 4 72744984 -rw-r–r– 1 root root 14 May 1 20:11 file.txt Symbolic Links Vs Hard Links The two types of Linux filesystem links are hard and soft. The difference between these two types of links is significant which we have listed down here: Symbolic links can be created on directories as well as files where as hard links can be created only on files and not on directories. Symbolic links can be created on files or directories even if they are available on difference file systems where as hard links can be created on the same file system. Symbolic links don”t inherit the original permissions from the original file. That means any permission changes made in the original file aren”t reflected in the symbolic link. Files that are hard-linked together share the same inode number. When changes are made to one file, the other reflects those changes and the permissions, link count, ownership, timestamps. Though file content remain the exact same across all the linked files in both the cases. Symbolic links are very small in size because they are just pointer to the original content and not being a mirror of the original file, its size is only the number of bytes necessary to compose the name of the file or directory. Where as hard links consume more space because they create a mirror copy of the original file. Print Page Previous Next Advertisements ”;
Unix / Linux – Commands List
Linux Commands Reference [a] [b] [c] [d] [e] [f] [g] [h] [i] [j] [k] [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] [x] [y] [z] accept accton acpid addftinfo addpart addr2line adduser agetty alias alternatives amtu anacron animate anvil apachectl apm apmd apmsleep appletviewer apropos apt ar arbitron arch arp arping as aspell at atd atq atrm atrun attr audispd auditctl auditd aulast aulastlog aureport ausearch ausyscall authconfig autoconf autofs automount autoreconf autoscan autoupdate autrace avcstat avctrl awk badblocks base64 basename bash bashbug batch bc bccmd bg bind bison blkid blockdev bmp2tiff booleans bounce break builtin builtins bunzip2 bzcat bzcmp bzdiff bzgrep bzip2 bzless bzmore c++filt cal callback cancel cat cd chage chat chattr chcat chcon checkmodule checkpolicy chfn chgrp chkconfig chmod chown chpasswd chroot chrt chsh chvt ciphers ciptool cjpeg cksum cleanlinks cleanup clear clockdiff clusterdb cmp col colcrt colrm column combinediff comm command compare compgen compile_et complete composite conjure conman conmand continue convert convertquota cp cpan cpio cpp cpuspeed crash createdb createlang createuser cron crond crontab cryptsetup csh csplit ctags cupsctl cupsd curl cut cvs cvsbug cyradm cytune date dc dd deallocvt debugfs declare defer deliver delpart depmod df dfutool dgst diff diffstat dig dir dircolors dirname dirs discard disown display distcache djpeg dmesg dmidecode dmraid dmsetup dnsdomainname dnsmasq doexec domainname dos2unix dosfsck doxygen doxytag dprofpp dropdb droplang dropuser dsa dsaparam du dump dund dvipdf ec echo ecparam ed editdiff edquota egrep eject elinks emacs enable enc env envsubst eqn error errstr esd esdcat esdctl esddsp esdfilt esdloop esdmon esdplay esdrec esdsample espdiff etags ethtool eval eventlogadm ex exec execstack exit expand export exportfs expr extcheck factor faillog false fancontrol fastjar fax2ps fax2tiff fbset fc fdformat fdisk fetchmail fg fgconsole fgrep file filefrag filterdiff find find2perl findchip findfs findsmb finger fixcvsdiff fixfiles flipdiff flock floppy flush fmt fold font2c fonttosfnt formail free fsadm fsck ftp fud funzip fuser g++ gawk gcc gccmakedep gcj gcjh gcov gctags gdb gdbserver gdbtui gendiff gendsa genhomedircon genhostid genrsa geqn getenforce getent getfacl getfattr getkey getkeycodes getopt getopts getsebool gettext gfdl ghostscript gif2tiff gij gindxbib gjnih glookbib gnroff gpasswd gpg gpg.ru gpgv gpic gpm gprof grefer grep grepdiff grepjar grmic grmiregistry grn grodvi groff groffer grohtml grolbp grolj4 grops grotty groupadd groupdel groupmod groups grpck grpconv grpunconv grub grubby gs gtroff gunzip gzexe gzip hald halt hash hcid hcitool hdparm head help hexdump history host hostid hostname htdbm htdigest htpasswd httpd hwclock icclink iconv id identify idmapd ifconfig ifnames ifrename igawk imake imapd import imtest indxbib info infocmp infokey infotocap init initdb initlog innochecksum insmod install installsieve instmodsh interdiff intro ionice ip ip6tables ipcalc ipcclean ipcrm ipcs iptables-restore iptables-save iptables iptstate ipurge irattach irdadump irdaping irnetd irpsion5 irqbalance isadump isaset isosize jade jarsigner java javac javadoc javah javap javaws jconsole jdb jinfo jmap jobs join jpegicc jpegtran jps jsadebugd jstack jstat jstatd jwhois kbd_mode kbdrate keytool kill killall kinit klist klogd kpartx ksh ktab kudzu last lastb lastcomm lastlog lchage lchfn lchsh ld ldconfig ldd less lessecho lesskey let lftp lftpget libnetcfg lid link links lkbib lmtp lmtpd lmtptest ln lndir lnewusers loadkeys loadunimap local locale localedef locate lockd lockfile logger login logname logout logresolve logrotate logsave logwatch look lookbib losetup lp lpadmin lpasswd lpc lpinfo lpmove lpoptions lppasswd lpq-cups lpq lpr lprm lpstat ls lsattr lsdiff lshal lsmod lsof lspci lspcmcia lsusb ltrace lwresd m4 mac2unix mail mailq make makedepend makeg makestrs makewhatis man man2html manpath map mapscrn master matchpathcon mattrib mbadblocks mbchk mbexamine mbpath mcat mcd mclasserase mcookie mcopy md5sum mdadm mdassemble mdeltree mdir mdmpd mdu mergelib mesg mev mformat mgetty minfo mingetty mkbootdisk mkdir mkdirhier mkdosfs mke2fs mkfifo mkfontdir mkfontscale mkfs.ext2 mkfs.ext3 mkfs mkhtmlindex mkinitrd mklost+found mkmanifest mkmapfile mknod mkswap mktemp mlabel mmd mmount mmove modinfo modprobe mogrify montage more mount mountd mountpoint mpartition mrd mren msgattrib msgcat msgcmp msgcomm msgconv msgen msgexec msgfilter msgfmt msggrep msginit msgmerge msgunfmt msguniq mshowfat msql2mysql mtools mtoolstest mtr mtype multipath multipathd mupdatetest mutt mv mysql mysqlaccess mysqladmin mysqlbinlog mysqlbug mysqlcheck mysqld mysqld_multi mysqld_safe mysqldump mysqldumpslow mysqlhotcopy mysqlimport mysqlman mysqlmanager mysqlshow mysqlslap mysqltest mzip named namei nameif nano nash nc neqn net netplugd netreport netstat newaliases newgrp newusers nfsd nfsstat ngettext nhfsgraph nhfsnums nhfsrun nhfsstone nice nm nmbd nmblookup nntpd nntptest nohup nologin notifyd nroff nscd nseq nsgmls nslookup nsupdate ntlm_auth ntpd ntpdate ntpdc ntpq ntpstat ntptime ntptrace ntsysv numactl objcopy objdump ocsp od oddjobd onsgmls openjade openssl openvt oqmgr orbd osgmlnorm ospam ospcat ospent ownership pand paps parted partprobe partx passwd paste patch pathchk pax pccardctl pcregrep pcretest pcscd pdbedit pdf2dsc pdf2ps pdffonts pdfimages pdfinfo pdfopt pdftohtml pdftops pdftotext perror pf2afm pfbtopfa pfbtops pftp pgawk pgrep php-config php phpize pic pic2graph pickup piconv pidof pinfo ping ping6 pinky pipe pkg-config pkill plipconfig pluginviewer pman pmap pod2html pod2latex pod2man pod2text pod2usage podchecker podselect policytool pop3d pop3test popd portmap postalias postcat postconf postdrop postfix postgres postkick postlock postlog postmap postmaster postqueue postsuper poweroff ppm2tiff pppd pppdump pppoe pppstats pr prelink printafm printenv printf procmail profiles protoize prove proxymap ps psed psql pstack pstree pstruct ptar ptardiff ptx pushd pvchange pvck pvcreate pvdisplay pvmove pvremove pvresize pvs pvscan pwck pwconv pwd pwdx pwmconfig pwunconv python qmgr qmqpd qshape quota quotacheck quotaon quotastats racoon racoonctl ramsize ranlib ras2tiff raw raw2tiff rawdevices rcp rdate rdev rdisc rdist rdjpgcom rdump read readelf readlink readonly readprofile reboot reconstruct recountdiff red rediff refer reindexdb reject rename renice replace repquota req reset resize2fs resizecons resolveip restore restorecon restorecond return rev revpath rexec rfcomm rgb2ycbcr rlogin rm rmdir rmid rmmod rmnews rmt rnano rootflags rotatelogs route rpcclient rpcdebug rpcgen rpcinfo rsa rsautl rsh rsvg rsync ruby runcon runlevel runuser rvi rview rvim safe_mysqld saslauthd scache scp script sdiff sdpd sdptool sechecker secon sed sediff seinfo selinux selinuxenabled semanage sensors seq serialver servertool service sesearch sestatus set setarch setenforce setfacl setfattr setfiles setfont setkey setkeycodes setleds setmetamode setpci setquota setsebool setserial setsid setterm sfdisk sftp sg sgpio sh
Unix / Linux Questions and Answers ”; Previous Next Unix Questions and Answers has been designed with a special intention of helping students and professionals preparing for various Certification Exams and Job Interviews. This section provides a useful collection of sample Interview Questions and Multiple Choice Questions (MCQs) and their answers with appropriate explanations. Sr.No. Question/Answers Type 1 Unix Interview Questions This section provides a huge collection of Unix Interview Questions with their answers hidden in a box to challenge you to have a go at them before discovering the correct answer. 2 Unix Online Quiz This section provides a great collection of Unix Multiple Choice Questions (MCQs) on a single page along with their correct answers and explanation. If you select the right option, it turns green; else red. 3 Unix Online Test If you are preparing to appear for a Java and Unix Framework related certification exam, then this section is a must for you. This section simulates a real online test along with a given timer which challenges you to complete the test within a given time-frame. Finally you can check your overall test score and how you fared among millions of other candidates who attended this online test. 4 Unix Mock Test This section provides various mock tests that you can download at your local machine and solve offline. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself. Print Page Previous Next Advertisements ”;