Linux Tips
I think is a good Idea for all of us to share our Linux tips that we all know.
1- Tired of using Kill -9 ID to closed some running app? not telling that first we had to run ps aux to see the apps. ID. just create an script, call it die (in this case), or whatever you like, just make sure the script have this line inside:
kill -9 `ps aex | grep $1 | grep -v grep | awk '{print $1}'`
save the file, chmod +x it, and put it in your PATH, then every time you want to kill some apps without kill -9 ID, you just use the command line
$die apps
2- want to login always with passwd less? no matter if you are user or root? this maybe is a unsafe option but I had saw people that like that style.
root$ passwd -d root
user$ passwd -d "your user name"
Next time you login, you wonīt have to put any passwd.
3-verify if some apps, is already running.
user$ ps -aux | grep 'application'
4-Want to save 800Kb of ram? instead of login to X with startx, use exec startx.
5- Want to know the size of an certain directory? use command du, like this.
user$ du -sh home
6-want to protect files from write and read? use chattr command as root you could do this to any file or directory.
root$ chattr +i file
want to put your file back like it was use:
root$ chattr -i file
want to know which files or directory are protected with chattr command line? use this:
user$ lsattr
7-Put more than 1 IP to your network cards? you have to have the option "IP Aliasing support, in your kernel, then:
root# ifconfig eth0:0 ip network sub mask
root# ifconfig eth0:1 ip network sub mask
8-Donīt want any user that is not root to use the command su? put in /etc/passwd
root:ALL:DENY
9-Secure passwords, to create more secure passwd as root type:
root# head -c 6 /dev/random | mmencode
mkpasswd is used for this utility.
Keep up sharing your tips.:)
Last edited by little_ball; 06-26-2004 at 05:18 PM.
|