Linux command line for you and me is a book for newcomers to the command line environment.
Conditions of Use
This book is licensed under a Creative Commons License (CC BY-NC-SA). You can download the ebook Linux Command Line for You and Me for free.
- Title
- Linux Command Line for You and Me
- Author(s)
- Kushal Das
- Published
- 2023-09-01
- Edition
- 1
- Format
- eBook (pdf, epub, mobi)
- Pages
- 128
- Language
- English
- License
- CC BY-NC-SA
- Book Homepage
- Free eBook, Errata, Code, Solutions, etc.
Shell commands Terminal emulators date command cal command whoami command id command pwd command cd command . directory and .. directory ls command mkdir command rm command Copying a file using cp command Renaming or moving a file tree command wc command less command echo command Redirecting the command output Using > to redirect output to a file Moving around in the command line man pages Counting files in a directory Editing longer commands File system FHS Useful commands Creating soft link to a file Creating hard links Extracting a tar file Creating a tar file Vim editor :q to exit vim Open a new file or edit an existing file Different modes of vim :w to save a file :q! to quit without saving Becoming root user Using sudo command !! trick Setting up hostname Environment variables Setting up environment variable values locate command Finding date/time in different timezones Bash history Sort files by size Curl! For all your web needs Viewing a file Downloading the file Download with the same name Making a POST request using curl Following redirection Example: To view github’s pull request patch Viewing more details about the transfer Making multiple requests at once Inspecting HTTP headers Adding new HTTP headers Curl video/talk Curl book Users and Groups Finding the owner of file /etc/passwd file Details about groups wheel group Becoming superuser Adding a new user Changing user passwords Modifying existing user details Deleting a user Adding a new group Adding new group to an user File permissions chmod command PATH variable ~/.bash_profile file .bashrc file /etc/profile file which command Use which command to see how $PATH variable works she-bang or sha-bang in executable files Processes in Linux How to view all running processes? How to find a particular process? How to kill/stop a particular process? Finding out list of open files Signals top command Load average htop tool More about Linux processes /proc directory /proc/cpuinfo /proc/cmdline /proc/meminfo /proc/uptime /proc/sys/ & sysctl command Enabling IP forward with sysctl Linux Services What is a service? What is a daemon? What is the init system? Units in systemd .service units in systemd How to find all the systemd units in the system? Working with a particular service Enabling or disabling a service Shutdown or reboot the system using systemctl journalctl Finding the logs of a service To view only the last N entries Continuous stream of logs Listing of previous boots Time-based log viewing Total size of the journal logs Writing your own service file Securing a service using systemd Installing verybad service Vulnerabilities in the application Directory traversal vulnerability/ LFI Arbitary file write vulnerability Remote code execution (RCE) vulnerability Remove access to system’s tmp directory Protecting home dirctories Fixing directory paths DynamicUser Allowed Executables What is next? Package management dnf command Searching for a package Finding more information about a package Installing a package To list the available updates To list all security updates Update the packages via dnf Find out the services & applications need restart after update in Fedora/CentOS/RHEL Automatic updates in dnf systems apt command apt update Installing a package via apt apt-cache search Listing upgrades Upgrading packages Figuring out which services/processes need restart after package upgrade in Debian Listing available security updates in Debian systems Unattended upgrades in Debian systems SELinux SELinux Modes getenforce setenforce Labels/Contexts Checking contexts of files/directories or processes SELinux booleans File system mounting Connecting USB drives to your system Mounting a device Unmounting Encrypting drives with LUKS (for only Linux) Encrypting drives for any OS using Veracrypt Networking commands Finding the IP address Finding ARP table ping command Short note about DNS /etc/hosts /etc/resolv.conf systemd-resolved controlled name resolution resolvectl command host command dig command ss command traceroute command tracepath command Remote login to a computer using ssh tool ssh key generation ssh-copy-id Stop and disable the sshd service Disable password based login for ssh How to find active (open) network connections from your computer? To know about ports Linux Firewall Installation Tables, chains and rules filter table nat table iptables command View the existing rules Appending rules to INPUT chain Flushing all rules Example of a series of rules Delete a rule based on rule number Delete a rule directly Saving the rules A blog post from Major Hayden Debugging firewall rules Random things xclip to copy from terminal w command How long is the system running? Finding CPU time of a command dmesg command Setting up cron jobs Finding out details about previous logins or system reboots Whats next? Workbook How to use this workbook? copy paste Find your user id Creating softlinks Basic vim usage Adding a new user Deleting an existing user Finding the IP address of dgplug.org Change the local timezone of the system Add sudo access to an user Advanced section Containers Team Indices and tables Index
Related Books