Q1 How will you delete files that are older than 7 days in a remote unix server?
A1 By ssh ing to the remote host server
|
1 |
ssh user@host123 "find /etc/data/*.csv -mtime +7 -exec rm -f {} \;" >> myapp.log 2>&1 |
Q2 How will you copy files from a remote server to a local server?
A2 By scp ing (i.e. secured copying) to the remote host server
|
1 |
scp -q "user@host123:/etc/data/*.csv" "/tmp/local" >>myapp.log 2>&1 |
Q3 What commands do you use to verify connectivity to remote host, service, etc?
A3 ping, telnet, wget, etc.
|
1 2 3 4 |
$ping hostname $telnet hostname 25 #hostname and port number $wget http://www.myapp.com/downloads/script.txt |
Q4 How will execute a unix script on a remote Unix host?
A4 ssh
|
1 2 |
ssh ${l_cUnixUser}@${l_cUnixServer} "cd ${l_cUnixScriptPath} && ./${l_cUnixScript}" >>$LOGFILE 2>&1 |
Q5 How will you identify the ports that are already in use?
A5 netstat
|
1 2 |
$ netstat -a | grep 444 |