Linux Interview Question - Answers
Linux Interview Question - Answers
$ ln -s myfile.txt my-soft-link
4.What is first line written in shell script?
What is the meaning of that? If I didn’t write
that line what will happen? Then how to run
the script?
#!/bin/bash – Execute the file using
the Bash shell.
#! Called shebang
The #! syntax used in scripts to indicate
an interpreter for execution under UNIX
or Linux operating systems
If not writen in file we need to execute
like below
/bin$ bash /home/madhu/test.sh
5. How to run a shell script in
background?
Execute a command in the background using &
$ ./my-shell-script.sh &
2. Execute a command in the background using
nohup
After you execute a command (or shell script) in
the background using &, if you logout from the
session, the command will get killed. To avoid that,
you should use nohup as shown below.
$ nohup ./my-shell-script.sh &
6. What is cron tab? Explain it? How
to configure the schedule a job?
crontab uses a daemon, crond, which runs
constantly in the background and
scheduled jobs need to be executed.
MIN HOUR DOM MOY DOW
* * * * *
0-59 0-23 1-31 1-12 0-6
/etc/init.d/iptables restart
8. How to trouble shoot the
remote server having some issue?
First will do ssh if it’s connected
Uptime
Top
Free
df
du
9. What is ping? Telnet? Curl? Wget?
Kill -9 <pid>
12. What is nice and renice?