Tuesday, November 8, 2022

tac command in Linux with Examples

                                             Tac Command

    tac command in Linux is used to print files in reverse. When no file is specified then this command will read the standard input.

 Example for tac command

1. Create a file by using cat command.

[root@localhost ~]# cat > file1
welcome to linux
Thanks for visiting our channel

2. Check the file the data is available are not.

[root@localhost ~]# cat file1
welcome to linux
Thanks for visiting our channel

3. tac command will print the output in reverse.

[root@localhost ~]# tac file1
Thanks for visiting our channel
welcome to linux 

     

    You can use this tac command in all Linux flavors like redhat, ubuntu, kali linux, linux mint, debian, manjaro, arch linux, opensuse, centos, etc.

No comments:

Post a Comment

Docker Crash Course for DevOps Engineers

  Introduction to Docker:                Containerization is a lightweight method of running applications in isolated environments using sha...