Tags

, ,

Although I am not a Linux/Unix administrator, as a developer, sometimes I am required to do some application deployment work, sometimes I will be asked to do some system tuning work. Thus I think it is important to know some basic Linux commands.

Below are 22 very basic Linux/Unix commands. Please be reminded here Linux I mean Red hat Linux.

1. find a file

locate <file_name>

2.list files under a folder

ls -l

3.find disk space

df -h

4.task managers

top

5.deal with cron table

crontab -e

6. list cron tasks

crontab -l

7. find system information for instance find number of phisical CPU

cat /proc/cpuinfo | grep -E “physical id|cpu cores” | sed ‘N;s/\n/ /’ | sort | uniq

8.list the last 500 lines in server.log

tail -f -n 500 server.log

9. copy command

cp [OPTION]… SOURCE DEST

10. create symbolic link

ln -s [TARGET DIRECTORY OR FILE] ./[SHORTCUT]

11. change directory attributes

chmod a+rw <directory name>

12. find a specific process for instance

ps -ef|gerp java

13. create a new directory

mkdir <directory name>

14. view the content of a specific file

more <file name>

less <file name>

15. delete a file/folder

rm -rf // please be reminded no warning message will be displayed for this command.

16. create a blank file

touch <file name>

17. display network related information such as network connections, routing tables etc.,

netstat -a

18. reboot your machine

reboot

19. unmount/mount a disk

umount /dev/sdb1

mount /dev/sdb1

20. find linux system information

uname

21. find ip address

ifconfig

22. find system memory information

free -m

Advertisements