How To Find Out Hard Disk Specs / Details on Linux Linux comes with various commands to find out information about your hard drive. I recommend hdparm command, which provides a command-line interface to various hard disk ioctls supported by the stock Linux ATA/IDE device driver subsystem. This command reads/request identification information such as disk size, description, and much more directly from the drive, which is displayed in a new expanded format. Let us see various Linux disk info commands to print hard disk drive details on screen. Linux Linux Utilities
SED Tutorial - how replace or substitute file contents How replace or substitute text in SED text stream editor Linux Linux Utilities
cut command in linux with examples The cut command is a command-line utility for cutting sections from each line of a file. It writes the result to the standard output. It’s worth noting that it does not modify the file, but only works on a copy of the content. Although typically the input to a cut command is a file, we can pipe the output of other commands and use it as input. It can be used to cut parts of a line by byte position, character and field. Linux Linux Utilities
Awk BuiltIn Variables The following is a list of variables that awk sets automatically on certain occasions in order to provide information to your program. The variables that are specific to gawk are marked with a pound sign (#). These variables are gawk extensions. In other awk implementations or if gawk is in compatibility mode (see section Command-Line Options ), they are not special. VARIABLE NAME DESCRIPTION FS input field separator variable OFS Output Field Separator RS Input Record Separator variable ORS Output Record Separator Variable NR Number of Records NF Number of Fields in a record FILENAME Name of the current input file FNR Number of Records relative to the current input file RLENGTH length of the substring matched by the match() function RSTART first position in the string matched by match() function FS - input field separator variable It represents the (input) field separator and its default value is space. Linux Linux Utilities Bash Development
Awk If Statement In this awk tutorial, let us review awk conditional if statements with practical examples. Normally conditional statement checks the condition, before performing any action. If the condition is true action(s) are performed. Similarly action can be performed if the condition is false. Conditional statement starts with the keyword called "if". Awk supports three different kind of if statement. Awk Simple If statement Awk If-Else statement Awk If-Else-If statement awk If Statement Single Action: Simple If statement is used to check the conditions, if the condition returns true, it performs its corresponding action(s). Linux Linux Utilities Bash Development
Useful tips for Debian based distros Debian bookworm - behavior of more utility has changed I've just ran apt upgrade and apt dist-upgrade and noticed the behavior of more utility has changed. In particular I have to supply -e option in my scripts otherwise it currently presents me with (END) prompt in console. Or when I have alias with more utility, example: alias lf="ls -alFh|more", the output end with (END) prompt in console. Manual says the following: Debian Linux Linux Utilities
GNU Regex POSIX character classes Character classes are a feature introduced in the POSIX standard. A character class is a special notation for describing lists of characters that have a specific attribute, but the actual characters can vary from country to country and/or from character set to character set. For example, the notion of what is an alphabetic character differs between the United States and France. Linux Linux Utilities Bash
7-bit ASCII Character Codes 7-bit ASCII Character Codes The ASCII table contains letters, numbers, control characters, and other symbols. Each character is assigned a unique 7-bit code. ASCII is an acronym for American Standard Code for Information Interchange. Decimal Octal Hex Binary Value Description Carret notation Escape sequence in C 000 000 00 0000 0000 NUL "null" character ^@ \0 001 001 01 0000 0001 SOH start of header ^A 002 002 02 0000 0010 STX start of text ^B 003 003 03 0000 0011 ETX end of text ^C 004 004 04 0000 0100 EOT end of transmission ^D 005 005 05 0000 0101 ENQ enquiry ^E 006 006 06 0000 0110 ACK acknowledgment ^F 007 007 07 0000 0111 BEL bell ^G \a 008 010 08 0000 1000 BS backspace ^H \b 009 011 09 0000 1001 HT horizontal tab ^I \h 010 012 0A 0000 1010 LF line feed ^J \n 011 013 0B 0000 1011 VT vertical tab ^K \v 012 014 0C 0000 1100 FF form feed ^L \f 013 015 0D 0000 1101 CR carriage return ^M \r 014 016 0E 0000 1110 SO shift out ^N 015 017 0F 0000 1111 SI shift in ^O 016 020 10 0001 0000 DLE data link escape ^P 017 021 11 0001 0001 DC1 device control 1 (XON) ^Q 018 022 12 0001 0010 DC2 device control 2 ^R 019 023 13 0001 0011 DC3 device control 3 (XOFF) ^S 020 024 14 0001 0100 DC4 device control 4 ^T 021 025 15 0001 0101 NAK negative acknowledgement ^U 022 026 16 0001 0110 SYN synchronous idle ^V 023 027 17 0001 0111 ETB end of transmission block ^W 024 030 18 0001 1000 CAN cancel ^X 025 031 19 0001 1001 EM end of medium ^Y 026 032 1A 0001 1010 SUB substitute ^Z 027 033 1B 0001 1011 ESC escape ^[ \e 028 034 1C 0001 1100 FS file separator ^\ 029 035 1D 0001 1101 GS group separator ^] 030 036 1E 0001 1110 RS request to send/record separator ^^ 031 037 1F 0001 1111 US unit separator ^_ 032 040 20 0010 0000 SP space ^? Development Linux Linux Utilities
SED Tutorial - how print or delete particular line How we can print or delete particular line with SED (text) stream editor Linux Linux Utilities
Regular Expressions Tutorial - part 1 - Basics of Regular Expressions What is Regular Expression Regular expression , regex, or regexp (sometimes called a rational expression) is special sequence of characters that define a search pattern (if you want a mask) for text strings. Regular expressions are used in search engines, search and replace dialogs of word processors and text editors, in text processing utilities such as sed and AWK and in lexical analysis. Many programming languages provide regex capabilities, built-in or via libraries. Linux Linux Utilities
Downloading an Entire Web Site with wget Sometimes you want to downloading an entire web site that you can take and view even without internet access. Using wget you can make such copy easily: $ wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://example.org Explanation of the various flags: --mirror – Makes (among other things) the download recursive. --convert-links – convert all the links (also to stuff like CSS stylesheets) to relative, so it will be suitable for offline viewing. Linux Linux Utilities