- How many arguments shell script can take
Ans: execute "getconf ARG_MAX" the output will tell you how many argument shellscript can take. - How do you capture variable in shell scriptAns: Using $1,$2 etc.
- What is difference between tomcat and jbossAns: Tomcat is a pure servlet engine, with no EJB. JBoss supports EJB and JMS related stuff. JBoss is a full J2EE application server.. it supports the bulk of the J2EE spec. It is more common to refer to J2EE as a more complete reference of what an application server can and should include, of which Tomcat only implements a part, while the complete download of JBoss (including Tomcat) conforms to the full J2EE specification, and hence is amore "complete" application server.
- What is difference between sh file-name and ./file-nameAns: ./ can be executed only if the file has execute permission
- What is the command to check the free portsAns: use “nmap”
- How do you reset password in mysqlAns: Start mysql with “mysql-safe –skip-grant-tables”
- What is the Default flag for "Kill"Ans: Default flag for kill is "TERM/-15"
- I create a user, the user logs in but can't create files in his dir. Why? The dir permissions are ok.Ans: check quota, check if disk is full
- df and du show different values, why ?Ans: http://sysunconfig.net/aixtips/df_du_diff_out.txt
- How to implement round-robin load-balancing in bind (dns) ?Ans: Add two A records for the same hosts with different IP and set TTL as zero for them.
- Write a shell script to generate a HTML.
- What is the difference between hard link and soft links ? Atleast 2 differences.Ans:1. About inode: In a hard link, inode nos will be same for both files, but will have different names. Soft link is a file which links to the original file (equivalent to shortcut in Windoze)2. About filesystem location: Hard links cannot reside on different partitions/filesystems (why? bcos same inode), soft links can point to files in any location.
- What are the types of files in Linux ? How do u know a file type ?Ans:d = directoryl = symbolic links = socketp = named pipe- = regular filec= character (unbuffered) device file specialb=block (buffered) device file special
- How to Replicate different databases to different slaves?Ans: either one of the following (Ref: http://www.databasejournal.com/features/mysql/article.php/10897_3355201_2)1. Do the following settings in master (my.cnf)binlog-ignore-db=testbinlog-ignore-db=scratchbinlog-do-db=catalogbinlog-do-db=usersbinlog-do-db=sessions2. Do the following settings in slave (my.cnf)replicate-do-db=catalogreplicate-ignore-db=testreplicate-ignore-db=scratchreplicate-do-db=testreplicate-do-db=sessions
- What is SOA in DNSAns: Statement Of Authority
- What is Exit code for Ctrl + CAns: 130
- What to do if i am getting error "passwd: Authentication token manipulation error" while updating the root passwordAns: chattr -i /etc/shadow
- What Could happen if /sys directory is not there?Ans: Your system might say "Couldnt open //dev/tty3" n/w wont be start. And system also gives error like "comp init: Id "c2" respawning too fast: disabled for 5 minutes"
- What to do if dh -h gives "df: cannot read table of mounted file systems: Is a directory"Ans: /etc/mtab is the file. check if there if something wrong with it. This error mostly come when /etc/mtab is the directory not the file. Delete the /etc/mtab and do "mount -a" this will resolve your issue.
- What is the difference between "/etc/bashrc" and "/etc/profile"Ans: The global /etc/profile and your own local ~/.bash_profile are read when the shell is invoked as an interactive login shell, for example when you open a remote terminal session to someone else's machine, or when you log into your own machine without X Windows running, or when you hit ctrl-alt-F1 from X Windows to start a virtual terminal session.The global /etc/bashrc (if it exists) and your own local ~/.bashrc is read when the shell is invoked as an interactive non-login shell, for example when you open up a terminal window in Gnome or KDE.
- How do I print the line in between 25 to 50 from abc.txt which is of 100 lines in it.Ans: tail -n +25 abc.txt | head -n 25
This blog is to share my experience about what I am learning, troubleshooting in my day-to-day life while working on Linux Servers.
Tuesday, March 3, 2009
Basic Interview Questions
Subscribe to:
Post Comments (Atom)
How you can Run the cronjob which run on 1st and 3rd Saturday OR how to write the cronjob which will run on every alternate saturday.
ReplyDeleteAns: put the below line in your crontab
0 1 1-7,15-21 6 /path/to/myscript
Here we are considering 1st saturday falling between 1 to 7 and 3rd saturday will fall between 15-21.
Cronjob which will run every 15 Seconds.
ReplyDeleteAns: You can't go below one minute granularity with cron. What you can do is, every minute, run a script that runs your job, waits 15 seconds and repeats.