Sei sulla pagina 1di 7

UNIX:

Solaris

IBM -AIX

HP-UX

Linux :

RHEL 6.8

Fedora

OEL

Cent OS

Commands:

1. cd <Directory>

to change the driectory from one location to another location

eg : $ cd /opt

2. mkdir <Directory>

to create new directory

$ mkdir test

wihch creates a test directory

3. rmdir <Directory>

to remove the directory whihc is empty

eg : $ rmdir test

4. who or finger

to know how many user are login into the sytem

$who

5. whoami

to know which user you are login

6. whereis <command/bindary>

to check whether the command or binary is avaible or not in the system


7. uname -a

which will give the information about sytem type (32 bit or 64 bit) and operating
sytem details
like kernal version and when the OS is built

note : if it shows i386,i586,i686 ==> 32 bit


if it shows x86_64 ==> 64 bit

8. id

to know which user you are login and it shows the detials
about userid and group also

9. id <username>

to check whether the user is exists in the sytems or not

$ id teja

note : to check the total users in the sytem $ cat /etc/passwd

-------------------------------------------

10. useradd <username>

to add a new user

#useradd tomcat

11. groupadd <groupname>

to add a new group

#groupadd tomcatadmin

12. useradd -g <groupname> <username>

to create and assign to a specific group

eg : # useradd -g tomcatadmin tomcat

13. userdel -d <username>

to delete a user

#userdel -d teja

14. usermod -G <groupname> <username>

to modify the existed user group

#usermod -G tomcatadmin tomcat

v.v. imp for troushooting :

15. top
to show the top most process whihc are running on the system and also
it shows the cpu's , physical memory and swap memory of total usage
and process wise, load average of the system

16. df -hT

to check the disk free space and usage of the entire file system

17. free -m

to check the only memory and swap usage & availbility

18. du -sh <Directory>

to check the disk space usage of a perticualr directory or file

19. du -sk | sort -rn

to list the most disk space usage files

20. grep <string> <file/dir>

to search a perticualr string in a file or directory

-i = ignore case sentsitive

-l = list

-c = count

-v = cut

21. cp -prf <file/dir> <newpath>

to copy the file or directory from one location to another


location or same location with another copy

-p == > to preserve the date and timestamp


-r ==> recursive
-f ==> files

22. rm -rf <file/dir>

to remove the the file or directories permentanetly

23. touch filename

to create new file

24. cat filename

to read the content of a file

25. more filename

to read the content of a file by page wise

26. less filename


to read the content of a file by line wise

27. vi filename

to edit the existed or new file content

ESc+ Press "i" ==> go to insert mode


ESc+/<String> ==> to serach a perticular string
Esc+: se nu ==> to set the line numbers
Esc+:n ==> to go to a perticular line number (n=1,2,3 ...)
Esc+Shift+g ==> to go to last line of the file
Esc+g+g ==> to go to first line of the file
Esc+x ==> to delete a character
Esc+d+d ==> to delete a line
Esc+:wq ==> save and quit
Esc+q ==> without save + exit
28. mv file/dir <new-file/dir>

29. diff file1 file2

30. ping <IPaddress/Hostname>

31. telnet <IPaddress/Hostname> <Port number>

32. nslookup <IPaddress/Hostname>

33. traceroute <IPaddress/Hostname/domain-name>

34. tracert <IPaddress/Hostname/domain-name>


sss
35. scp file/dir username@ipaddress/hostname:/path

36.chmod -R 777 <file/directory>

eg :

chmod 644 filename

rwxrwxrwx 777

-R ==> recursively

r = 4
w = 2
x = 1

4+2+1=7

u = user(owner) rwx
g = group rwx
o = other rwx

37. # chown -R username:groupname <file/directory>

To change the ownership file or dir

38. tail -n file


to see the last ten lines of file

tail file

tail -100 file

tail -f file --> to the last ten lines of file dynamically

39. head -n file

to see the first or top ten line of file

40. pwd

to know present working directory

41. cd ..

to back one directry from current path

42. ls -ltra

to show the list of files and directories in a long format in a perticular path

-l = long format

-t = time

-r = recursive order

-a = to show hidden file

43. tar -xvf <filename.tar.gz>

to extract the files from a archive file

44. tar -cvf filename.tar directory/*

45. unzip filename.zip

46. zip filename.zip folder/*

47. jar -xvf filename.jar

48. su - username

to switch from one to another user

49. sudo <command>

50. #passwd <username>

51. ifconfig

52.ipconfig ( windows)
53.sed

54.ps -ef | grep java

55. ./jdk-6u45-linux-i586.bin or .sh

to install or run or excute the .bin or ./sh


=================================================

--> JAVA installation in root user

./filename.bin/.sh

tar -xvf <filename>.tar

unzip filename.zip

rpm -ivh package-name.rpm( RedHat)

yum install java (not recomended)

--> Create user tomcat and set password for tomcat

--> Environment varible setting for JAVA_HOME=/opt/java/jdk1.6.0_45


and PATH=/opt/java/jdk1.6.0_45/bin

add the below two lines in .bashrc of tomcat user

su - tomcat
vi .bashrc

export JAVA_HOME=/opt/java/jdk1.6.0_45
export PATH=$PATH:/opt/java/jdk1.6.0_45/bin

save and exit --> logout from tomcat user and relogin , then check java is enabled

run the below the commands

java

java -version

--> Install the Tomcat server in tomcat

copy the software in /home/tomcat using winscp and run the below command

tar -xvf apache-tomcat-7.0.50.tar.gz

--> Start & shutdown server tomcat server


--> verify the server is started successfully or not

ps -ef | grep java

http://localhost:8080/

Task :

default server : IP adress = 127.0.0.1 and port 8080

Start the tomcat server with IP 192.168.91.128 and port 7000

http://192.168.91.128:7000/

Potrebbero piacerti anche