Tips N Tricks

HOW TO ASSIGN IP ADDRESS AND GATEWAY FROM COMMAND LINE IN LINUX
====================================================================

Although, we have got a wonderful tool "NetworkManager" to manage our interface connection from GUI,but when we are using console then how to manage those interfaces and configuring them becomes a headache for a naive linux user.These are the following steps you should follow in order to configure your interface properly.
 

[user@linux:~]$ifconfig eth0 192.168.1.10 netmask 255.255.255.0
To add the default gateway in the routing table type --
[user@linux:~]$route add default gw 192.168.1.254
[user@linux:~]$route -n  (to print the routing info table on terminal)
or we can also use
[user@linux:~]$netstat -anr


HOW TO ADD DNS SERVER ENTRY IN LINUX FROM COMMAND LINE
===========================================================


[user@linux:~]$echo "nameserver 8.8.8.8" > /etc/resolv.conf


HOW TO FIND THE ARCHITECTURE OF YOUR SYSTEM
===============================================

[user@linux ~]$arch
or
[user@linux ~]$uname -m

USING SHRED TO COMPLETELY DESTROY UR SECRET DATA
=====================================================

[user@linux ~]$shred -v -z -u <filename_to_be_shred>
Here options are -v --> verbose
                 -z --> zero fill on the last overwriting
                 -u --> finally truncate ur file after overwriting

SOME INTERESTING OPTIONS OF DATE NOT GIVEN IN MAN BUT IN INFO
==============================================================
This is GNU date, and you won't find these options in "man date" - you have to use "info date" (or "pinfo date" ).


[user@linux ~]$date -d yesterday

[user@linux ~]$date --date=yesterday

[user@linux ~]$date -d '2 days ago'


HOW TO CHANGE MAC ADDRESS IN LINUX FROM TERMINAL
=====================================================

[user@linux ~]$ifconfig eth0 down hw ether 00:11:1a:2b:3c:33
                                       (give the new ethernet address)
[user@linux ~]$ifconfig eth0 up

To restore the original MAC address give the following commands : -

[user@linux ~]$ifconfig eth0 down
[user@linux ~]$ifconfig eth0 up

HOW TO INSTALL FONTS IN THE LINUX
==================================

Copy and paste the fonts you want to install inside the /usr/share/fonts as follows .Here 
fc-cache scans the font directories  on  the  system  and  builds  font information  cache
files  for  applications using fontconfig for their  font handling.

[user@linux:~]#sudo cp /home/user/fonts/* /usr/share/fonts/
[user@linux:~]#sudo fc-cache -f -v


No comments:

Post a Comment