|
1. List the files in the directory with their size
Ls –s or Ls –sh
2. What command would you use to check available disk space on all currently-mounted disk partitions?
Df –h
3. Command to list the size of the current directory
Du –sh
4. How do you set a file that even root can't delete [rm] the file?
You have to make the file immutable . chattr +I file name
5. How do you create directory and subdirectories when the parent directory may exist, in one command? In other words, create the following directory structure. /home/user/one/two. The command should work whether /home/user exists or not
Mkdir –p /home/user/one/two
6. How do you setup multiple IP address on one NIC
Ifconfig eth0:0 192.168.1.1 up
7. How to identify which package has installed the file /etc/passwd
rpm -qf /etc/passwd
8. How do u list all files installed by a package
Rpm –ql packagename
9. How to extract the contents of the file file.tar.gz
Tar –zxvf file.tar.gz
Or gunzip file.tar.gz && tar –xvf file.tar
10. How do u enable ip forwarding
Set net.ipv4.ip_forward=1 in file /etc/sysctl.conf and either run sysctl –p or restart the system to activate it
11. How do u lock and unlock a user account
Passwd –l and passwd –u
12. How do u enable the process httpd to start automatically in runlevel 3 and 5 when the system boots
Chkconfig –level 35 httpd on
13. what is /etc/skels directory
/etc/skels directory contains the files which will be copied to the users home directory when an user is created. Example is .bash_profile
14. How to add a directory to the path for all users.
Add the path in the file /etc/profile in the format
PATH=$PATH:/</path/to/directory>
15. Commands to change the ownership, group and permissions of a file
Chown, chgrp and chmod
16. What is umask and default umask of root
Umask defines the file permissions of a user. Umask of root is 0022
17. How do u execute a specific process at a specified time. Please specify the format
Min Hour day month weekday </path/to/command name>
Eg: 30 13 * * * /bin/backup.sh
18. How to specify the DNS server in Linux
/etc/resolv.conf
19. How to change the default runlevel to 3
Change it in /etc/inittab id:3:initdefault:
20. How to disable the key combination ALT + CTRL + DEL . How do u activate the change instantly.
By commenting the line #ca::ctrlaltdel:/sbin/shutdown -t3 -r now in the file /etc/inittab. We can activate it instantl by using command “init q�
21. How can I know the free ram and swap space
Free -m
22. Whats is the command to install grub
Grub-install /dev/had
23. How to boot into in Single user mode
Edit grub by pressing e and append a 1 to the end of second line . Press b to boot into single user mode
24. What is the port number associated with the ssh ?
22
25. What is the default port number of squid
3128
26. How to start the nfs installtion using a bootable cdrom.
When the cdrom boots up give linux askmethod. Then it will ask for the installtion method. Choose nfs installtion from it
27. How to install from a tar ball.
Tar –zxvf <packagename.tar.gz>
Cd packagename
./configure
make
make install
28. How to change the default shell of a user1 to /sbin/nologin
Usermod –s /sbin/nologn user1
29. Command to delete a user including his home directory
Userdel –r username
30. Command to list the quota status of a file system
Repquota /home
31. How to edit a quoat settings of user user1
Edquota user1
32. How to edit a quoat settings of group user1
Edquota –g user1
33. You have added a line to file /etc/fstab to mount /backup . How do u activate it instantly.
Mount –a
|