- Home
- Interview Questions
- Linux System Administrator
71.
Create a crontab that will run once a day at 3am and write the output of ls into /tmp/ls_result (truncate the file) ?
a) Edit crontab: crontab -e b) Add crontab line: 0 3 * * * /bin/ls > /tmp/ls_result c) Save crontab.
72.
How do you create a symbolic link between /bin/runme to the new file /bin/runmetoo?
You need to use the link tool "ln" in order to create links - ln -s /bin/runme /bin/runmetoo.
73.
How can you make the file untouchable.txt to be immutable (un-alterable) so it will not be able to be changed or deleted by
any user including root?
You can use attributes to change the file to be immutable using chattr +i untouchable.txt.
74.
How can you run a PHP statement from the command line without creating a file?
You can use the PHP interactive input - php -r 'echo "Hello World\r\n";'
75.
How can you find the usage time of all the users on the machine (individually)?
You can use the command ac in order to get login information about users - ac -p