Enumerate
Enum Script
This script checks existence all potential startup script locations. It prints file path if it exists. It checks file permissions to see if current user can edit. If so, it colors it red.
This script is AI generated, NOT TESTED, and probably does not work.
I only included it because it has potentially useful sections that you can build from.
System-wide Startup Files
/etc/inittab
(SysV init) Controls the boot process and launches initial scripts based on run levels.
/etc/systemd/system
(systemd) Contains systemd unit files defining services and processes to start at boot.
/etc/rc.local
(SysV init) Allows adding custom scripts to be executed at boot (may not be present or active on all systems).
/etc/default/*
Holds configuration files for various system services (e.g., /etc/default/syslog).
/etc/profile
System-wide shell configuration file, often sourced by other files.
/etc/bashrc
System-wide Bash shell configuration file.
/etc/zsh/zshrc
System-wide Zsh shell configuration file. (Other shells might have different files)
/etc/profile.d/
Files placed here are sourced for all users' login shells (similar to .profile).
/etc/bashrc.d/
Files here are specifically for bash login shells.
User-specific Startup Files
~/.profile User-specific shell configuration file, sourced at login.
~/.xsession or ~/.xinitrc Configuration for graphical login sessions (depending on the desktop environment).
Bourne-Again Shell (bash)
~/.bash_profile, ~/.bash_login, or ~/.profile (in order of preference) These files are read and executed when a bash login shell is started. ~/.bash_profile is the most commonly used file for login sessions.
~/.bashrc While not a login script per se, it's often sourced by the login scripts or interactive shells to configure the shell session. It's used mainly for interactive shell behavior, aliases, and functions.
Z Shell (zsh)
~/.zprofile Similar to ~/.bash_profile for bash, this file is executed for login shells.
~/.zshrc Executed for interactive shell sessions. It's common to place most shell customizations here.
C Shell (csh) or TENEX C Shell (tcsh)
~/.login Executed at the beginning of a csh or tcsh login shell session.
~/.cshrc (csh) or ~/.tcshrc (tcsh) Read and executed when an interactive shell session starts. It's used for setting up the shell environment.
Korn Shell (ksh)
~/.profile Executed for login shells. Ksh shares this file with Bourne Shell (sh) and bash when running as sh.
SysV Init
/etc/inittab Configuration file specifying the default runlevel and how the system initializes processes. Used by older Unix systems.
/etc/rc.d/ or /etc/init.d/ Directory containing startup scripts (init scripts) for various services and daemons.
/etc/rc.local A script that is executed at the end of the SysV init process. You can add custom startup commands here.
/etc/rc?.d Directories for runlevels 0-6, S (e.g., /etc/rc3.d). Scripts in these directories are symbolic links to scripts in /etc/init.d and are executed at different runlevel
Systemd
/etc/systemd/system/ Directory containing systemd service unit files.
/lib/systemd/system and /usr/lib/systemd/system Directories where packaged unit files are typically located. These should not be modified directly; instead, override files should be placed in /etc/systemd/system.
/lib/systemd/system and /usr/lib/systemd/system Directories where packaged unit files are typically located. These should not be modified directly; instead, override files should be placed in /etc/systemd/system.
/etc/systemd/system/* Directory containing systemd unit files for various services, including boot services.
/etc/systemd/system/default.target Symbolic link specifying the default target (runlevel) that systemd boots into. Equivalent to runlevels in SysV.
/etc/systemd/system/multi-user.target Unit file defining the multi-user target (runlevel equivalent). Units with "Requires=multi-user.target" Services dependent on the multi-user target, likely executed during boot.
/etc/systemd/system.conf Main configuration file for systemd.
~/.config/systemd/user/ User-specific systemd unit files for services started with the user's session.
/etc/systemd/system/multi-user.target.wants/, /etc/systemd/system/graphical.target.wants/, etc. Directories containing symlinks to unit files for services that should be started automatically under specific targets.
Upstart
/etc/init/ Directory containing Upstart job configuration files. Jobs define how services are started, stopped, and managed (not to be confused with /etc/init.d used by SysV).
/etc/init.d/ Directory containing SysV-style init scripts. For compatibility with SysV init scripts, Upstart systems may also include this directory. While Upstart itself does not use these scripts directly, it provides backward compatibility allowing administrators to manage services using traditional SysV init scripts. Upstart intercepts calls to the service and /etc/init.d/ scripts and translates them into appropriate Upstart events when possible.
/etc/init/rc-sysinit.conf Upstart configuration file responsible for initializing the system, similar to SysV's init scripts.
/etc/init/rc.conf Upstart configuration file specifying the default runlevel.
/etc/init/tty.conf* Upstart job configuration files for handling virtual terminals (ttys).
~/.init/ User-specific Upstart job configuration directory for custom jobs.
Last updated
Was this helpful?