Check how long server has been running
Answer:
Use the uptime command
$ uptime
22:36:10 up 12 min, 1 user, load average: 0.00, 0.04, 0.06
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Check how long server has been running
Answer:
Use the uptime command
$ uptime
22:36:10 up 12 min, 1 user, load average: 0.00, 0.04, 0.06
Increase the maximum number of open files / file descriptors
Answer:
If you are root, execute the command below
ulimit -SHn 65535
If you want to set it permanently, especially for a particular user, change the file /etc/security/limits.conf to have the following lines (assume user = www-data)
E.g.
www-data hard nofile 65535
www-data soft nofile 65535
And make sure uncomment pam_limits.so from the different files under /etc/pam.d, e.g. sudo, login, sshd, ...
Finally restart your system.
How to execute command in multiple lines
Answer:
The secret is the backslash \, put it at the end of the current line when you want to start a new line to continue the command.
E.g.
# echo "A" \
> "B" \
> "C"
A B C
How to list which login shells are available in the system
Answer:
View the file /etc/shells, and you will find all the valid login shells
$ cat /etc/shells
# /etc/shells: valid login shells
/bin/csh
/bin/sh
/usr/bin/es
/usr/bin/ksh
/bin/ksh
...
/bin/bash
How to change the login shell?
Answer:
To change the current user login shell, use the following command
e.g. change to /bin/sh
chsh -s /bin/sh
Logout and login again.