find . –mtime -2 –exec wc –l {} \;
Linux Interview Questions
Tuesday, 27 October 2015
Write the syntax for “if” conditionals in linux?
Syntax
If condition is successful
then
execute commands
else
execute commands
fi
If condition is successful
then
execute commands
else
execute commands
fi
How will you find the total disk space used by a specific user?
du -s /home/user1 ….where user1 is the user for whom the total disk
space needs to be found.
space needs to be found.
How will you print the login names of all users on a system?
/etc/shadow file has all the users listed.
awk –F ‘:’ ‘{print $1} /etc/shadow’|uniq -u
awk –F ‘:’ ‘{print $1} /etc/shadow’|uniq -u
Subscribe to:
Posts (Atom)