UNIX Basics Commands-1 1. $ login : `Logging in' 2. $ Ssh : Connect to another machine 3.

$ Logout : `Logging out' File Management Commands

by PenchalaRaju Yanamala

4. $ emacs : `Using the emacs text editor' 5. $ Mkdir : `Creating a directory' 6. $ Cd : `Changing your current working directory' 7. $ ls : `Finding out what files you have' 8. $ Cp : `Making a copy of a file' 9. $ Mv : `Changing the name of a file' 10. $ rm : remove a file 11. $ cmp : Comparing two files 12. $ wc : Word, line, and character count 13. $ Compress : Compress a file. Communication Commands 14. $ e-mail 15. $ Talk 16. $ Write 17. $ Sftp : `Sending and receiving electronic mail' : Talk to another user : Write messages to another user : Secure file transfer protocol

Information Commands 18. $. Man : Manual pages 19. $ quota –v : Finding out your available disk space quota 20. $ Cal : `Using the Ical personal organizer' 21. $ Finger : Getting information about a user 22. $ passwd : Changing your password 23. $ who : Finding out who's logged on. Printing Commands 24. $ lpr : `Printing'. 25. $ lprm : Removing a print job. 26. $ lpq : Checking the print queues. Job control Commands 27. $ ps : `Finding your processes' 28. $ Kill : `Killing a process' 29. $ Nohup : Continuing a job after logout 30. $ Nice : Changing the priority of a job 31. $ Cntrl-z : Suspending a process 32. $ fg ------- : `Resuming a suspended process' 33. $ Next-----: Selecting a Unix shell

34. $ cat ------- for creating and displaying short files 35. $ date ----- display date 36. $ echo ---- echo argument 37. $ ftp ------- connect to a remote machine to download or upload files 37. $ grep ----- search for a string in a file UNIX Basics Commands-2 38. $ head ---- display first part of file 39. $ ls -------- see what files you have 40. $ lpr ------- standard print command (see also print ) 41. $ more --- use to read files 42. $ mkdir --- create directory 43. $ mv ------ for moving and renaming files 44. $ ncftp ---- especially good for downloading files via anonymous ftp. 45. $ rmdir ---- remove directory 46. $ rsh ------- remote shell 47. $ setenv --- set an environment variable 48. $ sort ------ sort file 49. $ tail --- ---display last part of file 50. $ tar ------- create an archive, add or extract files 51. $ telnet --- log in to another machine 52. $ wc ------ count characters, words, lines 53. $ logout ------------------- logs off system 54. $ man (co------------------- mmand) ------shows help on a specific command 55. $ talk (user)--------------- pages user for chat - (user) is a email address 56. $ write (user) ------------ write a user on the local system (control-c to end) 57. $ pico (filename)-------- easy to use text editor to edit files 58. $ pine---------------------- easy to use mailer 59. $ more (file) ------------- views a file, pausing every screenful 60. $ sz ------------------------send a file (to you) using zmodem 61. $ rz ------------------------ recieve a file (to the unix system) using zmodem 62. $ telnet (host) ------------ connect to another Internet site 63. $ archie (filename)------ search the Archie database for a file on a FTP site 64. $ irc ------------------------ connect to Internet Relay Chat 65. $ lynx ---------------------a textual World Wide Web browser 66. $ gopher .................. a Gopher database browser 67. $ tin, trn .................... read Usenet newsgroups 68. $ passwd ................ change your password 69. $ chfn ..................... change your "Real Name" as seen on finger 70. $ chsh .................... change the shell you log into 71. $ finger ……………..shows more information about a user 77. $ chmod ................. changes permissions on a file 78. $ bc ....................... a simple calculator 79. $ make .................. compiles source code Real Time Questions on UNIX related to Informatica

1. What is the use of ls -l command & what is the information it gives about user? A: - $ ls -l given the sorted file in long listing format. it gives the information such as type(file/directory), permissions. Given to file, links, owner, group user detail, date & time of modification etc. 2. What is an Environment Variable? A: - Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.

UNIX Basics Commands-3 3. Write a grep command that selects the lines from a file that have exactly three characters? A: - $ grep ^...$ <filename> 4. The rm command removes links to file. What does this mean? How then is a file deleted from the file system? A: - rm never delete the link. Only file get removed from index. So it will not come when you will use ls command. 5. How to change a normal file into hidden file A: - my filename .filename. 6. What is "type" command in UNIX? What is the functionality?? A: - type [-aftpP] name [name ...] with no options, indicate how each name would be interpreted if used as a command name. 7. How to find largest file? A:-In the Directory Give....ls –ls|sort -nr| head -1that gives the largest file statistics... 8. How do you find which version and name of UNIX you are using at the command prompt? A:-Your name -a in HP-UX name -s operating system name -r release of the version

9. What is the command to change a file's creation time? Means one file is created at the time 15:19 then time should br changed to 14:14?

A:-use touch command to change the date 10. What will be the output of ls ~/...? A:-it will list the contents of home directory 11. Give the command to display space usage on the UNIX file system? A:- df -k . 12. What is use of sed command? A:- sed is a stream editor for editing files from a script or from the command line 13. How to remotely move a file? That means how to move a file one machine to another machine? A:- By ftp UNIX Basics Commands-4 14. How to setup Disk space as well as memory in solaris10? A:- 1-BY using format command we can find the status of hard disk format 2-For knowing the memory status #prtconf grep Mem 15. Why we are using UNIX OS when we are doing the testing in our application? A:- Security, Multitasking and backup etc.. 16. What is FIND, GREP and SED? Could you please give me the difference between all the three? Where we use these commands? A:- FIND & GREP Basically FIND & GREP are the UNIX commands shared through the FILTERS .Where is SED (STREAM) is one of the main editor. FIND: Find is an exclusive command used to find files/folders are other information. And this is powerful then windows. Ex: # find /raja -name shekar –print output: raja/shekar

Grep: This is also one of the important command used to globally searching the regular expression in the file .GERP is gripping the information character by character.(i.e) from file .ex 1) : #GREP "cat" raja 2): #GREP -i "cat" raja (for case sensitive)

3): #GREP -v "cat" raja (v represent negative) OUTPUT: if we have a file raja with data regarding cat we can clearly explain. Finally SED (STREAM) 17. What is the use of the hidden files? A:- the use of hidden file is my file is not view any another to use only to show myself 18. How many types of file in UNIX? A:- total 7 files are there. 1. Regular file:(-):contains data in either text format orbinary format 2. Directory file:(d):contains entries of files 3. FIFO file:(f):2 communicate betn 2 processes running onsame system 4. Block special file:(b):name given 2 special blocks ofhard disk 5. Sybolic file:(l):its a link or pointer to alreadyexisting file. UNIX Basics Commands-5 6. Socket file:(s):2 communicate betn 2 processes running on different system in a network 7. Character special file:(c):handles only characted formatted data eg.stdin, stdout, stderr 19. How will u execute a file in unix? IMP A:- Depending on the type of shell you can execute a file in either of the ways 1) ksh <filename> 2) sh <filename> If the file already possess execute bit set on it, then you can directly execute the file with its name alone 1) <filename> Or

If the file doesn't have executable permissions than assign the same as chmod 755 <filename>. After that execute the same by using command. /<filename>. 20. How do you create a file in UNIX?

A:- $ cat >fruits.txt Apple, orange, grapes ^d (Press control+d) $ cat fruits.txt Apple,orange,grapes. or

Using touch & cat command. 21. Write a command to find all of the files which have been accessed within the last 30 days. A:- find / -type f -atime -30 > November.files & This command will find all the files under root, which is "/", with file type is file. "-atime -30" will give all the files accessed less than 30 days ago. And the output will put into a file call November.files. 22. which command is used to stop a running process in unix? A:- kill -9 pid its forcefully stop kill the curent process 23. What is file system in UNIX? A:- ufs file system.

Sign up to vote on this title
UsefulNot useful