Basic Linux commands

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

10 thoughts on “Basic Linux commands

  1. Its such as you read my mind! You seem to know so much approximately this, such as you wrote the guide in it or something.

    I believe that you just can do with some percent to drive
    the message home a little bit, but other than that, that is wonderful blog.
    An excellent read. I’ll definitely be back.

  2. Everything is very open with a really clear clarification of the challenges.
    It was really informative. Your website is very helpful.
    Many thanks for sharing!

  3. I’m really impressed with your writing skills and also with the layout on your weblog. Is this a paid theme or did you modify it yourself? Either way keep up the nice quality writing, it is rare to see a great blog like this one nowadays.

  4. It’s amazing to go to see this web page and reading the views of all colleagues about this article, while I am also zealous of getting familiarity.

  5. I am extremely impressed along with your writing talents and also with the layout to your weblog. Is that this a paid subject matter or did you customize it yourself? Anyway stay up the excellent quality writing, it’s uncommon to see a nice blog like this one today.

    • Sorry mate. These days I am doing active job hunting. I was asked to do an extremely hard screen code. Thus I must spend a bunch of time coding even during weekend.
      To answer your question, I did not pay any money for this theme.

  6. We stumbled over here different web page and thought I might
    check things out. I like what I see so i
    am just following you. Look forward to looking over your web page for a second time.

Leave a reply to Luke Tong Cancel reply