C:\>cmd-line.com

"Let's learn the Command-Line Interface!"

GNU Linux (BASH) [Debian-based distros]


introduction


What is GNU Linux?

GNU Linux is an open source operating system.

What is BASH?

BASH (Bourne Again SHell) is the most popular shell for Linux terminal.

What is Debian?

Debian is an important GNU Linux distribution. Many other distros are derived from Debian, such as Ubuntu or Linux Mint.

How can we use GNU Linux?

On most distributions (e.g. Ubuntu (Desktop), Linux Mint), we can use it with CLI (Command-Line Interface) and GUI (Graphical User Interface).

There are distributions that do not have a GUI installed by default. Typically, these are versions used as server operating systems, such as Ubuntu Server.

If we are just using a Graphical User Interface, we can run a terminal emulator (pseudoterminal) or go to the Command Line Interface.

How to run the terminal in GUI (Graphical User Interface)?

On most distributions, click the menu button or press and type terminal.

How to go to the CLI (Command-Line Interface) from GUI?

Press Ctrl + Alt + F2. Instead of F2 can be F3, F4, F5, F6 or F1.

How to back to the GUI (Graphical User Interface)?

Press Alt + F1. Instead of F1 can be F6, F7 or other function key. You can also quickly switch between instances of the command line with Alt + or Alt + .


keyboard shortcuts


  • ctrl + l - clear the terminal screen; same as the command clear
  • ctrl + c - terminate the current task - SIGINT
  • ctrl + \ - terminate the current task - SIGQUIT (if ctrl + c doesn't work)
  • ctrl + z - stop the current task and move it to the background (see commands: jobs, fg, bg and operator &
  • ctrl + s - stop the terminal output
  • ctrl + q - resume the terminal output
  • ctrl + d - exit the terminal; same as the command exit
  • ctrl + shift + v - paste from the clipboard
  • ctrl + alt + del - reboot the system - only in CLI (TTY)
  • ctrl + alt + F1 - TTY1 (from GUI)
  • ctrl + alt + F2 - TTY2 (from GUI)
  • ctrl + alt + F3 - TTY3 (from GUI)
  • ctrl + alt + F4 - TTY4 (from GUI)
  • ctrl + alt + F5 - TTY5 (from GUI)
  • ctrl + alt + F6 - TTY6 (from GUI)
  • alt + F1 - TTY1 (from other TTY)
  • alt + F2 - TTY2 (from other TTY)
  • alt + F3 - TTY3 (from other TTY)
  • alt + F4 - TTY4 (from other TTY)
  • alt + F5 - TTY5 (from other TTY)
  • alt + F6 - TTY6 (from other TTY)
  • alt + - next TTY (from other TTY)
  • alt + - previous TTY (from other TTY)

disks & partitions


Disks numbering

sda
│ └─ disk number
└─── type of disk controller
types of disks controllers
  • h - IDE controller
  • s - SATA / SCSI controller
disk number (as a letter)
  • a - 1st disk
  • b - 2nd disk
  • c - 3rd disk
examples
  • sda - disk #1 in SATA / SCSI controller
  • sdb - disk #2 in SATA / SCSI controller
  • hda - disk #1 in IDE controller

Partitions numbering

sda1
│ │└─ partition number
│ └── disk number
└──── type of disk controller
partition number
  • 1 - 1st partition
  • 2 - 2nd partition
  • 3 - 3rd partition
examples
  • sda1 - disk #1, partition #1
  • sda2 - disk #1, partition #2
  • sdb1 - disk #2, partition #1
GNU Linux (BASH) - Linux Mint [Debian-based distro]
karol@core2duo:~$ sudo fdisk -l
[sudo] password for karol:          
Disk /dev/sda: 223,58 GiB, 240056327680 bytes, 468860015 sectors
Disk model: SanDisk SSD PLUS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9438d1e9

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 296962047 296960000 141,6G  7 HPFS/NTFS/exFAT
/dev/sda2       296962048 358401501  61439454  29,3G 83 Linux
/dev/sda3       358402048 464662527 106260480  50,7G 83 Linux
/dev/sda4       464662528 468858879   4196352     2G 82 Linux swap / Solaris


Disk /dev/sdb: 55,92 GiB, 60022480896 bytes, 117231408 sectors
Disk model: KINGSTON SVP200S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x781a275d

Device     Boot    Start       End  Sectors  Size Id Type
/dev/sdb1  *        2048  96751615 96749568 46,1G  7 HPFS/NTFS/exFAT
/dev/sdb2       96751616 117229567 20477952  9,8G  b W95 FAT32

directory structure


├── bin
├── boot
├── cdrom
├── dev
├── etc
├── home
├── lib
├── lib64
├── lost+found
├── media
├── mnt
├── opt
├── proc
├── root
├── run
├── sbin
├── srv
├── sys
├── tmp
├── usr
└── var
GNU Linux (BASH) - Linux Mint [Debian-based distro]
karol@core2duo:/$ tree -L 1
.
├── bin
├── boot
├── cdrom
├── dev
├── etc
├── home
├── lib
├── lib32
├── lib64
├── lost+found
├── media
├── mnt
├── opt
├── proc
├── root
├── run
├── sbin
├── srv
├── sys
├── tmp
├── usr
└── var

system files


  • dev/
    • random
    • sda
    • sda1
    • sda2
    • sda3
    • sda4
    • sdb
    • sdb1
    • sdb2
    • sdb3
    • sr0
    • urandom
  • etc/
    • crontab
    • default/
      • grub
    • fstab
    • groups
    • hostname
    • passwd
    • timezone
  • proc/
    • cpuinfo

environment variables


  • set
  • env
  • export
$PWD $OLDPWD
GNU Linux (BASH) - Linux Mint [Debian-based distro]
karol@core2duo:~$ set | head -96
BASH=/usr/bin/bash
BASHOPTS=checkwinsize:cmdhist:complete_fullquote:expand_aliases:extglob:extquote:force_fignore:globasciiranges:histappend:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=([0]="0")
BASH_ARGV=()
BASH_CMDS=()
BASH_COMPLETION_VERSINFO=([0]="2" [1]="10")
BASH_LINENO=()
BASH_REMATCH=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="5" [1]="0" [2]="17" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
BASH_VERSION='5.0.17(1)-release'
COLORTERM=truecolor
COLUMNS=80
COMP_WORDBREAKS=$' \t\n"\'><=;|&(:'
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DESKTOP_SESSION=cinnamon
DIRSTACK=()
DISPLAY=:0
EUID=1000
GDMSESSION=cinnamon
GDM_LANG=en_US
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/b124d479_898d_49c3_945a_f597a820f69a
GNOME_TERMINAL_SERVICE=:1.1716
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GROUPS=()
GTK3_MODULES=xapp-gtk3-module
GTK_MODULES=gail:atk-bridge
GTK_OVERLAY_SCROLLING=1
HISTCONTROL=ignoreboth
HISTFILE=/home/karol/.bash_history
HISTFILESIZE=2000
HISTSIZE=1000
HOME=/home/karol
HOSTNAME=core2duo
HOSTTYPE=x86_64
IFS=$' \t\n'
INSIDE_NEMO_PYTHON=
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_ADDRESS=pl_PL.UTF-8
LC_IDENTIFICATION=pl_PL.UTF-8
LC_MEASUREMENT=pl_PL.UTF-8
LC_MONETARY=pl_PL.UTF-8
LC_NAME=pl_PL.UTF-8
LC_NUMERIC=pl_PL.UTF-8
LC_PAPER=pl_PL.UTF-8
LC_TELEPHONE=pl_PL.UTF-8
LC_TIME=pl_PL.UTF-8
LESSCLOSE='/usr/bin/lesspipe %s %s'
LESSOPEN='| /usr/bin/lesspipe %s'
LINES=24
LOGNAME=karol
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
MACHTYPE=x86_64-pc-linux-gnu
MAILCHECK=60
OLDPWD=/home/karol
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PAPERSIZE=a4
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PIPESTATUS=([0]="0")
PPID=10883
PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS2='> '
PS4='+ '
PWD=/home/karol
QT_ACCESSIBILITY=1
QT_QPA_PLATFORMTHEME=qt5ct
SESSION_MANAGER=local/core2duo:@/tmp/.ICE-unix/1161,unix/core2duo:/tmp/.ICE-unix/1161
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
SSH_AGENT_PID=1310
SSH_AUTH_SOCK=/tmp/ssh-5epUrs6SzHHy/agent.1161
TERM=xterm-256color
UID=1000
USER=karol
VTE_VERSION=6003
XAUTHORITY=/home/karol/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg
XDG_CURRENT_DESKTOP=X-Cinnamon
XDG_DATA_DIRS=/usr/share/cinnamon:/usr/share/gnome:/home/karol/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/karol
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=cinnamon
XDG_SESSION_ID=c1
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=7
_=--color=auto
GNU Linux (BASH) - Linux Mint [Debian-based distro]
karol@core2duo:~$ env
SHELL=/bin/bash
SESSION_MANAGER=local/core2duo:@/tmp/.ICE-unix/1161,unix/core2duo:/tmp/.ICE-unix/1161
QT_ACCESSIBILITY=1
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LANGUAGE=en_US
LC_ADDRESS=pl_PL.UTF-8
LC_NAME=pl_PL.UTF-8
SSH_AUTH_SOCK=/tmp/ssh-5epUrs6SzHHy/agent.1161
DESKTOP_SESSION=cinnamon
LC_MONETARY=pl_PL.UTF-8
SSH_AGENT_PID=1310
GTK_MODULES=gail:atk-bridge
XDG_SEAT=seat0
PWD=/home/karol
LOGNAME=karol
XDG_SESSION_DESKTOP=cinnamon
QT_QPA_PLATFORMTHEME=qt5ct
XDG_SESSION_TYPE=x11
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
XAUTHORITY=/home/karol/.Xauthority
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/karol
GDM_LANG=en_US
INSIDE_NEMO_PYTHON=
HOME=/home/karol
LC_PAPER=pl_PL.UTF-8
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_CURRENT_DESKTOP=X-Cinnamon
VTE_VERSION=6003
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/e5a4ca93_cb6c_4a7b_97b7_e8c8534460a0
LESSCLOSE=/usr/bin/lesspipe %s %s
XDG_SESSION_CLASS=user
TERM=xterm-256color
LC_IDENTIFICATION=pl_PL.UTF-8
GTK_OVERLAY_SCROLLING=1
LESSOPEN=| /usr/bin/lesspipe %s
USER=karol
GNOME_TERMINAL_SERVICE=:1.2033
DISPLAY=:0
SHLVL=1
LC_TELEPHONE=pl_PL.UTF-8
LC_MEASUREMENT=pl_PL.UTF-8
XDG_VTNR=7
XDG_SESSION_ID=c1
PAPERSIZE=a4
XDG_RUNTIME_DIR=/run/user/1000
LC_TIME=pl_PL.UTF-8
GTK3_MODULES=xapp-gtk3-module
XDG_DATA_DIRS=/usr/share/cinnamon:/usr/share/gnome:/home/karol/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
GDMSESSION=cinnamon
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
LC_NUMERIC=pl_PL.UTF-8
_=/usr/bin/env
OLDPWD=/home/karol/Documents/cmd

access rights


GNU Linux (BASH) - Linux Mint [Debian-based distro]
karol@core2duo:~$ ls -l
razem 44
drwxr-xr-x 15 karol karol 4096 sie  3 20:57 Aplikacje
drwxr-xr-x  4 karol karol 4096 sie  4 10:47 Dokumenty
drwxr-xr-x 22 karol karol 4096 sie  2 13:20 ePSXe
drwxr-xr-x  7 karol karol 4096 sie  3 20:54 Muzyka
drwxr-xr-x  2 karol karol 4096 sie  2 16:14 Obrazy
drwxr-xr-x  2 karol karol 4096 sie  4 10:38 Pobrane
drwxrwxr-x  2 karol karol 4096 sie  4 18:32 Projects
drwxr-xr-x  2 karol karol 4096 sie  2 16:14 Publiczny
drwxr-xr-x  4 karol karol 4096 sie  4 13:06 Pulpit
drwxr-xr-x  2 karol karol 4096 sie  2 16:14 Szablony
drwxr-xr-x  2 karol karol 4096 sie  2 16:14 Wideo
 ┌───────┬─ all
drwxr-xr-x
│└┬┘└┬┘└┬┘
│ │  │  └─ other
│ │  └─ group
│ └─ user
└─ type of file / directory

types of files

  • d - directory
  • - - usual file
  • l - link

who is who?

  • user - the file (directory) owner
  • group - users who are in the same group as the owner of the file
  • other - other users
  • all - all users

what means ...?

  • r - reading right
  • w - writing right
  • x - executing right

numerical value of access rights

  • r - 4
  • w - 2
  • x - 1
  • rwx = 7
  • rw- = 6
  • r-x = 5
  • r-- = 4
  • --- = 0

how to change access rights?

by numerical values
  • chmod 777 fileName - rwxrwxrwx - set all rights to all users
  • chmod 700 fileName - rwx------ - only the owner has rights (all)
  • chmod 644 fileName - rw-r--r-- - the owner can read and write; users from group and other users can only read
  • chmod 755 fileName - rwxr-xr-x - the owner has all rights; users from group and other users can read and execute
by assigning
  • chmod u+x fileName - add executing right for the file owner user
  • chmod o-r fileName - remove reading right for other users
  • chmod g=rx fileName - set reading and executing right for group users
  • chmod a=rw fileName - set reading and writing right for all users

pipelines & redirections



command information


  • whatis
  • apropos
  • man
  • info
  • tldr

browsing directories


  • pwd
  • ls
  • cd
  • tree
cd PATH Go to the given directory
cd - Go to home directory of current user
cd .. - Go up to the parent of the current directory
cd - - Go to the previously chosen directory
tree -L 1 - display one-level struct
tree -d - display only directories
GNU Linux (BASH) - Linux Mint [Debian-based distro]
karol@core2duo:~/Dokumenty/DOStutorial$ tree -L 2
.
├── dos
│   ├── batch
│   ├── batch.htm
│   ├── dysk.htm
│   ├── menu.htm
│   ├── msdos.htm
│   ├── start.htm
│   ├── strukt.htm
│   └── wstep.htm
├── gui
│   ├── dos.gif
│   ├── flarup.gif
│   ├── link.css
│   ├── logo.gif
│   ├── logo.htm
│   ├── napis.htm
│   ├── okno.htm
│   └── start.htm
└── index.htm

3 directories, 16 files
karol@core2duo:~/Dokumenty/DOStutorial$ 

file manipulation


  • cp
  • mv
  • rm
  • ln
  • touch
  • mkdir
  • rmdir
  • install

file information


  • stat
  • file
  • cmp
  • diff

reading files


  • more
  • less
  • head
  • tail

console


  • tty
  • clear
  • reset
  • history
  • alias
  • source

power & session


  • exit
  • logout
  • login
  • reboot
  • poweroff
  • shutdown

file system


  • df
  • du
  • lsblk
  • fstab
  • mount
  • umount
  • fdisk
  • mkfs
  • fsck
  • dd
  • ccd2iso
  • mdf2iso
  • nrg2iso

administration


  • su
  • sudo
  • chmod
  • chown
  • umask
  • update-grub
  • select-editor

users


  • logname
  • whoami
  • who
  • w
  • last
  • lslogins
  • groups

user administration


  • passwd
  • adduser
  • deluser
  • useradd
  • userdel
  • addgroup
  • delgroup
  • groupadd
  • groupdel

statistics


  • uptime
  • free
  • time
  • date
  • cal
  • ncal

system


  • hostname
  • uptime
  • uname
  • lsmod
  • modprobe
  • dmesg
  • inxi
  • screenfetch
  • neofetch
  • service
  • systemctl

hardware


  • arch
  • lscpu
  • lsmem
  • lsusb
  • lspci
  • lshw
  • hdparm

network


  • ifconfig
  • ping
  • traceroute
  • mtr
  • host
  • whois
  • arp
  • route
  • netstat
  • dig
  • wget
  • curl
  • iptables
  • ufw
  • gufw
  • nethogs

wireless


  • iwconfig
  • iwlist
  • rfkill

network sniffing


  • tcpdump
  • nmap
  • kismet
  • wireshark

processes


  • ps
  • top
  • htop
  • kill
  • killall
  • kill -KILL
  • killall -KILL
  • pidof
  • pstree
  • pgrep
  • pkill
  • jobs
  • fg
  • bg
  • nice
  • renice
  • disown
  • nohup

package managers


  • apt
    • apt search
    • apt show
    • apt install
    • apt remove
    • apt purge
    • apt update
    • apt list --upgradable
    • apt upgrade
    • apt autoremove
    • apt add-repository
  • apt-cache
    • apt-cache search
    • apt-cache show
  • apt-get
    • apt-get install
    • apt-get remove
    • apt-get purge
    • apt-get update
    • apt-get upgrade
    • apt-get autoremove
  • apt-key
  • add-apt-repository
  • aptitude
  • rpm
  • yum
  • pacman
  • flatpak
    • flatpak list
    • flatpak install
    • flatpak uninstall
  • snap

text manipulation


  • cat
  • tee
  • awk
  • sed

archives


  • tar
  • zip
  • unzip
  • gzip
  • bzip2

compilation


  • gcc
  • g++
  • javac
  • java
  • make
  • cmake

text editors


  • vim (vi)
  • nano (pico)
  • mcedit

file managers


  • mc (midnight commander)
  • ranger

useful programs


  • lynx
  • links
  • elinks
  • moc / mocp

ncurses programs


  • mc
  • mcedit
  • alsamixer

x server


  • xrandr
  • xkill
  • xterm
  • startx
  • xinit
  • xlogo
  • xcalc
  • xeyes
  • xman
  • xclock
  • xbiff

bash scripts


  • echo
  • read
  • sleep
  • let
  • test
  • if
  • elif
  • else
  • then
  • fi
  • case
  • esac
  • for
  • select
  • while
  • until
  • do
  • done
  • function

telnet & ssh


  • telnet
  • ssh

wine


  • wine
  • wineconsole
  • winecfg
  • notepad

xampp


  • sudo /opt/lampp/lampp start
  • sudo /opt/lampp/lampp stop
  • sudo /opt/lampp/lampp reload
  • sudo /opt/lampp/lampp restart

git


configuration

  • git config user.name
  • git config user.email
  • git config core.editor
  • git config --global user.name ["Your Name"]
  • git config --global user.email [you@example.com]
  • git config --global core.editor [editor name]
  • git config --list

get started with the repository

  • git clone [URL]
  • git init

check changes

  • git status
  • git status -s
  • git diff

commit changes

  • git add [file name]
  • git rm [file name]
  • git commit -m "your message"

work with remote repositories

  • git remote -v
  • git remote add origin [URL]
  • git push
  • git pull
  • git fetch

funny & miscellaneous


  • cowsay
  • cowthink
  • sl
  • tty-clock
  • cmatrix