Linux Commands PDF
Document Details
Uploaded by EnergeticTriumph
Tags
Summary
This document provides a comprehensive list of Linux commands, with descriptions of their function and examples. It includes commands for various tasks, such as file manipulation, process management, network configuration, and more. This guide is suitable for beginners and experienced users.
Full Transcript
Here is a comprehensive list of Linux commands from the source Linux Basics for Hackers and our conversation history to help you master Linux: Command: pwd Function: Displays the present working directory. For example: kali > pwd /home/user Command: whoami Function: Returns the currently logged-i...
Here is a comprehensive list of Linux commands from the source Linux Basics for Hackers and our conversation history to help you master Linux: Command: pwd Function: Displays the present working directory. For example: kali > pwd /home/user Command: whoami Function: Returns the currently logged-in user. Command: cd Function: Changes the directory from the terminal. Command: ls Function: Lists the contents of a directory. The -l switch provides more information, such as file permissions. The -a switch shows all files, including hidden files. Command: aircrack-ng --help Function: Displays the help file for the aircrack-ng command, a wireless cracking tool. Command: man Function: Provides documentation about the Linux commands, also known as man pages. Command: locate Function: Searches the file system for files or directories. Command: find Function: Similar to locate but more focused, and it allows for more advanced search parameters and wildcards. Command: ps Function: Displays all running processes. The aux switches display the process information. Command: cat Function: Creates new files. Use the > symbol to redirect input to a file. Use the >> symbol to append content to a file. cat can also be used to view file content. Command: mkdir Function: Creates new directories. Command: cp Function: Copies files. Command: mv Function: Moves and renames files. Command: rm Function: Removes files and directories. The -r option will remove a directory and all of its contents. Command: head Function: Displays the first 10 lines of a file. To display a different number of lines, use the -number switch. For example, to view the first 20 lines: head -20 file.txt Command: tail Function: Displays the last 10 lines of a file. Use the -number switch to display a different number of lines. Command: nl Function: Displays file content with line numbers. Command: grep Function: Filters and displays lines in a file that contain a specific pattern or keyword. Command: more Function: Displays a file one page at a time. Press ENTER to advance to the next page. Enter q to quit. Command: less Function: Similar to more, but it allows you to scroll up and down. It also enables you to search for patterns within the file. Command: apt-cache search Function: Searches through the package lists for software packages matching a given pattern. Command: apt-get install Function: Downloads and installs software packages from repositories. Command: git clone Function: Copies or clones a repository from a remote source, like GitHub, to your local system. Command: chmod Function: Changes the permissions of files and directories. Command: chown Function: Changes ownership of files and directories. Command: top Function: Displays dynamically updating information about active processes and system resource usage. Command: kill Function: Terminate or stop a process using its PID. Command: killall Function: Terminate all processes with a given name. Command: renice Function: Modifies the priority of a running process. Command: at Function: Schedules commands to be executed at a specific time. Command: env Function: Displays the default environment variables. Command: set Function: Displays all environment variables. To make viewing easier, pipe to more: set | more Command: export Function: Makes an environment variable available to other programs. Command: echo Function: Displays text and variable values. Command: gzip Function: Compresses files. Command: gunzip Function: Uncompresses.gz files. Command: bzip2 Function: Compresses files creating a.bz2 archive. Command: bunzip2 Function: Uncompresses.bz2 files. Command: compress Function: Compresses files. Command: uncompress Function: Uncompresses files compressed with compress. Command: dd Function: Creates bit-by-bit copies of storage devices, making it possible to recover data like deleted files. Command: fdisk Function: Lists partitions on connected drives. Use the -l switch to list all partitions on all drives. Command: lsblk Function: Lists block devices, including hard drives, partitions, and removable media. Command: mount Function: Mounts a storage device, like a USB drive, making it accessible to the system. Command: umount Function: Unmounts a storage device. Command: df Function: Displays disk space available. Command: fsck Function: Checks for errors on a storage device. Command: logrotate Function: Manages log files. Command: service Function: Starts, stops, and restarts services. Command: mysql -u root -p Function: Logs you into the MySQL database. You will be prompted for the MySQL root password. Command: ifconfig Function: Shows active network interfaces, including IP addresses, MAC addresses, and network statistics. Command: iwconfig Function: Similar to ifconfig, but specifically for wireless network interfaces. Command: iwlist Function: Scans for available wireless networks and displays information about them, such as SSID, signal strength, and channel. Command: nmcli Function: A command-line interface for managing network connections. Command: hcitool Function: A command-line tool for interacting with the Bluetooth stack, including scanning for and managing Bluetooth devices. Command: l2ping Function: Sends Layer 2 (link layer) pings to test network connectivity at a lower level. Command: uname Function: Displays system information, including the kernel version. Use the -a option for detailed information. Command: lsmod Function: Lists the currently loaded kernel modules. Command: modprobe Function: Adds or removes modules from the running Linux kernel. Command: sysctl Function: Modifies kernel parameters at runtime. Command: dmesg Function: Prints or controls the kernel ring buffer, which stores kernel messages. Command: crontab Function: Edits the cron table, allowing for scheduling tasks. Command: update-rc.d Function: A tool used to manage system startup scripts located in /etc/rc*.d directories. You can use this to configure services to start automatically at boot time. Command: rcconf Function: A GUI-based tool to update the rc.d scripts, enabling you to manage services that start at boot. This is a comprehensive list of all the commands mentioned in the sources and our conversation history. Remember that you can use the man command (e.g., man ls) or the --help flag (e.g., ls --help) to get detailed information and usage instructions for any command. As you continue your journey into the world of Linux, you'll encounter many more commands. The key to mastering Linux is consistent practice and exploration. Don't be afraid to experiment!