You are on page 1of 2

Unix 1. what is command to search a file ? find . -name "<file name>" -print 2.

what is the command for finding the string from the text file? grep "<string>" <file name> 3. what is cp and mv command ? Different between these two ? cp means copy mv means rename 4. what cat command will do ? read only view 5. What is wild characters ? The shell and some text processing programs will allow meta-characters, or wild cards, and replace them with pattern matches. For filenames these meta-character s and their uses are: ? match any single character at the indicated position * match any string of zero or more characters [abc...] match any of the enclosed characters [a-e] match any characters in the range a,b,c,d,e [!def] match any c haracters not one of the enclosed characters, sh only {abc,bcd,cde} match any se t of characters separated by comma (,) (no spaces), csh only ~ home directory of the current user, csh only ~user home directory of the specified user, csh only

6. what is the command for retrieving the set of characters from the given strin g/file ? cut 7. How to verify the file, whether it is empty or not ? wc <file name> 9. what are the commands change the mode of a file. chmod 10.what is the use of the 1 ) $$ process number of the current process 2 ) $# number of arguments on the command line 3 ) $! process number of the last command done in background 4 ) $?

exit value of the last command executed 5 ) $@ all arguments on the command line, each separately quoted ("$1" "$2" ... "$9") 11. what is magic file ? what is the use of that magic file? Example: go to /users/autofin/biswajit/oe command: file backup24092004.tar.gz return: backup24092004.tar.gz: gzip compressed data, was "backup24092004.tar", f rom Unix

This program, file, examines the selected file and tries to determine what type of file it is. It does this by reading the first few bytes of the file and compa ring them with the table in /etc/magic. It can determine ASCII text files, tar f ormatted files, compressed files, etc. Syntax file [options] [-m magic_file] [-f file_list] file Common Options -c check the m agic file for errors in format -f file_list file_list contains a list of files t o examine -h don t follow symbolic links (SVR4 only) -L follow symbolic links (BSD only) -m magic_file use magic_file as the magic file instead of /etc/magic 12. How to append the file? > 13. How to redirect the output of the file? >> or > 14. How to check the Process id? ps

You might also like