Quantcast
RSS Entries RSS
RSS Subscribe by Email

Essential Linux Commands

Getting started on Linux can be challenging.  Largely because the first time user won’t have any idea how to track down potential problems.  The following Linux commands are essential to get additional information about your system when something goes wrong.

Machine info
  • sudo lshw -html > hardware.html – Creates an HTML page showing what hardware is on your system
  • uname -mr – Shows what kernel version and processor you are running on
  • df and fdisk -l – Gives you file system info.  Can help you figure out how things are mounted
Logs
  • dmesg – Useful for tracking down problems during boot
  • tail -f /var/log/messages – Now run the process giving you problems and you might see helpful error messages
Processes
  • top – Shows the programs which are the top memory and CPU users
  • free -m – Shows how much memory is free. Linux uses 100% memory by default so as to not waste memory by letting it sit empty. Look at the buffers/cache line to see how much is really used.
  • pgrep - Returns the process ids of a given program, allowing you to kill frozen programs
File transfer
  • scp -i key.pem local_file user@remote_machine:remote_path – Securely transfers a file
In depth
  • find – Find a file on the file sytem
  • sed – Programmatically edit a file or stream

If you’ve got other suggestions, please feel free to comment below.  Thanks!

Tags:

RSS feed for comments on this post · TrackBack URL

Leave a Comment