Monday, July 21, 2014

12 Basic Useful Linux Commands

  1. command displays active processes:   
    • ps
  2. command displays your username:   
    • whoami
  3. displays the file system block usage (-h option provides "Human-readable" output i.e. you will see it in Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte):   
    • du -h
  4. show statistics about the amount of free disk space:  
    • df
  5. command lists all of the files and subdirectories you have in a given directory:  
    • ls
  6. check Linux version info or running kernel information:  
    • cat /proc/version
  7. check linux kernel version number and system information:  
    • uname -mars
  8. check distribution-specific information or distribution version:   
    • lsb_release -a OR cat /etc/*release
  9. check if CPU is 32bit or 64bit:  
    • grep flags /proc/cpuinfo
  10. used to resynchronize the package index files from the their sources specified in /etc/apt/sources.list file. The update command fetched the packages from their locations and update the packages to newer version:  
    • sudo apt-get update
  11. used to upgrade all the currently installed software packages on the system. Under any circumstances currently installed packages are not removed or packages which are not already installed neither retrieved and installed to satisfy upgrade dependencies:   
    • sudo apt-get upgrade
  12. used to free up the disk space by cleaning retrieved (downloaded) .deb files (packages) from the local repository:  
    • sudo apt-get clean

No comments:

Post a Comment