Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Samenvatting

Summary Files and commands in Linux

Beoordeling
-
Verkocht
-
Pagina's
6
Geüpload op
31-05-2024
Geschreven in
2023/2024

This guide describe the displaying the contents of files.

Instelling
Vak

Voorbeeld van de inhoud

File Commands in Linux

Displaying the Content of Files
You use the cat (concatenate) command to display the contents of a specified file. The
cat command can vertically concatenate the contents of more than one file.
Example
[Steveelocalhost Steve]$ cat atal
A sample file
(Steveelocalhost Steve]$
When you type the above command, it is assumed that the file datal is in the current
directory. However, you can also specify the complete path to display a file in another
directory.
Youcan also use the cat command to display the contents of more than one file, as shown in
the following command:
Example
[SteveGloca l host steve) $ cat datal data2
A sample file
Another sample file
(Steve@localhost Steve]$

, The head and tail Commands
Vau use the head commandto display the specifiednumber of lincs from the
beginning of a
6le Youuse the tail command to display the specified number of lines from the end of a file.
Ifvou do not specity aparametcr, 10 lines are displayed by default. The syntax for both the
commands is:

Syntax
head [options] [file name]
tail [options] [file name]
Youuse the head or tailcommand to display a certain number of lines on the screen.
Erample
$ head -3 /etc/passwd
root:x:0:0:root:/root :/bin/bash
bin:x:l:l:bin:/bin:
daemon:x:2:2:daemon:/sbin:

This command displays the first three lines from the beginning of the file /etckpasswd.
Some of the options available with the head command are given below:

Table 3.4: Options of the head Command

Option Functlon

C,-bytes-SIZE Displays the first<size> bytes.
of the first 10lines.
1,ines-NUMBER Displays the first <number> of lines instead

4, verbose Displays headers with file names.


Example
$ l8 -1 | tail 2
Steve 38 Oct 19 22: 28 y
-W-W-r 1 Steve
y.bak
-IW-rW-r- 1 Steve Steve 48 Oct 12 05:09
ls -l command.
This command displays the last two files from the output
output of
of the

Gekoppeld boek

Geschreven voor

Instelling
Vak

Documentinformatie

Heel boek samengevat?
Nee
Wat is er van het boek samengevat?
Managing files and directories
Geüpload op
31 mei 2024
Aantal pagina's
6
Geschreven in
2023/2024
Type
SAMENVATTING

Onderwerpen

€16,15
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
mythreyevenkatesan

Maak kennis met de verkoper

Seller avatar
mythreyevenkatesan vellalar matriculation higher secondary school
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
1 jaar
Aantal volgers
0
Documenten
20
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen