top of page

This is a basic command that i use. 

I put it here for my reference ^_^

Networking


$ ifconfig -a // To see ALL INTERFACE in the host

$ route -n // To see the GATEWAY in numeric way

$ ifup eth0 // To enable eth0 interface

$ ifdown eth0 // To disable eth0 interface

$ netstat nutlp // Display listening tcp and udp ports. No PID

$ sudo netstat nutlp // Display PID, listening tcp and udp ports

$ netstat -ln // Display listening tcp and udp ports

$ dhclient eth0 // Network interface request IP from DHCP

$ ifconfig eth0 192.168.0.111 netmask 255.255.255.0 up // Set IP address

Utils

$ scrot myimage.png // To SCREENSHOT

$ wget // To download file

$ display a.jpg // View image. Install imagemagick

$ alias aliasname='bash commands' // Setting alias name for certain bash commands

Process

$ ps -A // show the process list

Install

$  ./configure && make && make install // Compile the source code of the program

$  dpkg -i pkg.deb // Install debian package

$  rpm -Uvh pkg.rpm // Install RPM package

Website

$ python -m SimpleHTTPServer // To up WEBSITE in fast way.

BASH

$  processname & // & will make a program run in the background 

!! // Repeat last command

BASH Variable

$  env // Show environment variables

$  echo $NAME // Output value of $NAME variable

$  export NAME=value // Set $NAME to value

$  . ~/.bashrc // Declare variable in .bashrc files

Search

$  locate -i filename // find the location of filename. U need to run "updatedb" command.

$  grep -i // Case insensitive search

JAVA

$  export JAVA_HOME=/usr/lib/jvm/java-8-oracle // Set JAVA path version 8 JRE

sudo update-alternatives --config java // Select different version of JAVA

 java -version // To see the JAVA version used

Directory

$ ln -s path/to/file symlinkfilename // Create a symlink

SSH

$  ssh username@ip_address // SSH tu specific user

$  bash // To use bash terminah not sh terminal

chsh -s /bin/bash // To set bash as default shell

$ ssh -o ServerAliveInterval=30  // Every 30 second sent alive packet

System Info

$  uname -a // Show kernel information

$  cat /proc/cpuinfo // Cpu information

$  cat /proc/meminfo // Memory information

LEARN ABOUT BASH COMMANDS

https://explainshell.com/

This page gonna be update time by time. ^^

Linux Noob Sheet

bottom of page