❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayLakshmi

Linux command part-16

By: Lakshmi M
30 August 2023 at 01:27

head

The head command, as the name implies, print the top N number of data of the given input. By default, it prints the first 10 lines of the specified files. If more than one file name is provided then data from each file is preceded by its file name.

TO DISPLAY THE FIRST 10 LINES DEFAULT OF HEAD COMMAND

first command- head /proc/cpuinfo

To show the first 5 lines

command – head -n 5 /proc/cpuinfo

Thank you…

Linux command part -15

By: Lakshmi M
23 August 2023 at 02:56

1.sort

This command is used to sort a fie, arranging the records in a partcular order.

first create the file then sort the fie

create file true.txt

command – cat>true.txt then see the file cat true.txt

To sort arrange the true.txt

command – sort true.txt

To sort in reverse order

command – sort -r true.txt

To remove duplicate entries

command – sort -u true.txt

Thank you…

Linux command part – 13

By: Lakshmi M
21 August 2023 at 01:36

1.df

THIS COMMAND IS REPORT FILE SYSTEM DISK SPACE USAGE

To display all the file system

command – df -a

To display size in human readable format

command- df -h

To get complete grand total

command – df -h –total

To display disk space usage of current directory

command – df -Th

Thank you …

Linux command part – 11

By: Lakshmi M
18 August 2023 at 15:00

1.vim

Vim is a text editor for Unix that comes with Linux, BSD, and macOS. It is known to be fast and powerful, partly because it is a small program that can run in a terminal.

vim improved, a programmer’s text editor

To create a file

command – vim <option>

vim file.txt

To go insert mode on the terminal

press I

once the editor is in insert mode , start writing the content in the file.To save the file and exit from the editor.

Esc Shift+ :wq! (or) Esc Shift 😑

To quit from the file without saving

Esc Shift+ :q!

please share your likes and comments

Thank you…

Linux command part -9

By: Lakshmi M
17 August 2023 at 16:13

1.| piping

The pipe is used to combine two or more commands, and in this, the output of one command acts as input to another command, and this command’s output may act as input to the next command, and so on.

To find wc of file /proc/cpuinfo

command – cat /proc/cpuinfo | wc

cat file.txt | wc

Thank you…

Linux command part – 8

By: Lakshmi M
17 August 2023 at 16:02

1.wc

wc stands for word count. As the name implies, it is mainly used for counting purpose.

  • It is used to find out number of lines, word count, byte and characters count in the files specified in the file arguments.
  • By default it displays four-columnar output.
  • First column shows number of lines present in a file specified, second column shows number of words present in the file, third column shows number of characters present in file and fourth column itself is the file name which are given as argument.

command – wc <file name>

wc file.txt

To count number of lines

wc -l file.txt

To display number of words

wc -w file.txt

To count number of bytes and characters

command – wc -c file.txt (or) wc -m file.txt

Thank you…

Linux commands part – 7

By: Lakshmi M
15 August 2023 at 10:15

who

The who command displays information about all users currently on the local system. The following information is displayed: login name, tty, date and time of login. Typing who am i or who am I displays your login name, tty, date and time you logged in.

who command options

OptionDescription
-aTo print same as -b – –login -p -r -t -T -u
-rTo check the current runlevel
-bTo view the time of last system limit
-qAll login names and number of users logged on

thank you…

❌
❌