Linux – cat

Linux cat command Linux cat command is used to display file content. You can also use this to create new files or copy file contents to other files. Syntax: $ cat file_name Examples: #1. Display File Content For example use the following command to list content of /etc/passwd file. $ cat /etc/passwd Output: root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin … #2. Display Multiple File Content You can also display the multiple file content in single command. $ cat /etc/passwd /etc/group #3. Display Line Numbers Use -n switch to display the…

Read More