Skip to main content

Linux Guide for Developers

Guide to Linux operating system for developers.

  • ParrotOS
    • Used by security professionals and hackers.
    • Comes with hacking and penetration testing tools.
  • Ubuntu
    • Used by general consumers.

Kernel vs Operating System

  • Linux is a kernel, not an operating system. Ubuntu is an operating system.

Everything is a File

Everything is represented as a file.

  • eg: ls command is a file

The Shell

  • The shell is what interacts with the linux kernel. The terminal is the keyboard, mouse, OS application that emulates a physical terminal.
  • BASH is Born Again SHell.
  • The terminal emulator is the UI window that you type into, which is using BASH underneath to interact with the kernel.

Remote SSH

  • New servers don't allow remote access by default. You must enable that as follows:
https://linuxize.com/post/how-to-enable-ssh-on-ubuntu-20-04/

Linux Directories

/bin

Binaries, commands like ls.

/dev

Devices, like virtual disks vda.

/etc

Configuration settings. Known as 'etsy' or 'etcetera'.

/home

Home, subdirectory for each user's files (except root user).

/root

Root user's files.

/sbin

Super user binaries, commands like adduser.

Linux Commands

apropos

Search for a command. Eg: apropos usb

cat

Concatenate.

cd

Change Directory. Use cd ~ to go to home directory.

cp

Copy.

clear

Clear terminal. CTRL+L is alternative shortcut.

exit

Same as logout?

groups

Print users that logged in user is a member of.

logout

Logout. Shortcut is CTRL+D.

ls

List files.

ps

Process status.

pwd

Print Working Directory.

rm

Remove.

ssh

Connect to remote machine.

sudo

Switch user. Use sudo su - to switch to root user.

su bob

sudo

Super user do.

sudo cp ls lsbak

whoami

Who Am I?

which

What is the path to a command?

which ls

Tasks/Tips

  • cat /etc/passwd
    • Prints info on all users in system.
  • Package management.
    • Two big ones are dpkg and apt.
    • dpkg - Low-level package manager.
    • apt - Advanced Package Tool. High-level package manager that is more convenient for everyday usage.
    • aptitude - Interactive super advanced package manager.
    • snap - "Sort of" a package manager, more like a store.
  • Installing Visual Studio Code VSCode.
    • sudo snap install --classic code