1. |
Permanently set the Environment Variables |
|
classpath=” ” export classpath |
2. |
To see the hardware configuration |
|
cat /proc/cpuinfo |
3. |
Tar commands |
|
tar –xvvzf myfile.tar.gz // to leave the .tar.gz unchanged |
|
tar –pczf myfile.tar.gz /path/... // to compress |
|
gzip –c test.text>test.gz |
|
tar –xvvf myfile.tar // to extract |
4. |
To change the login user name |
|
su username |
5. |
To see the size of file or directory |
|
du –skh filename |
6. |
To show the disk space |
|
df -h |
6. |
Copy files from one computer to another |
|
scp myfile username@xxx.xxx.xxx:c:/ scp myfile username@xxx.xxx.xxx:/opt/ // where xxx is the hostname of target computer |
7. |
To see the CUP and Memory usage |
|
top |
8. |
Vi commands |
|
vi myfile.config // to view the file |
|
:q // to exit |
|
:q! // to exit witout the change |
|
:wq // to exit with change |
|
:cw // change word |
|
:cc // change a line |
9. |
Make a backup file |
|
cp –b myfile1 myfile2 |
10. |
Create direcory |
|
mkdir mydirectory |
11. |
Set file permission |
|
chmod 777 mybatch.sh |
12. |
To check the OS |
|
cat /etc/redhat-release |
13. |
Force to delete the directory |
|
rm –rf direcory |
14. |
Search for a file name |
|
find . –name myfile |
15. |
Start Xwin X server |
|
Start Cygwin Bash Shell cd /usr/x11R6/bin ./startxwin.bat |
16. |
View IP Address |
|
hostname -i |
17. |
View and kill Processes |
|
ps: to view processes kill -9 process id |
18. |
Copy the entire directory |
|
cp -R dir/ newdir/ |
19. |
View port |
|
Netstat –an | grep 9081 Netstat –an > /tmp/port.out |