Linux All Command With Example 2019

Linux All Command With Example

www.techneting.com

Categories Of Linux Commands

  • System Commands
  • Hardware Commands
  • File Commands
  • Directory Commands
  • Process related Commands

Linux Commands- Basic System Command

CommandsDescription
uname -rDisplay Kernel Release information
uname -aDisplay Linux system information
uptimeShow how long the system is running
hostname -iDisplays the IP Address and Hostname
dateShow Current Date
calShows this month Calender
whoamiWho you are logged in as

 

Basic System commands in Linux

The table shows the useful commands in Linux for  day-to-day Activities

Commands Description
# wIt Displays current logged in user ad their Processes
# head <file name>It shows the first 10 lines of the file
# tail <file name>It shows the last 10 lines of the file
# bcBasic Calculator
# IsblkThis command used to list block devices by their assigned names in a tree-like fashion
# historyIt displays the list of executed commands in terminal
# sudoAllows permitted users to executed commands as superuser

Linux- Basic Hardware Commands

Commands Description
$ dmesgDetected hardware and boot messages
$ IshwDisplay information on hardware configuration fo the system
$ free -mUsed and free memory (-m for MB)
$ Isulsb -tvShow USB devices -t for tree hierarchy, -v for verbose
$ lspci -tvShow PCI devices (-t  for tree hierarchy,  -v for verbose
$ hdparm -i /dev/ sdaShow info about disk sda

Basic Hardware Commands in Linux

An Operating System has to work closely with the hardware system that acts as its foundations.

The operating system needs certain services that can only be provided by hardware, Some commands report only specific hardware components  Exmp. CPU or memory. Other basic Commands

# lscpuDisplay information about CPU and processor unit
#  lsscsiLists Scsi/SATA  device connected to the system
# hwinfoDetail information about the system hardware
# dfShow Disk Space of file system
# dmidecodeUsed to extract hardware information about DMI tables

Linux- File Commands

Commands Description
$ lsDisplay all the information about files and system
$ mkdir <directory -name>Create a directory or multiple directories
$ touch <filename>Create or update file
$ rm <file or Dirctory>Delete file or Directory
$ cp <file1> <file2>Copy file1 to file2
$ mv <Source> <Destination>Moves file or Directory
$ head <file1>Output the firs 10 lines of file1
tail  <file1>Output the last 10 lines of file1

Linux- Directory and Search Commands

$ pwdDisplay the user’s present working directory
$ cd ..to go up one level of the directory tree
$ cdTo Change $HOME directory of the user
$ cd /testChange to /test directory
$ grep pattern filesSearch for patter in files
$ local fileFind all instances of file
$ find /home/tom -name “index”Find file names that start with word “index’

Basic Directory and Search commands in Linux

The table shows the basic directory and searches commands, these commands are Used by Linux on a daily basis.

Processes are carried out as a task within the Operating system. The process is a set of machine code instructions and data executed by a system. or user

The Table shows the basic process related commands used in Linux environments

CommandsDescription
$ psDisplays current active processes
$ ps aux | grep “telnet”Find all processid related to telnet
$ pmapThe displays Memory map of the process (kernel, the user, memory, etc.)
$ kill pidKill process with the mentioned Process identifier
$ killall procKill all processes “proc”
$ bgResume suspended jobs without bringing them to the foreground
$ fgBring the most recent jobs to Foreground

 

We will be happy to hear your thoughts

      Leave a reply

      This site uses Akismet to reduce spam. Learn how your comment data is processed.

      TECHNETING