Linux Commands Every Developer Should Know

Linux Commands Every Developer Should Know

ยท

2 min read

Linux is an amazing open source operating system that is available in many distros that provide interactive Graphical User Interfaces. However functionality too can be achieved through the Command Line Interface. Here are some basic CLI commands you should know:

File Commands

  • ls is used to list the contents of the current directory
  • cd dir is used to change directory, accompanied with the name of the directory you want to shift into, 'dir'
  • mkdir dir is used to create a new directory, accompanied with the name of the directory, 'dir'
  • pwd is used to show the path of the current directory
  • cat > file place standard input into a file, 'file'
  • rm -r dir is used to delete a directory, accompanied with the name of the directory, 'dir'

System Info

  • whoimi used to display who you are currently logged in as
  • lshw used to extract detailed information on the hardware configuration of the machine
  • cat /proc/cpuinfo used show cpu information
  • cat /proc/meminfo used show memory information
  • df used to show disk usage

Process Management

  • ps used to display currently active processes
  • ps aux used to display a more detailed information on currently active processes
  • kill pid used ti kill a process, accompanied with the process's pid

Shortcuts

  • ctrl+c used to halt the current command
  • ctrl+z used to stop the current command
  • up and down arrow keys used to go up and down through recent commands

VIM

  • :x or :wq exit saving any changes made
  • :q exit if no changes made
  • :!q exit and ignore any changes made
ย