Linux Commands With Examples

A To Z Linux Commands With Examples

Insight: A To Z Linux Commands With Examples

If you don’t love Command then Linux might not be your cup of tea. Linux is all about beautiful commands and their execution through terminal.

In this post, we will look on the list of Linux commands with an overview and examples.

A To Z Linux Commands With Examples

1. Ar Linux Command

ar command in Linux is used to create, modify, or extract archives. Let’s see an example of command to create an archive using ar Linux command.

Following command will creates an archive ‘testfile.a’ that contains all the jpg files from the current directory.

ar r testfile.a *.jpg

2. Adduser/Addgroup Linux command

These commands lets you add a new user and group in Linux.

Adduser Linux command example:

sudo adduser test_user

3. Aspell Linux command

Aspell Linux command lets you check the spelling on a text file.

sudo aspell -c testfile.txt

4. Bzip2

Bzip2 Linux command is used to create compressed file archives in bzip2 format.

sudo bzip2 list.txt list0.txt list1.txt

5. bg Command

You can use bg command in Linux to send a process to the background.

sudo tar -czf file.tar.gz .
sudo bg 
sudo jobs

6. chmod Command

chmod command in Linux is used to change or update file permission.

sudo chmod +x fileinfo.sh

7. chgrp Command

chgrp command in Linux is used to change the group ownership of a file.

sudo chgrp itsubuntu users.jpg

8. cat command

cat command in Linux is used to view the contents of a file. It is also used to concatenate files

sudo cat file.txt

9. Cd

The cd command in Linux is used to change the working directory.

sudo cd /home/sachin/

10. df Command

df command in Linux is used to show file system disk space usage.

sudo df -h

11. dir Command

dir command in Linux has used to lists the contents of a directory.

sudo dir

12. diff Command

diff command is used to compare two files line by line.

sudo diff file1 file2

13. du Command

du command is used to show disk space usage of files. It only shows the disk space of files present in a directory as well as its sub-directories.

du /home/itsubuntu

14. eject Command

It is used to eject the removal disk from the Linux operating system:

sudo eject /dev/cdrom
sudo eject /mnt/cdrom/
sudo eject /dev/sda

15. find Command

This particular find command is used to search for files in a directory as well as its sub-directories.

find /home/itsubuntu/ -name omgfile.txt

16. grep Command

grep command searches for a specified pattern in a file (or files).

grep ‘itsubuntu’ customer-list.txt

17. history Command

history command is used to show previously used commands.

sudo history

18. hwclock

hwclock is a command-line tool to manage the system hardware clock. You can also set the hardware clock with this command.

sudo hwclock
sudo hwclock --set --date 7/13/2019

This much for now, we are regularly updating this article. Please visit soon for the full list.

READ More Relevant Stuff:  How To List All SELinux Contexts [2023]

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *