- Home
- Interview Questions
- Linux File Manipulation
11.
What is the recommended size for the swap partition to be (minimum size) if you have 2GB RAM?
The SWAP partition minimum recommended size is RAM*2 and never less than 32MB, therefore for 2GB RAM you should have 4GB SWAP.
12.
How can you add special commands to run after the init process has been completed?
In order to add a command that will run after the system finish its initialization, you can add the command to /etc/rc.local.
13.
Explain the following statement:
ls -lhrS | grep -i $USER | tail -3 | awk '{ print $5, $9; }'
ls -lhrS | grep -i $USER | tail -3 | awk '{ print $5, $9; }'
a) List the files (Long list) + human read + reverse + order by size. b) Grep only lines matching my user name c) Get the 3 last results d) Manipulate the string and print the 5th and 9th parameters (size + file name)
14.
You want to set global environment and startup programs for all users, where can you set it?
The /etc/profile configuration file holds the global profile parameters and is inherited by the users on login, you can add your configuration there.
15.
In which configuration can you set the user prompt automatically to all bash users to look like [user@host][~]#?
You can set bash configuration for all the users in the /etc/bashrc configuration file.