The right way to Use the ‘extra’ Command in Linux

by | Aug 16, 2023 | Etcetera | 0 comments

The additional Linux command is a powerful device that allows shoppers to view text information throughout the terminal one visual display unit at a time. It’s an a very powerful command for anyone who continuously works with massive text information. Thru breaking down the content material subject matter into manageable chunks, the additional command enhances readability and navigation, making it easier to research and understand the information throughout the file.

Similar to the additional command, the a lot much less command supplies additional flexibility and features, identical to backward navigation. Each and every directions are continuously used for viewing log information, configuration information, and other text bureaucracy throughout the Linux surroundings. For those looking to combine directions for added sophisticated tasks, the additional command can be used alongside apparatus like grep to search for particular patterns inside a file.

Learn how to Use additional

1. Viewing a File

Syntax: additional [filename]

Rationalization: Shows the content material subject matter of a file one visual display unit at a time.

See also  Best 20 Udemy Lessons for Marketers (2024)

Example: additional myfile.txt

Output:

This is line 1
This is line 2
--Further--(10%)

The output displays the principle few lines of myfile.txt and means that 10% of the file has been displayed. Pressing the spacebar will show the next visual display unit of content material subject matter.

2. Viewing Multiple Data

Syntax: additional file1 file2 ...

Rationalization: Shows the contents of a few information sequentially.

Example: additional file1.txt file2.txt

Output:

Contents of file1.txt
--Further--(file 1 of 2)

The output displays the contents of file1.txt and means that it’s the principle of two information. You’ll be capable to navigate right through the information the use of the an identical controls as viewing a single file.

3. Taking a look out Within a File

Syntax: additional [filename], then type /development to search around.

Rationalization: We could in searching for a specific development throughout the file.

Example: additional myfile.txt, then type /line 3

Output:

This is line 3
--Further--(20%)

After opening myfile.txt with additional, typing /line 3 searches for the text line 3 and displays the corresponding line, indicating that 20% of the file has been displayed.

4. Viewing a File with Line Numbers

Syntax: additional -n [filename]

Rationalization: Shows the content material subject matter of a file with line numbers.

Example: additional -n myfile.txt

Output:

1 This is line 1
2 This is line 2
--Further--(10%)

The output displays the principle few lines of myfile.txt with line numbers, and means that 10% of the file has been displayed.

5. Viewing a File with a Explicit Choice of Traces in keeping with Show

Syntax: additional -num [filename]

Rationalization: Shows the content material subject matter of a file with a specific choice of lines in keeping with visual display unit.

See also  How to Customize WordPress in 2024 (No Coding Required)

Example: additional -5 myfile.txt

Output:

This is line 1
This is line 2
This is line 3
This is line 4
This is line 5
--Further--(25%)

The output displays the principle 5 lines of myfile.txt and means that 25% of the file has been displayed.

6. Piping Output to “additional”

Syntax: [command] | additional

Rationalization: Pipes the output of a few different command via additional to view it one visual display unit at a time.

Example: ls -l | additional

Output:

-rw-r--r-- 1 client client 1234 Jan 1 12:00 file1.txt
-rw-r--r-- 1 client client 5678 Jan 1 12:01 file2.txt
--Further--

The output displays the long listing of information throughout the provide list, displaying them one visual display unit at a time. The --Further-- beneficial indicates there’s additional content material subject matter to view.

7. Viewing a File and Exiting on the First Have compatibility of a Pattern

Syntax: additional +/development [filename]

Rationalization: Opens the file and jumps at once to the principle prevalence of the specified development.

Example: additional +/line3 myfile.txt

Output:

This is line 3
This is line 4
--Further--(20%)

The output displays the content material subject matter starting from the principle prevalence of line3 in myfile.txt, indicating that 20% of the file has been displayed.

Further Linux directions:
Checklist Operations rmdir · cd · pwd
File Operations cat · cp · dd · much less · ls · mkdir · mv · tail · tar · zip
File Instrument Operations chown · mkfs
Networking ping · curl · wget · iptables
Search and Text Processing in finding · grep · sed · whatis
Instrument Knowledge and Keep an eye on env · historical past · most sensible · who
Client and Session Keep an eye on display screen · su · sudo

The put up The right way to Use the ‘extra’ Command in Linux seemed first on Hongkiat.

See also  How you can Upload Anchor Hyperlinks to Buttons with Divi

WordPress Website Development

Supply: https://www.hongkiat.com/blog/linux-command-more/

[ continue ]

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!