Showing posts with label Unix. Show all posts
Showing posts with label Unix. Show all posts

Tuesday

Datastage DsAdmin Questions related to Unix

1. List the files in current directory sorted by size ? - ls -l | grep ^- | sort -nr
2. List the hidden files in current directory ? - ls -a1 | grep "^\."
3. Delete blank lines in a file ? - cat sample.txt | grep -v ‘^$’ > new_sample.txt
4. Search for a sample string in particular files ? - grep .Debug. *.confHere grep uses the string .Debug. to search in all files with extension..conf. under current directory.
5. Display the last newly appending lines of a file during appendingdata to the same file by some processes ? - tail .f Debug.logHere tail shows the newly appended data into Debug.log by some processes/user.
6. Display the Disk Usage of file sizes under each directory in currentDirectory ? - du -k * | sort .nr (or) du .k . | sort -nr
7. Change to a directory, which is having very long name ? - cd CDMA_3X_GEN*Here original directory name is . .CDMA_3X_GENERATION_DATA..
8. Display the all files recursively with path under current directory ? - find . -depth -print
9. Set the Display automatically for the current new user ? - export DISPLAY=`eval ‘who am i | cut -d"(" -f2 | cut -d")" -f1′`Here in above command, see single quote, double quote, grave ascent is used. Observe carefully.
10. Display the processes, which are running under yourusername ? - ps .aef | grep MaheshvjHere, Maheshvj is the username.
11. List some Hot Keys for bash shell ? - Ctrl+l . Clears the Screen. Ctrl+r . Does a search in previously given commands in shell. Ctrl+u - Clears the typing before the hotkey. Ctrl+a . Places cursor at the beginning of the command at shell. Ctrl+e . Places cursor at the end of the command at shell. Ctrl+d . Kills the shell. Ctrl+z . Places the currently running process into background.
12. Display the files in the directory by file size ? - ls .ltr | sort .nr .k 5
13. How to save man pages to a file ? - man | col .b > Example : man top | col .b > top_help.txt
14. How to know the date & time for . when script is executed ? - Add the following script line in shell script.eval echo "Script is executed at `date`" >> timeinfo.infHere, .timeinfo.inf. contains date & time details ie., when script is executed and history related to execution.
15. How do you find out drive statistics ? - iostat -E
16. Display disk usage in Kilobytes ? - du -k
17. Display top ten largest files/directories ? - du -sk * | sort -nr | head
18. How much space is used for users in kilobytes ? - quot -af
19. How to create null file ? - cat /dev/null > filename1
20. Access common commands quicker ? - ps -ef | grep -i $@
21. Display the page size of memory ? - pagesize -a
22. Display Ethernet Address arp table ? - arp -a
23. Display the no.of active established connections to localhost ? - netstat -a | grep EST
24. Display the state of interfaces used for TCP/IP traffice ? - netstat -i
25. Display the parent/child tree of a process ? - ptree Example: ptree 1267
26. Show the working directory of a process ? - pwdx Example: pwdx 1267
27. Display the processes current open files ? - pfiles Example: pfiles 1267
28. Display the inter-process communication facility status ? - ipcs
29. Display the top most process utilizing most CPU ? - top .b 1
30. Alternative for top command ? - prstat -a

Datastage Basic Commands to release jobs,Shutdown and retart Datastage client cmmands and basic Unix commands

1. What is the difference between root and non root install? 2. Have you created User groups and Users? $ group -c ourgroup $ group -m groupname userid $ group -o groupname userid $ group -O groupname userid # adduser --ingroup grname userid 3. How to kill the process? $ ps $kill -9/-1 PID 4. How to Unlock DataStage Jobs if the job is used by the another user or Hanged out? su - dsadm {enter your password for dsadm, else you can use root} cd `cat /.dshome` . ./dsenv bin/uvsh list.readu {find the row that shows your lock, look over to the USERNO column and get that number} UNLOCK USER nnnnn ALL QUIT 1. CD To $DSHOME/../Projects/ProjectName 2. Type the Following and press Enger. INSERT INTO VOC (F0, F1, F2, F3, F4, F5) VALUES ('UNLOCK','V', 'list_readu','E','BV','unlock') a. cd ${INSTALLATION_PATH}/DSEngine/bin b. ./dsenv c. ./uv –admin –stop 5. How to Add Unlock command to Vocabulary file(VOC)? CD To $DSHOME/../Projects/ProjectName INSERT INTO VOC (F0, F1, F2, F3, F4, F5) VALUES ('UNLOCK','V', 'list_readu','E','BV','unlock') 6. What is the command to Restart the DataStage Server? What is UV over there 7. Tell me some problems you may encounter when the DataStage running on UNIX platforms? 1. Running out of file units, 2. Running out of memory(Heap error), 3. open connection, 4. ODBC connection problems. 8. What is Heap Error? Anything to do with "heap" is about allocation of memory resources. Either install more memory in your server(s), or reduce overall demand for memory, perhaps by running less no. of jobs simultaneously, or by running on a configuration with less no. of processing nodes. 9. What happens when you shut down the Datastage server without closing all client connections? There may be an open connection from a Datastage client, Without shutting down the client processes, sockets are released on most platforms after the timeout period of about 6 - 10 minutes, depending on system tuning. 10. Which command is used to know whether the datastage server is running or not? ps –ef | grep dsrpc (this process should not be running when DataStage has stopped successfully) OR #netstat | grep dsrpcd 11. How do you restart the failure job in sequencer using Administrator or Director? Sequence(Add check points on failure) 1. What does the pkgadd command do? 2. How do you create a solaris package? 3. How do you view shared memory statistics? 4. How do you get system diagnostics information? 5. What is OBP and how do you access it? 6. What is LOM and how do you access it? 7. What is VTS? 8. What is an alternative to the “top” command on Solaris? 9. What is /etc/system for? 10. What does ndd do? 11. What does init 5 do? 12. What does init 0 do? 13. How do you boot from CD-ROM? 14. What is jumpstart? 15. How do you boot from a Network with jumpstart? 16. What is JASS? 17. What is the difference between NFS version 2 and NFS version 3? 18. What is RPC? Why do I need it? 19. Are kernel parameters tunable during runtime? 20. What does fmthard do? 21. Job Scheduling; mainly crontab, at, batch command 22. Backup stetegy; incremental, full system back up; diff between tar & ufsdump 23. diff between hard link & softlink 24. How to list only the directories inside a directory (Ans. ls -l|grep "^d") 25. RAID levels; pros & cons of diffrent levels; what is RAID 1+0 26. How to recover a system whose root password has lost? 27. What is a daemon? 28. How to put a job in background & bring it to foreground? 29. What is default permissions for others in a file? 30. Questions on shell initialization scripts? 31. Questions on restricted shell 32. What is diff betwn grep & find? 33. What is egrep? 34. Questions on shell programming 35. What is a pipe? 36. Questions on Solaris patch management like pkgadd etc 37. Questions on file system creation; actually what happens when we create a file system? 38. Questions on RBAC? what is a role accound & what is a profile? 39.From command line how will you add a user account? the full command will all arguments. 40.Fs it advisable to put a swap partion in RAID1 (mirroring?) pros & cons? 41. List the files in current directory sorted by size ? - ls -l | grep ^- | sort -nr 42. List the hidden files in current directory ? - ls -a1 | grep "^\." 43. Delete blank lines in a file ? - cat sample.txt | grep -v ‘^$’ > new_sample.txt 44. Search for a sample string in particular files ? - grep .Debug. *.confHere grep uses the string .Debug. to search in all files with extension..conf. under current directory. 45. Display the last newly appending lines of a file during appendingdata to the same file by some processes ? - tail .f Debug.logHere tail shows the newly appended data into Debug.log by some processes/user. 46. Display the Disk Usage of file sizes under each directory in currentDirectory ? - du -k * | sort .nr (or) du .k . | sort -nr 47. Change to a directory, which is having very long name ? - cd CDMA_3X_GEN*Here original directory name is . .CDMA_3X_GENERATION_DATA.. 48. Display the all files recursively with path under current directory ? - find . -depth -print 49. Set the Display automatically for the current new user ? - export DISPLAY=`eval ‘who am i | cut -d"(" -f2 | cut -d")" -f1′`Here in above command, see single quote, double quote, grave ascent is used. Observe carefully. 50. Display the processes, which are running under yourusername ? - ps .aef | grep MaheshvjHere, Maheshvj is the username. 51. List some Hot Keys for bash shell ? - Ctrl+l . Clears the Screen. Ctrl+r . Does a search in previously given commands in shell. Ctrl+u - Clears the typing before the hotkey. Ctrl+a . Places cursor at the beginning of the command at shell. Ctrl+e . Places cursor at the end of the command at shell. Ctrl+d . Kills the shell. Ctrl+z . Places the currently running process into background. 52. Display the files in the directory by file size ? - ls .ltr | sort .nr .k 5 53. How to save man pages to a file ? - man | col .b > Example : man top | col .b > top_help.txt 54. How to know the date & time for . when script is executed ? - Add the following script line in shell script.eval echo "Script is executed at `date`" >> timeinfo.infHere, .timeinfo.inf. contains date & time details ie., when script is executed and history related to execution. 55. How do you find out drive statistics ? - iostat -E 56. Display disk usage in Kilobytes ? - du -k 57. Display top ten largest files/directories ? - du -sk * | sort -nr | head 58. How much space is used for users in kilobytes ? - quot -af 59. How to create null file ? - cat /dev/null > filename1 60. Access common commands quicker ? - ps -ef | grep -i $@ 61. Display the page size of memory ? - pagesize -a 62. Display Ethernet Address arp table ? - arp -a 63. Display the no.of active established connections to localhost ? - netstat -a | grep EST 64. Display the state of interfaces used for TCP/IP traffice ? - netstat -i 65. Display the parent/child tree of a process ? - ptree Example: ptree 1267 66. Show the working directory of a process ? - pwdx Example: pwdx 110 67. Display the processes current open files ? - pfiles Example: pfiles 1267 68. Display the inter-process communication facility status ? - ipcs 69. Display the top most process utilizing most CPU ? - top .b 1 70. Alternative for top command ? - prstat -a

Wednesday

Important System Directories in Sun Solaris 9

The Solaris OE consists of a hierarchy of critical system directories and files that are necessary for the operating system to function properly. The following is a list of some of the critical system directories and subdirectories that are found in the Solaris OE.

  • / The root of the overall file system namespace.
  • /bin A symbolic link to the /usr/bin directory. It is the directory location for the binary files of standard system commands.
  • /dev The primary directory for logical device names. The contents of this directory are symbolic links that point to device files in the /devices directory.
  • /devices The primary directory for physical device names.
  • /etc The directory that holds host-specific configuration files and databases for system administration.
  • /export The default directory for commonly shared file systems,such as users’ home directories, application software, or other shared file systems.
  • /home The default directory or mount point for a user’s home directory.
  • /kernel The directory of platform-independent loadable kernel modules that are required as part of the boot process.
  • /mnt A convenient, temporary mount point for file systems.
  • /opt The default directory or mount point for add-on application packages.
  • /platform The directory of platform-dependent loadable kernel modules.
  • /sbin The single-user bin directory that contains essential executables that are used during the booting process and in manual system-failure recovery.
  • /tmp The directory for temporary files. This directory is cleared during the boot sequence.
  • /usr The directory that contains programs, scripts, and libraries that are used by all system users. The directory name is an acronym for UNIX® system resources.
  • /var The directory for varying files, which usually includes temporary, logging, or status files.
    Primary Subdirectories Under the /dev Directory
    Subdirectoryies and their Description
  • /dev/cua Dial-out device files for UNIX-to-UNIX Copy Protocol (UUCP) and Point-to-Point Protocol(PPP)
  • /dev/dsk Block disk devices
  • /dev/fbs Frame buffer device files
  • /dev/fd File descriptors
  • /dev/md Logical volume management metadisk devices
  • /dev/pts Pseudo terminal devices
  • /dev/rdsk Raw disk devices
  • /dev/rmt Raw magnetic tape devices
  • /dev/sound Audio device and audio-device control files
  • /dev/term Serial devices
    Primary Subdirectories Under the /etc Directory
    Subdirectoryies and their Description
  • /etc/acct Configuration information for the accounting system
  • /etc/cron.d Configuration information for the cron utility
  • /etc/default Default information for various programs
  • /etc/inet Configuration files for network services
  • /etc/init.d Scripts for starting and stopping services, used while changing between run levels
  • /etc/lib Dynamic linking libraries needed when the
  • /usr file system is not available
  • /etc/lp Configuration information for the printer subsystem
  • /etc/mail Configuration information for the mail subsystem
  • /etc/nfs Configuration file for NFS server logging
  • /etc/opt Configuration information for optional packages
  • /etc/rc#.d Scripts that are when entering or leaving a specific run level
  • /etc/skel Default shell initialization files for new user accounts
    Primary Subdirectories Under the /usr Directory
    Subdirectories and their Description
  • /usr/bin Standard system commands
  • /usr/ccs C-compilation programs and libraries
  • /usr/demo Demonstration programs and data
  • /usr/dt Directory or mount point for Common Desktop Environment (CDE) software
  • /usr/include Header files (for C programs, and so on)
  • /usr/java Directories that contain Java technology programs and libraries
  • /usr/kernel Platform-independent loadable kernel modules that are not generally required during the boot process
  • /usr/lib Architecture-dependent databases, various program libraries, and binaries that are not invoked directly by the user
  • /usr/opt Configuration information for optional packages
  • /usr/sbin System administration commands
  • /usr/spool Symbolic link to the /var/spool directory
  • Friday

    Some Useful Unix Commands

    To Create symbolic Link between files or directories: ---------------------------------------------------------- A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file. It simply points to another entry somewhere in the file system. This difference gives symbolic links certain qualities that hard links do not have, such as the ability to link to directories, or to files on remote computers networked through NFS. Also, when you delete a target file, symbolic links to that file become unusable, whereas hard links preserve the contents of the file. To create a symbolic link in Unix, at the Unix prompt, enter the following command: ln -s source_file myfile Replace source_file with the name of the existing file for which you want to create the symbolic link (this file can be any existing file or directory across the file systems). Replace myfile with the name of the symbolic link. The ln command then creates the symbolic link. After you've made the symbolic link, you can perform an operation on or execute myfile, just as you could with the source_file. You can use normal file management commands (e.g., cp, rm) on the symbolic link. Note: If you delete the source file or move it to a different location, your symbolic file will not function properly. You should either delete or move it. If you try to use it for other purposes (e.g., if you try to edit or execute it), the system will send a "file nonexistent" message. To find out more about symbolic links, you can view the man pages for the ln command. To do this, at the Unix prompt, enter the following command: man ln To find the current values of all my environment variables and functions? ----------------------------------------------------------------------------- To find the current values of all your environment variables and functions in Unix, if you are using the sh, ksh, or bash shell, at the prompt, enter: set If you are using the csh or tcsh shell, enter: printenv The resulting lists show all environment variables (e.g., home, shell) and functions, and their values, both default and user-defined. On most systems, entering setenv will display the same results as printenv. For more information about the printenv or set commands, at the Unix prompt, enter either of the following commands: man printenv man set To display information about the operating system: -------------------------------------------------- On most Unix systems, you can use the uname command to determine which Unix system (e.g., SunOS, AIX, IRIX, Linux, Darwin) is running on your computer. On most systems, to obtain additional information about the operating system, at the Unix prompt, enter: uname -a To find out what the uname -a command displays, and what additional options it supports, at the Unix prompt, enter: man uname