Some commands that you can play around with in unix
1.ps -ef - This command will list all the running processes. 'e' is for each process, 'f' is for full format display.
2. ps -ef | grep java - This command will list all the running java processes.
3. chmod nnn filename - To change the access rights on the file.
4. pwd - Present working directory.
5. date - current date and time at the location of the server.
6. who - will list all the logged in user.
7. who am i - will list your username and logged in time.
8. tar cf file.tar file1 file2 … fileN - to create a tar file from combination of files.
9. zip filename - To zip a file.
10. unzip filename - To unzip a file.
11. kill -3 PID - to create the dump of the process. PID is process id can be seen using the first command.
12. cd dir-path - change directory.
13. grep pattern filename- search for a pattern in file. Pattern can be any string you need to look into file.
14. ls - to list the dir and file.
15. man command - to see manual for a command.
16. ftp hostname - to ftp file from unix.
17. grep -c pattern filename - Searches and prints only the number of matches to the screen.
18. grep -i pattern filename - Searches without regard to letter case.
19. grep -n pattern filename - Prints to the screen preceded by the line number.
20. grep -v pattern filename - All lines that do not match are printed.
21. grep -x pattern filename - Only exact matches are printed.
Executing shell script - On the command prompt type sh filename.sh
Executing perl script - On the command prompt type ./filename.pl
No comments:
Post a Comment