This document provides information on Linux communication tools including wall, talk, write, mesg, and systemctl. It discusses how wall broadcasts messages to logged in users. It explains how talk and ytalk allow interactive chats between users. It covers how write sends text without email. It also discusses how mesg blocks or allows messages from other users. Finally, it provides an in-depth overview of the systemctl command for managing systemd services and units.
This document discusses Linux accounting and monitoring user activity. It begins with an overview of the yum and dnf package managers and how they can be used to install the psacct or acct packages for monitoring user activity. It then covers various commands provided by psacct/acct like ac, lastcomm, sa to view user login times, previously executed commands, and account activity summaries. The document also provides overviews of Kerberos for authentication, LDAP for user information storage, and lists some common system utility commands.
Tar is used to archive and compress files and directories in Linux. It can be installed using yum or apt-get depending on the distribution. Tar creates archives with options like c for create and z for gzip compression. The split and cat commands can be used to split large tar files into parts and combine them. Sed is used for text editing and search/replace tasks in files. The useradd and group commands are used for user and group management like creating, modifying, and deleting users and groups.
This document provides summaries of Linux system and administrative commands. It discusses commands for managing users and groups like useradd, userdel, chown, chgrp, id, who, logname, su, sudo, and passwd. It also covers commands for viewing system information like uname, arch, lastlog, and lsof. Finally, it summarizes terminal commands such as tty, stty, tset, mesg, and wall.
Linux Commands mentioned here includes basic as well advanced linux commands which we use on a daily basis. These commands can also help you to crack interview.
This document provides an overview of common Linux Ubuntu commands organized into the following sections:
1. System Information commands such as pwd, hostname, id, and date.
2. Basic operation commands including command help with --help and man, and file listing with ls.
3. File management commands for copying, moving, removing files and directories like cp, mv, rm, and mkdir.
4. Basic administration commands for user and group management including adduser, useradd, and groupadd.
5. Network commands for checking the network configuration and connectivity including ifconfig, ping, and nmap.
This document provides information on basic Linux commands and how to perform common system administration tasks in Ubuntu Server, including:
1. Adding and removing users, changing passwords, and enabling the root user.
2. Configuring network interfaces like Ethernet, setting the IP address, default gateway, and DNS servers.
3. Starting, stopping, and restarting network and other services.
4. Updating the Ubuntu Server using the software updater.
This document provides an overview of 27 basic Linux commands, including ls to list files, rm to remove files, rmdir to remove empty directories, cat to display file contents, cd to change directories, mv to move/rename files, who to display logged in users, mkdir to create directories, cp to copy files, and man to view command manuals. It also covers commands for permissions (chmod), clearing the screen (clear), viewing users (w), remote login (telnet), creating files (touch), editing files (vi), displaying date and time (date), viewing calendar (cal), showing IP address (ifconfig), and hostname.
This document provides an overview of various networking tools in Linux, including commands for network configuration (ifconfig, route), connectivity testing (ping, traceroute), name resolution (host, nslookup), port and protocol inspection (netstat, tcpdump), and secure remote access (SSH, PuTTY). It also covers tools for firewall management (ufw), network mapping (Nmap), raw socket programming (netcat), link status (ethtool), and more. Examples are given for common tasks like viewing routing tables, capturing packets, remotely controlling systems, and accessing services over Telnet versus SSH. A references section at the end provides additional learning resources.
This document discusses Linux accounting and monitoring user activity. It begins with an overview of the yum and dnf package managers and how they can be used to install the psacct or acct packages for monitoring user activity. It then covers various commands provided by psacct/acct like ac, lastcomm, sa to view user login times, previously executed commands, and account activity summaries. The document also provides overviews of Kerberos for authentication, LDAP for user information storage, and lists some common system utility commands.
Tar is used to archive and compress files and directories in Linux. It can be installed using yum or apt-get depending on the distribution. Tar creates archives with options like c for create and z for gzip compression. The split and cat commands can be used to split large tar files into parts and combine them. Sed is used for text editing and search/replace tasks in files. The useradd and group commands are used for user and group management like creating, modifying, and deleting users and groups.
This document provides summaries of Linux system and administrative commands. It discusses commands for managing users and groups like useradd, userdel, chown, chgrp, id, who, logname, su, sudo, and passwd. It also covers commands for viewing system information like uname, arch, lastlog, and lsof. Finally, it summarizes terminal commands such as tty, stty, tset, mesg, and wall.
Linux Commands mentioned here includes basic as well advanced linux commands which we use on a daily basis. These commands can also help you to crack interview.
This document provides an overview of common Linux Ubuntu commands organized into the following sections:
1. System Information commands such as pwd, hostname, id, and date.
2. Basic operation commands including command help with --help and man, and file listing with ls.
3. File management commands for copying, moving, removing files and directories like cp, mv, rm, and mkdir.
4. Basic administration commands for user and group management including adduser, useradd, and groupadd.
5. Network commands for checking the network configuration and connectivity including ifconfig, ping, and nmap.
This document provides information on basic Linux commands and how to perform common system administration tasks in Ubuntu Server, including:
1. Adding and removing users, changing passwords, and enabling the root user.
2. Configuring network interfaces like Ethernet, setting the IP address, default gateway, and DNS servers.
3. Starting, stopping, and restarting network and other services.
4. Updating the Ubuntu Server using the software updater.
This document provides an overview of 27 basic Linux commands, including ls to list files, rm to remove files, rmdir to remove empty directories, cat to display file contents, cd to change directories, mv to move/rename files, who to display logged in users, mkdir to create directories, cp to copy files, and man to view command manuals. It also covers commands for permissions (chmod), clearing the screen (clear), viewing users (w), remote login (telnet), creating files (touch), editing files (vi), displaying date and time (date), viewing calendar (cal), showing IP address (ifconfig), and hostname.
This document provides an overview of various networking tools in Linux, including commands for network configuration (ifconfig, route), connectivity testing (ping, traceroute), name resolution (host, nslookup), port and protocol inspection (netstat, tcpdump), and secure remote access (SSH, PuTTY). It also covers tools for firewall management (ufw), network mapping (Nmap), raw socket programming (netcat), link status (ethtool), and more. Examples are given for common tasks like viewing routing tables, capturing packets, remotely controlling systems, and accessing services over Telnet versus SSH. A references section at the end provides additional learning resources.
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
The Linux command line is a powerful tool. The majority of webservers run on Linux/Unix. Some hosting companies offer SSH access to their hosting environment. Via SSH you can login and use the Linux command line.
In this presentation, Peter will show you some time-saving command line commands that you can use for certain tasks on your Joomla websites:
some basic SSH command line commands
Analyzing & recovering a hacked website
Backup a website or move it to another server
Finding unused files
Setting up a test environment
This document discusses Linux file permissions and ownership. It explains that Linux uses a user/group ownership model where files and directories have read, write and execute permissions for the owner, group and others. It also describes how to change permissions and ownership using the chmod and chown commands. The document provides examples of using these commands and includes a lab activity asking the user to create files, set permissions on them, and test access.
The document provides summaries of common Linux commands, including their most common uses. Some key commands covered are ls, which lists files and directories; cd, which changes the current working directory; and man, which displays manuals for commands. The document also discusses commands for checking network connectivity like ping and ifconfig, managing processes like top and ps, and manipulating files and directories like touch, rm, and chmod.
This document provides a toolbox of Unix/Linux/BSD commands for system administration, networking, security, and development tasks. It contains over 20 sections that each cover a topic like the system, processes, file system, network configuration, encryption, version control, programming, and more. The document aims to be a practical guide for IT workers and advanced users, with concise explanations of commands.
Useful Linux and Unix commands handbookWave Digitech
This article provides practical examples for most frequently used commands in Linux / UNIX. Helpful for Engineers and trainee engineers, Software developers. A handy notes for all Linux & Unix commands.
Per chi incomincia addentrarsi nel magico mondo dei comandi da terminale la vita può essere dura. In rete esistono diverse guide, ma la “Linux Bash Shell Cheat Sheet for Beginners” di Raphael è qualcosa che i principianti dovrebbero tenere a portata di mano. La segnaliamo un po’ perchè è molto semplice e chiara, e un po’ perchè è stata scritta da un sedicenne canadese. Personalmente è una cosa che mi fa piacere, perchè dimostra che anche i giovanissimi si accostano a linux nel modo migliore, ovvero “imparo e a mia volta diffondo”.
The document discusses various networking commands used in Linux systems. It provides descriptions and examples of commands like ping, traceroute, mtr, host, whois, ifconfig, dhclient, netstat and more. These commands are used to test and monitor network connectivity, view routing tables, lookup domain information, configure network interfaces and more. Maintaining system and network uptime is a key task for system and network administrators.
This document provides an overview of the vi editor and standard input/output redirection in Unix/Linux. It begins with an introduction to vi, describing how to start and end a vi session, cursor movement commands, text insertion/deletion commands, searching, and find/replace. It then covers common filters like grep, sort, find, cut, and tr. The last section discusses input/output redirection, the standard files, and how to redirect input, output, errors, and combine redirections. The document is intended as a tutorial for learning basic vi and I/O redirection skills.
The document provides information about shells in Linux operating systems. It defines what a kernel and shell are, explains why shells are used, describes different types of shells, and provides examples of shell scripting. The key points are:
- The kernel manages system resources and acts as an intermediary between hardware and software. A shell is a program that takes commands and runs them, providing an interface between the user and operating system.
- Shells are useful for automating tasks, combining commands to create new ones, and adding functionality to the operating system. Common shells include Bash, Bourne, C, Korn, and Tcsh.
- Shell scripts allow storing commands in files to automate tasks.
Linux uses a hierarchical file system structure with directories like /bin, /sbin, /etc to organize binaries, configuration files, and other resources. Users can navigate this structure using commands like cd, ls, and pwd. Files can be viewed, copied, moved, deleted and have their permissions and attributes modified using commands like cat, cp, mv, rm, chmod and chown. Output from commands can be redirected, piped to other commands, or used for command substitution. The find command allows searching for files.
Linux is an operating system similar to Unix. The document lists and describes 30 basic Linux commands, including commands for listing files (ls), removing files and directories (rm, rmdir), displaying file contents (cat, more, less), changing directories (cd), copying and moving files (cp, mv), searching for files and text (grep, locate), and getting system information (who, finger, uptime, w). It also covers commands for file permissions (chmod), symbolic links (ln), clearing the terminal (clear), rebooting the system (reboot), and calculating with a built-in calculator (bc).
55 best linux tips, tricks and command linesArif Wahyudi
This document provides 55 tips, tricks, and Linux command lines contributed by readers. It begins with instructions for backing up and restoring Thunderbird emails manually by copying the profile folder. It then offers examples of using SSH to execute commands on remote Linux machines. The tips cover a wide range of Linux tasks like scheduling commands to run after reboot, commenting out config file lines, replacing newlines in files, checking installed shell types, using advanced LS commands, checking for rootkits, finding and replacing text with SED, backing up MySQL databases, and cutting/joining MP3 files.
50 most frequently used unix linux commands (with examples)Rodrigo Maia
This document provides examples for 50 common Linux commands, including tar, grep, find, ssh, sed, awk, vim, diff, sort, and more. It explains practical uses for each command and provides short code snippets to demonstrate basic functionality. The commands cover a wide range of tasks like archiving, searching, editing, comparing, and managing files, processes and system resources.
This document provides an overview of common Linux networking commands such as ifconfig, route, traceroute, nslookup, arp, dig, and netstat that are used to configure network interfaces, display routing tables, trace network routes, lookup domain names, manage address resolution, query DNS servers, and view network statistics. It also discusses how to use ifconfig to assign IP addresses to interfaces, route to view routing tables, arp to manage the address resolution cache, and dig for more powerful DNS lookups than nslookup.
The document provides descriptions of various Linux commands for basic usage and pentesting. It describes commands for making directories (mkdir), deleting empty directories (rmdir), viewing processes (ps), checking username (whoami), checking disk space (df), displaying date and time (date), checking connectivity (ping), downloading files (wget), looking up domain registration records (whois), navigating directories (cd), listing directory contents (ls), displaying command manuals (man), displaying text files (cat), copying files (cp), moving and renaming files (mv), removing files and directories (rm), creating empty files (touch), searching files (grep), using administrative privileges (sudo), viewing start of files (head), viewing end of files (
This document provides an introduction to Linux, including:
- What Linux is and where it came from, as an open source operating system created by Linus Torvalds in 1991.
- How to get Linux through downloading a distribution like Red Hat and the packages it includes.
- Why Linux has become significant due to its growing popularity, ability to run on multiple hardware platforms, and being free.
- An overview of Linux commands and utilities for file management, processes, users and permissions.
This document provides a summary of useful Linux commands for starting and stopping the system, accessing and mounting file systems, finding files and text, moving, copying, deleting, and viewing files, installing software, user administration, and the X Window System. It lists commands such as shutdown, halt, reboot, mount, umount, find, locate, updatedb, which, grep, ls, rpm, tar, adduser, passwd, su, and exit along with brief explanations of their functions.
This document provides an overview of various Unix/Linux commands and concepts. It discusses the introduction to Unix including defining an operating system and its functionalities. It describes the evolution and structure of Unix. It covers usage of simple commands like date, who, ls and file commands like cat, cp, mv etc. It explains the Unix file system hierarchy and concepts like input/output redirection and wildcards. It also discusses environmental variables, file permissions and commands related to pipes and filters like sort and grep. Finally, it talks about editors like vi and shell programming concepts.
Linux is a prominent example of free and open source software. It can be installed on a wide variety of devices from embedded systems to supercomputers. Linux is commonly used for servers, with estimates that it powers around 60% of web servers. Linux distributions package the Linux kernel with other software like utilities, libraries and desktop environments. Programming languages and build tools like GCC are supported. Embedded Linux is often used in devices due to its low cost and ease of modification.
The document discusses two new features in systemd for relating services and processes:
1) The ps command has been updated to show process control groups (cgroups), allowing users to see which service each process belongs to.
2) Each process spawned by a service is placed into a cgroup named after the service, ensuring processes are reliably labeled after the service that started them even if they change names or parentage. This allows services and their processes to be easily managed as a group.
- systemd tracks which processes belong to which services using control groups (cgroups)
- This allows administrators to see which processes are owned by each service using the ps command
- It also allows services and all their processes to be killed safely without risk of processes escaping the service's cgroup
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
The Linux command line is a powerful tool. The majority of webservers run on Linux/Unix. Some hosting companies offer SSH access to their hosting environment. Via SSH you can login and use the Linux command line.
In this presentation, Peter will show you some time-saving command line commands that you can use for certain tasks on your Joomla websites:
some basic SSH command line commands
Analyzing & recovering a hacked website
Backup a website or move it to another server
Finding unused files
Setting up a test environment
This document discusses Linux file permissions and ownership. It explains that Linux uses a user/group ownership model where files and directories have read, write and execute permissions for the owner, group and others. It also describes how to change permissions and ownership using the chmod and chown commands. The document provides examples of using these commands and includes a lab activity asking the user to create files, set permissions on them, and test access.
The document provides summaries of common Linux commands, including their most common uses. Some key commands covered are ls, which lists files and directories; cd, which changes the current working directory; and man, which displays manuals for commands. The document also discusses commands for checking network connectivity like ping and ifconfig, managing processes like top and ps, and manipulating files and directories like touch, rm, and chmod.
This document provides a toolbox of Unix/Linux/BSD commands for system administration, networking, security, and development tasks. It contains over 20 sections that each cover a topic like the system, processes, file system, network configuration, encryption, version control, programming, and more. The document aims to be a practical guide for IT workers and advanced users, with concise explanations of commands.
Useful Linux and Unix commands handbookWave Digitech
This article provides practical examples for most frequently used commands in Linux / UNIX. Helpful for Engineers and trainee engineers, Software developers. A handy notes for all Linux & Unix commands.
Per chi incomincia addentrarsi nel magico mondo dei comandi da terminale la vita può essere dura. In rete esistono diverse guide, ma la “Linux Bash Shell Cheat Sheet for Beginners” di Raphael è qualcosa che i principianti dovrebbero tenere a portata di mano. La segnaliamo un po’ perchè è molto semplice e chiara, e un po’ perchè è stata scritta da un sedicenne canadese. Personalmente è una cosa che mi fa piacere, perchè dimostra che anche i giovanissimi si accostano a linux nel modo migliore, ovvero “imparo e a mia volta diffondo”.
The document discusses various networking commands used in Linux systems. It provides descriptions and examples of commands like ping, traceroute, mtr, host, whois, ifconfig, dhclient, netstat and more. These commands are used to test and monitor network connectivity, view routing tables, lookup domain information, configure network interfaces and more. Maintaining system and network uptime is a key task for system and network administrators.
This document provides an overview of the vi editor and standard input/output redirection in Unix/Linux. It begins with an introduction to vi, describing how to start and end a vi session, cursor movement commands, text insertion/deletion commands, searching, and find/replace. It then covers common filters like grep, sort, find, cut, and tr. The last section discusses input/output redirection, the standard files, and how to redirect input, output, errors, and combine redirections. The document is intended as a tutorial for learning basic vi and I/O redirection skills.
The document provides information about shells in Linux operating systems. It defines what a kernel and shell are, explains why shells are used, describes different types of shells, and provides examples of shell scripting. The key points are:
- The kernel manages system resources and acts as an intermediary between hardware and software. A shell is a program that takes commands and runs them, providing an interface between the user and operating system.
- Shells are useful for automating tasks, combining commands to create new ones, and adding functionality to the operating system. Common shells include Bash, Bourne, C, Korn, and Tcsh.
- Shell scripts allow storing commands in files to automate tasks.
Linux uses a hierarchical file system structure with directories like /bin, /sbin, /etc to organize binaries, configuration files, and other resources. Users can navigate this structure using commands like cd, ls, and pwd. Files can be viewed, copied, moved, deleted and have their permissions and attributes modified using commands like cat, cp, mv, rm, chmod and chown. Output from commands can be redirected, piped to other commands, or used for command substitution. The find command allows searching for files.
Linux is an operating system similar to Unix. The document lists and describes 30 basic Linux commands, including commands for listing files (ls), removing files and directories (rm, rmdir), displaying file contents (cat, more, less), changing directories (cd), copying and moving files (cp, mv), searching for files and text (grep, locate), and getting system information (who, finger, uptime, w). It also covers commands for file permissions (chmod), symbolic links (ln), clearing the terminal (clear), rebooting the system (reboot), and calculating with a built-in calculator (bc).
55 best linux tips, tricks and command linesArif Wahyudi
This document provides 55 tips, tricks, and Linux command lines contributed by readers. It begins with instructions for backing up and restoring Thunderbird emails manually by copying the profile folder. It then offers examples of using SSH to execute commands on remote Linux machines. The tips cover a wide range of Linux tasks like scheduling commands to run after reboot, commenting out config file lines, replacing newlines in files, checking installed shell types, using advanced LS commands, checking for rootkits, finding and replacing text with SED, backing up MySQL databases, and cutting/joining MP3 files.
50 most frequently used unix linux commands (with examples)Rodrigo Maia
This document provides examples for 50 common Linux commands, including tar, grep, find, ssh, sed, awk, vim, diff, sort, and more. It explains practical uses for each command and provides short code snippets to demonstrate basic functionality. The commands cover a wide range of tasks like archiving, searching, editing, comparing, and managing files, processes and system resources.
This document provides an overview of common Linux networking commands such as ifconfig, route, traceroute, nslookup, arp, dig, and netstat that are used to configure network interfaces, display routing tables, trace network routes, lookup domain names, manage address resolution, query DNS servers, and view network statistics. It also discusses how to use ifconfig to assign IP addresses to interfaces, route to view routing tables, arp to manage the address resolution cache, and dig for more powerful DNS lookups than nslookup.
The document provides descriptions of various Linux commands for basic usage and pentesting. It describes commands for making directories (mkdir), deleting empty directories (rmdir), viewing processes (ps), checking username (whoami), checking disk space (df), displaying date and time (date), checking connectivity (ping), downloading files (wget), looking up domain registration records (whois), navigating directories (cd), listing directory contents (ls), displaying command manuals (man), displaying text files (cat), copying files (cp), moving and renaming files (mv), removing files and directories (rm), creating empty files (touch), searching files (grep), using administrative privileges (sudo), viewing start of files (head), viewing end of files (
This document provides an introduction to Linux, including:
- What Linux is and where it came from, as an open source operating system created by Linus Torvalds in 1991.
- How to get Linux through downloading a distribution like Red Hat and the packages it includes.
- Why Linux has become significant due to its growing popularity, ability to run on multiple hardware platforms, and being free.
- An overview of Linux commands and utilities for file management, processes, users and permissions.
This document provides a summary of useful Linux commands for starting and stopping the system, accessing and mounting file systems, finding files and text, moving, copying, deleting, and viewing files, installing software, user administration, and the X Window System. It lists commands such as shutdown, halt, reboot, mount, umount, find, locate, updatedb, which, grep, ls, rpm, tar, adduser, passwd, su, and exit along with brief explanations of their functions.
This document provides an overview of various Unix/Linux commands and concepts. It discusses the introduction to Unix including defining an operating system and its functionalities. It describes the evolution and structure of Unix. It covers usage of simple commands like date, who, ls and file commands like cat, cp, mv etc. It explains the Unix file system hierarchy and concepts like input/output redirection and wildcards. It also discusses environmental variables, file permissions and commands related to pipes and filters like sort and grep. Finally, it talks about editors like vi and shell programming concepts.
Linux is a prominent example of free and open source software. It can be installed on a wide variety of devices from embedded systems to supercomputers. Linux is commonly used for servers, with estimates that it powers around 60% of web servers. Linux distributions package the Linux kernel with other software like utilities, libraries and desktop environments. Programming languages and build tools like GCC are supported. Embedded Linux is often used in devices due to its low cost and ease of modification.
The document discusses two new features in systemd for relating services and processes:
1) The ps command has been updated to show process control groups (cgroups), allowing users to see which service each process belongs to.
2) Each process spawned by a service is placed into a cgroup named after the service, ensuring processes are reliably labeled after the service that started them even if they change names or parentage. This allows services and their processes to be easily managed as a group.
- systemd tracks which processes belong to which services using control groups (cgroups)
- This allows administrators to see which processes are owned by each service using the ps command
- It also allows services and all their processes to be killed safely without risk of processes escaping the service's cgroup
- systemd tracks which processes belong to which services using control groups (cgroups)
- This allows administrators to see which processes are owned by each service using the ps command
- It also allows services and all their processes to be killed safely without risk of processes escaping the service's cgroup
The document discusses controlling services and daemons using systemd on Linux systems. It begins by describing how systemd manages system startup processes and services. Common unit types like service, socket, and path units are described. The status of units can be checked using systemctl commands like status, list-units, and is-enabled. The document then demonstrates how to control services at runtime using systemctl to stop, start, restart, and reload services. It shows how the process IDs change with these actions. Finally, it briefly mentions that services can be dependencies of each other and triggered by path units for things like printing.
The document provides instructions for installing and configuring various Linux server applications and services, including Jabberd, Sendmail, Qpopper, Squirrelmail, Samba, and others. It describes downloading and extracting source files, editing configuration files, and commands to compile, install, and start the servers. The instructions are provided in a step-by-step format intended for novice Linux system administrators.
CoreOS, or How I Learned to Stop Worrying and Love SystemdRichard Lister
Ric Lister presents patterns for running Docker in production on CoreOS, including a simple homogeneous operations cluster where sidekick units announce services in etcd and a reverse proxy discovers them, an etcd and workers pattern for low-traffic sites behind a load balancer, and an immutable servers pattern without etcd for high-traffic microservices with strict change control. He also discusses logging to ship container output off hosts, various monitoring options, alternative operating systems like RancherOS and Atomic, and scheduler options like Kubernetes, Mesos, and Deis.
The document discusses key concepts in distributed systems including networking, remote procedure calls (RPC), and transaction processing systems (TPS). It covers networking fundamentals like sockets and ports. It describes how RPC works by allowing functions to be called remotely. It explains the ACID properties that TPS must support for atomicity, consistency, isolation, and durability of transactions processed across distributed systems.
This document provides an overview of various PowerShell commands for system administration tasks. It describes commands for getting help (Get-Help), viewing the execution policy (Get-ExecutionPolicy, Set-ExecutionPolicy), listing services (Get-Service), exporting data to HTML and CSV formats (ConvertTo-HTML, Export-CSV), filtering output (Select-Object), viewing event logs (Get-EventLog), managing processes (Get-Process, Stop-Process), searching Active Directory (Search-ADAccount), checking drives (Psdrive), running scripts, using pipes to string commands together, and addressing permissions issues. The document also includes examples of using these commands.
The document discusses a TCP server and client example for looking up zip codes. It provides code for a server that listens for connections on port 6000 and responds to "ZipCode" and "Quit" commands by looking up zip codes from a file and disconnecting. It also provides code for a client that connects to the server, sends zip code lookup requests, reads the responses, and disconnects. Key aspects covered include using blocking sockets, threading models in Indy servers, and how the examples can be tested using Telnet.
This document summarizes the steps taken to solve a Capture the Flag (CTF) challenge involving accessing a file called flag.txt across multiple systems. The CTF was broken into levels involving bypassing login, local file inclusion, uploading a web shell via FTP, gaining remote desktop access, creating users, scanning ports, and ultimately reading the flag file from a database server. A variety of techniques were used, including SQL injection, file path manipulation, and exploiting unsecured services.
This document provides guidance on creating and managing services in Delphi. It discusses how to create a new service project, implement key service events like OnStart and OnStop, and ensure the service remains running through the use of a loop. It also demonstrates how to pass service state changes to any worker threads, and how to install and uninstall the service. The full example code shows integrating all these elements into a complete Windows service application.
This document provides a cheat sheet of common Linux commands and their usage. It covers basic file operations like copying, moving, deleting files and directories. It also includes commands for viewing files, compressing/decompressing files, finding files, remote access, and getting system information. The commands are explained over 3 pages with examples of proper syntax and usage for each one.
This document provides a cheatsheet comparing commands for managing services and system states between SysV init and systemd. It lists the equivalent systemd commands for common SysV init commands like service, chkconfig, and runlevels. It also covers commands for viewing and filtering journal logs, changing targets/runlevels, and rebooting/powering off the system.
The document provides summaries of common Linux commands, including their most common uses. Some key commands covered are ls, which lists files and directories; cd, which changes the current working directory; and man, which provides documentation for other commands. The document also discusses commands for viewing system processes and users, like top, w, who, and finger.
The document provides summaries of common Linux commands, including their most common uses. Some key commands covered are ls, which lists files and directories; cd, which changes the current working directory; and man, which provides documentation for other commands. The document also discusses commands for viewing system processes and users, like top, w, who, and finger.
This document summarizes the steps taken in a Capture the Flag (CTF) challenge to read a file called flag.txt located at http://192.168.56.10/. The challenge involved 7 levels that exploited vulnerabilities like SQL injection, file inclusion, and remote desktop access to ultimately gain a shell on the database server at 192.168.56.12 in order to find the flag file. Detailed commands and techniques are provided for each level to bypass authentication, read local files, upload a web shell, enable remote desktop, scan for open ports, and execute commands on the database server.
An introduction to the Docker concept. Experiences with ASP.NET Core and Docker, How Docker can help produce modular deployments for ASP.NET web applications. Presented at Vermont Code Camp #8, UVM, Burlington VT, September 17, 2016
This document provides information about installing and configuring Linux, Apache web server, PostgreSQL database, and Apache Tomcat on a Linux system. It discusses installing Ubuntu using VirtualBox, creating users and groups, setting file permissions, important Linux files and directories. It also covers configuring Apache server and Tomcat, installing and configuring PostgreSQL, and some self-study questions about the Linux boot process, run levels, finding the kernel version and learning about NIS, NFS, and RPM package management.
Linux is a reliable, secure, and customizable operating system. It can run on a variety of hardware from small CPUs to supercomputers. Over a billion people easily use Linux daily through Android smartphones without manuals. While common tasks are easy in Linux, its open nature allows for unlimited customization, which can be challenging but rewarding for meeting new requirements. Multiple vendors support Linux, improving reliability as anyone can quickly fix issues.
The document discusses lessons about investing in cryptocurrencies. It notes that as more speculators entered the market, cryptocurrency prices began fluctuating wildly without reason. This demonstrates Benjamin Graham's idea that markets can price things irrationally. The document emphasizes long-standing rules for investors such as knowing a business's value before buying, not investing with borrowed money, and investing for the long term. It concludes by advising investing in one's own companies or a group with serious, hard-working people of integrity.
This document provides an overview of awk, cron, and shell scripting. It includes examples of using awk to parse text files and extract specific fields. Built-in awk variables like NR, NF, FS are described. Cron is introduced but not explained in detail. Links are provided for more information on awk, crontab, and shell scripting. Quizzes from an online course are listed.
This document provides an overview of file systems, including:
- File systems separate data into named files and provide structure and logic for managing these files.
- There are many different types of file systems designed for different storage media and applications.
- Common file systems for Linux include Ext2, Ext3, Ext4, and ZFS. Ext2-4 are suitable for most systems while ZFS is better for storage servers with multiple disks.
- Commands covered include find, locate, updatedb, wildcards, soft/hard links, file ownership, help utilities, tab completion, and redirection.
This document provides an overview of Linux commands and file systems. It begins with an agenda that covers file name conventions, changing passwords, the Filesystem Hierarchy Standard (FHS), file system types, and commands like find, locate, updatedb, and wildcards. It then discusses file names, changing passwords with a demo, and the FHS. Next, it defines what a file system is and describes different types including their structures, properties, applications, and storage devices. It notes important Linux file systems like ext2, ext3, ext4, and ZFS. The document concludes with explanations and demos of commands like directory shortcuts, find, locate, updatedb, wildcards, links, and practical examples.
The document describes the standard file hierarchy structure (FHS) used in Linux systems. It details the purpose and typical contents of the top-level directories, including /bin for executable binaries, /boot for files used during the boot process, /dev for device files, and /etc for configuration files of installed software. Maintaining this structure allows for easy backup and restoration of a system's configuration through copying just the /etc directory.
This document provides information on various topics related to file systems and passwords in Linux/Unix. It begins with discussing password standards and storing passwords. It then covers different file system types including Ext2/3/4 and ZFS, and how the file system manages file access and metadata. The rest of the document discusses features of the ZFS file system in detail. It concludes by mentioning how to change passwords using the passwd command and introduces some common Linux commands.
Linux is an open-source operating system that can be accessed remotely via SSH or locally. The passwd command allows users to change their password and enforces strong standards like complexity and expiration dates to improve security. Learning Linux provides flexibility and many free tools that can benefit both personal and professional use.
Linux is used in many everyday devices and systems. It powers technologies like Android phones, Google services, NASA systems, eReaders, smart TVs, smartwatches, laptops, vehicles, gaming platforms, social media sites, stock exchanges, government systems, retail point-of-sale devices, routers, and more. Linux provides advantages like reliability, flexibility, customizability, support from many vendors, and ability to run on a wide variety of hardware.
Ken Thompson is an American computer scientist who designed the original Unix operating system and invented the B programming language, the predecessor to C. Dennis Ritchie created the C language and collaborated with Thompson on Unix. Richard Stallman launched the GNU Project to develop a free Unix-like operating system and founded the Free Software Foundation. He pioneered the concept of copyleft through licenses like the GPL. Linus Torvalds created the Linux kernel, which combined with GNU software forms a fully functional operating system, and also created the Git version control system.
Artificial intelligence (AI) is the simulation of human intelligence processes by machines, especially computer systems. These processes include learning, reasoning, and self-correction. AI aims to create intelligent machines that can perform tasks like speech recognition, learning, planning, problem solving, and manipulating objects. Research in AI is highly technical and focuses on programming computers with traits such as knowledge, reasoning, problem solving, perception, learning, and planning. It also involves areas like machine learning, knowledge engineering, classification, machine perception, and robotics.
This document discusses various uses of AI in banking, including:
1) Know Your Customer/Client (KYC) and fraud detection using machine learning to analyze transactions and communications.
2) Anomaly detection using time series analysis to flag suspicious transaction patterns in real-time.
3) Customer churn prediction analyzing complex customer behavior data to identify at-risk customers.
This document outlines reasons to invest in an electric vehicle (EV) business in Karachi, Pakistan. It notes that EVs can provide transport at less than 5 Pakistani rupees per kilometer. With over 3.6 million cars in Karachi, the market size is significant. EVs also offer maximum warranty durations and are following a global trend. Investors are likely to profit more from this project than others. An update provides details on progress converting initial cars to EVs and selecting components like motors, batteries, and controllers. It requests further funding to complete conversions and notes six current investors.
This document outlines five reasons to invest in the author's electric vehicle (EV) business: 1) EVs can transport people at less than Rs. 5 per km, offering a unique selling point. 2) The large market size of 3.6 million cars in Karachi. 3) EVs provide maximum warranty duration and reliability. 4) EVs are an emerging trend. 5) Investors are likely to profit more from this project than others. The author invites contact for further discussion and addresses any reservations about the investment opportunity.
This document discusses RevOps, which aims to align people, processes, and platforms within a business to efficiently generate revenue. It is broken down into several parts, including operations management, team enablement, insights team, and tools team. Operations management involves sales management, marketing management, and project management. Team enablement includes sales enablement, learning management, and performance management. The insights team consists of business analysts, data scientists, and database designers. Finally, the tools team has system administrators and software developers. The document promotes RevOps training and certification through the ROCKET program offered by the RevOps Institute.
The objective of this presentation is to list the management topics which are of importance and known.
Most of the new comers do not know the topics.
So this is to be taken as a list and a short description. And you can get the details from the internet for each topic.
Contact information :
Khawar Nehal
http://atrc.net.pk
+92 343 270 2932
+92 331 2036 422
khawar@atrc.net.pk
The KONA system uses sensors around corners and junctions to provide information about the surrounding environment to vehicles. This allows vehicles, including autonomous vehicles, to better understand situations without relying solely on onboard sensors. The system transmits multiple types of sensor data and coordinates vehicles through protocols detailed in pending patents. Benefits include improved safety, more efficient traffic flow as autonomous vehicles could navigate intersections without stopping, and new applications like priority for emergency vehicles. The inventor welcomes developers and investors to collaborate on further developing and realizing the vision of this system.
This document outlines 13 forms of value that a business can provide:
1) Resale - buying in bulk and reselling in smaller quantities at a higher price.
2) Loan - borrowing an item and collecting payment over time or as a lump sum.
3) Lease - renting out an item for a fee, or selling it at the end of a leasing contract.
4) Option - keeping an offer available for a set period of time in exchange for a fee.
Reasons for security lapses
There are three main ways a security breach occurs.
They are :
Control of the user account.
Mistake in the Configuration.
Mistake or bug in the software.
Physical Access to the machine.
More from Khawar Nehal khawar.nehal@atrc.net.pk (20)
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
Thinking of getting a dog? Be aware that breeds like Pit Bulls, Rottweilers, and German Shepherds can be loyal and dangerous. Proper training and socialization are crucial to preventing aggressive behaviors. Ensure safety by understanding their needs and always supervising interactions. Stay safe, and enjoy your furry friends!
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
Physiology and chemistry of skin and pigmentation, hairs, scalp, lips and nail, Cleansing cream, Lotions, Face powders, Face packs, Lipsticks, Bath products, soaps and baby product,
Preparation and standardization of the following : Tonic, Bleaches, Dentifrices and Mouth washes & Tooth Pastes, Cosmetics for Nails.
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
5. wall
A sysadmin might send out a message like this:
$ wall The system will be going down in 15
minutes to address a serious problem
6. wall
Everyone logged into the system will see
something like this:
Broadcast message from admin@dragonfly
(pts/0) (Thu Mar 5 08:56:42 2020):
The system is going down in 15 minutes to
address a serious problem
7. wall
If you want to use single quote marks in your
message, enclose the message in double quote
marks like this:
$ wall “Don’t forget to save your work before
logging off”
The outside quote marks will not show up in the
transmitted message, but, without them, the
command sits and waits for a closing single quote.
8. mesg
If, for some reason, you don’t want to accept
messages from another user, you can stop them
from arriving with the mesg command. This
command can be used with a “n” argument to
refuse mail from the user or a “y” argument to
allow the messages to arrive.
$ mesg n doug
$ mesg y doug
9. mesg
The blocked user will not be notified that their
messages have been blocked. You can also block
or allow all messages with a mesg command like
one of these:
$ mesg y
$ mesg n
10. write
Another command for sending text without
reverting to email is write. This command can be
used to communicate with a specific user.
$ write nemo
Are you still at your desk?
I need to talk with you right away.
^C
11. write
If the user you are trying to write to has messages
blocked, you should see something like this:
$ write nemo
write: nemo has messages disabled
12. write
Enter your text and use ^C to exit when you’re
done. The command allows you to send text, but
doesn’t start a two-way conversation.
It just sends the text. If the user is logged in on
more than one terminal, you can specify which
terminal you want to send the message to or you
can rely on the system to choose the one with the
shortest idle time.
$ write nemo#1
13. talk/ytalk
The talk or ytalk command gives you a chance to
have an interactive chat with one or more other
users. The command will bring up a double-pane
(top and bottom) window.
Each individual will type into the top portion of the
display on their screen and see the responses in
the bottom section(s).
The respondents can respond to a talk request by
typing "talk" followed by the username of the
person addressing them.
15. talk/ytalk
The window can involve more than two
participants if ytalk is used.
As you can see in the example below (the result
of the "talk dory" command shown above), talk is
often ytalk.
----------------------------= YTalk version 3.3.0 =--------------------------
Is the report ready?
-------------------------------= nemo@dragonfly =----------------------------
Just finished it
16. talk/ytalk
As explained above, on the other side of the conversation, the talk session
window panes are reversed:
----------------------------= YTalk version 3.3.0 =--------------------------
Just finished it
-------------------------------= dory@dragonfly =----------------------------
Is the report ready?
Again, use ^C to exit.
17. talk/ytalk
To talk with someone on another system, you just need to add a -h option and
the hostname or IP address with a command like this:
$ talk -h 192.168.0.11 nemo
18. Active directory and components
Active Directory, LDAP and Kerberos shall be
covered in a future class after it is working on my
system. Requires a day or two to prepare well.
19. Systemctl
The systemctl command is a utility which is
responsible for examining and controlling the
systemd system and service manager.
It is a collection of system management libraries,
utilities and daemons which function as a
successor to the System V init daemon.
21. Systemctl
Managing Services
What is a Service?
In the systemd utility, a service is referred to as a
unit. A unit is any resource that the system knows
how to act on and administrate. A unit is the
principal object that the systemd tools know how
to address. These assets are defined in a
configuration file called a unit file.
22. Systemctl
Check Service Status
Using systemctl, we can check the status of any
systemd service on the managed dedicated
server. The status command provides information
about a service. It also lists the running state, or
detail on why it is not running, or if a service has
been stopped unintentionally. If we are connected
to the server as a non-root user, we will have to
run the systemctl commands using.
systemctl status servicename.service
23. Systemctl
This unit can be called without the .service
extension. Since systemctl will look for those files
with .service suffix, the command can also be
used like this.
systemctl start servicename
24. Systemctl
Example of status output:
[root@host ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset:
disabled)
Active: active (running) since Fri 2020-05-08 14:15:54 EDT; 1 weeks 2 days ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 3767 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited,
status=0/SUCCESS)
Main PID: 1321 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─1321 /usr/sbin/httpd -DFOREGROUND
├─3769 /usr/sbin/httpd -DFOREGROUND
25. Systemctl
Starting or Stopping a Service
The systemctl utility can also be used to start or stop systemd services using a service
unit file, with or without that .service suffix.
systemctl start servicename.service
The same rules apply when we want to stop a specific service.
systemctl stop servicename.service
Keep in mind that the start order can only be used on systemd services that are not
currently running, and the stop command used only with running services.
26. Systemctl
Restarting or Reloading a Service
A running service can be restarted using the restart command to avoid stopping and
starting it manually using the following command.
systemctl restart servicename.service
Occasionally, we do not need to restart a service to apply configuration changes, if any
were you made. Instead, we can use the reload command to restart the service which
implements any changes to the running service.
systemctl reload servicename.serivce
If we are not sure about which of the two commands we should use, there is an additional
option using the reload-or-restart command which will automatically determine it for us.
systemctl reload-or-restart servicename.service
27. Systemctl
Enable or Disable a Service
When it comes to cloud server services, we require most of them to be online and active
all the time. Starting them manually is not a convenient method to employ, due to the
number of services required to run on a server. This is where the enable and disable
commands come into play. Using the enable command, we can modify how the systemd
service responds once the server has been started or rebooted. It will update the service
settings, which then tells systemd that the specific service needs to start up automatically,
once the server is up. The command to accomplish this is as follows.
systemctl enable servicename.service
While most of the services like HTTPD, MySQL, MariaDB, etc. will have already
automatically started, we may need to enable the automatic startup for some of them
manually. Similar to how we can set a service to automatically start when the server boots
up, we can also disable a service using the following command.
systemctl reload-or-restart servicename.service
The disable command prevents the automatic startup of a service at boot time, leaving it
inactive until it started manually.
28. Systemctl
System State Overview
All the systemctl commands that we have covered are mainly used to manage individual
services. Let's review some other commands systemctl has to offer and their uses.
30. Systemctl
What is a Unit File?
A unit file is a flat text file that contains information about a service, socket, device, mount
point, swap file, partition, start-up target, an asset management slice, or a group of
externally created processes.
Working with Unit Files
List Units
The list-units command displays all the active systemd services on your server. Our
output is similar to the information provided by the systemctl status command, but not as
detailed.
systemctl list-units
31. Systemctl
Here is the example of the output of that command.
root@host [~]# systemctl list-units
UNIT LOAD ACTIVE SUB DESCRIPTION
crond.service loaded active running Command Scheduler
dovecot.service loaded active running Dovecot IMAP/POP3 email server
firewalld.service loaded active running firewalld - dynamic firewall daemon
httpd.service loaded active running The Apache HTTP Server
mariadb.service loaded active running MariaDB database server
named.service loaded active running Berkeley Internet Name Domain (DNS)
32. Systemctl
Now that we have an example of the output, let's review the meaning of each column.
UNIT: The name of the systemd unit.
LOAD: This indicates if the unit's configuration is being loaded by systemd. If it is, the
configuration is stored in the server's memory.
ACTIVE: This states the status of the unit and shows whether it is active or not.
SUB: This provides more detailed information about the unit, which will vary depending
on the type of unit, state, and the method the unit runs in.
DESCRIPTION: This short description contains what each unit is and what it does.
33. Systemctl
Unit States
Using the systemctl list-units command will reveal all the units that are “loaded” and
“active” state in the LOAD and ACTIVE columns; however, if we wish to get a more
detailed list of all the services, we need to employ the usage of command flag. In this
case, the --all flag.
systemctl list-units --all
Using the -all flag, we can obtain a list of all the systemd units that are loaded or that
systemd has tried to load. This output will also show the services that are currently in an
inactive, dead, failed state, or that have not been found on the disk of the server.
34. Systemctl
While this flag provides the full output of all the units on the server, which systemd loaded
into memory, we can use additional flags to further filter the output of list-units. One of
them would be the --state= flag. We can use this flag to further filter the state in the
LOAD, ACTIVE, and SUB columns.
systemctl list-units --all --state=failed
Just as we can filter out the units by their state, we can also use the same type to
accomplish the same task.
systemctl list-units --all --type=mount
35. Systemctl
The list-units command displays the units that systemd has loaded or attempted to load
into memory. But, what about the units that are not in the systemd memory? This is where
the list-unit-files flag comes into play, as this command will display all available units on
the server.
systemctl list-unit-files
36. Systemctl
The output will be given in two columns with the name of a file and state.
UNIT FILE STATE
Proc-sys-fs-binfmt_misc.automount static
dev-hugepages.mount static
dev-mqueue.mount static
proc-sys-fs-binfmt_misc.mount static
sys-fs-fuse-connections.mount static
sys-kernel-config.mount static
sys-kernel-debug.mount static
tmp.mount disabled
The STATE column had four different states, which are:
Enabled
Disabled
Static
Masked
37. Systemctl
Masked Units
As you can see in the output above, many of the units show a staticSTATE status. This indicates that
those units do not have an “install” section within the unit's configuration file, and therefore, cannot
be enabled. On the other hand, some units may be masked, and as such, we will not be able to start
it. Masked units will provide output using the start command if we attempt to launch it.
systemctl start servicename.service
Failed to start servicename.service: Unit is masked.
Unmasking a unit is simple and will return the unit to the state where it can be started or enabled.
systemctl unmask servicename.service
38. Systemctl
Creating a Unit File
Occasionally, we may need to create a unit file for a custom daemon or another instance of an
already existing service. The creation of a unit file is executed via the root user in the
/etc/systemd/system/ directory. This is accomplished like so.
touch /etc/systemd/system/servicename.service
chmod 644 /etc/systemd/system/servicename.service
39. Systemctl
Next, we will open the newly created unit file in a text editor (like vim or nano) and add the service
configuration options. Below, we can see a basic example of the unit file.
[Unit]
Description=This is the manually created service
After=network.target
[Service]
ExecStart=/path/to/executable
[Install]
WantedBy=multi-user.target
40. Systemctl
Let’s quickly breakdown what these settings mean before we proceed further:
Description: The description is the description of the service, and will be displayed when we use
the systemctl status command for the created service.
After: The After setting indicates that a service will only start on reboot after a specified target or
another service has been started.
ExecStart: The ExecStart is the path to the actual executable file of the service.
WantedBy: The WantedBy setting states the target that the service should start under. This is
similar to runlevels.
41. Systemctl
Once the service file has been created, we will need to tell the system about it with the following
commands.
systemctl daemon-reload
systemctl start servicename.service
42. Systemctl
Viewing a Unit File
Once the unit file has been created, we do not necessarily need to navigate to the file itself to see
what is written inside. The systemctl command has a feature that displays the content of the unit file
for us. It can be performed with the following command.
systemctl cat servicename.service
43. Systemctl
Viewing Dependencies
Just like we can see inside a unit file, we can also use the following command to display the
dependency tree of that unit.
systemctl list-dependencies servicename.service
[root@host ~]# systemctl list-dependencies httpd.service
httpd.service
● ├─-.mount
● ├─system.slice
● └─basic.target
● ├─microcode.service
● ├─rhel-dmesg.service
● ├─selinux-policy-migrate-local-changes@targeted.service
● ├─paths.target
● ├─slices.target
● │ ├─-.slice
● │ └─system.slice
44. Systemctl
There are a few useful flags that can be added to the command such as the --all flag which lists all
dependencies recursively, or --reverse which will list them in reverse order. There is also the --before
and --after flags which are used to show unit starting before or after the specified unit.
45. Systemctl
View Properties
Additionally, we can see the properties of a unit by using the show command.
systemctl show servicename.service
This will give you output similar to the one below.
[root@host ~]# systemctl show httpd.service
Type=notify
Restart=no
NotifyAccess=main
RestartUSec=100ms
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
WatchdogUSec=0
WatchdogTimestamp=Thu 2020-06-25 05:43:53 EDT
46. Systemctl
In case you are looking for a single setting, you can use -p flag with the setting name. For example,
to get the PID of a running service, use this command.
[root@host ~]# systemctl show httpd.service -p MainPID
MainPID=4004
47. Systemctl
Edit Unit Files
In cases where the unit files need to be modified, systemctl has a built-in editing system that allows
us to modify unit files without searching for them on the server. This can be done using the edit
command.
systemctl edit httpd.service
This creates a directory in /etc/systemd/system named the same as the service with a .d appended
to it. It looks this: /etc/systemd/system/httpd.service.d.
This is where the edits would be stored, and any directives within this file would override the main
unit file. The snippet created in that directory would be named override.conf. In case we wish to edit
using file itself rather than creating a snippet, we can use the following command.
systemctl edit --full httpd.service
48. Systemctl
Removing Unit Files
Removing a unit file and overriding snippets can be accomplished using the following commands.
rm -r /etc/systemd/system/httpd.service.d
We can use the command below to remove the snippet directory, which overrides directives and
removes the full modified unit file.
rm /etc/systemd/system/httpd.service
Whenever we make edits or remove any of the unit files, we need to make sure that changes are
applied by using this command.
systemctl daemon-reload
49. Systemctl
Using Targets (Runlevels)
What is a Systemd Target?
When it comes to unit files, there are special files that we call targets that describe a system state or
synchronization point. These files can be identified by a suffix, which is called .target.
What are these .target files for? They can be used to change the system to certain states, similar to
how other init systems use runlevels.
50. Systemctl
List Targets
There is a number of target files on the server systems, and we can list them using the following
command.
systemctl list-unit-files --type=target
While working with runlevels, activating the runlevels is done one at a time, but when it comes to
targets, we can activate multiple targets at once. In order to see all active targets, we use the
following command.
systemctl list-units --type=target
51. Systemctl
Stopping or Rebooting the Server
Finally, we can use systemctl to stop the server, power it off, or to reboot it. For stopping the server,
we use the following halt command.
systemctl halt
To completely shut down the server, we use poweroff command.
systemctl poweroff
And to reboot the server, we can use the reboot command.
systemctl reboot