How do I use cpio command under Linux?

Q. Can you explain how do I use cpio under Linux / UNIX? A. GNU cpio is a tool for creating and extracting archives, or copying files from one place to another. It handles a number of cpio formats as well as reading and writing tar files. cpio command works just like tar, only better.Continue reading “How do I use cpio command under Linux?”

5 UNIX / Linux file Command Examples

What is file? The file command accepts a file as an argument and performs certain tests to determine the correct file type. For example text, executable etc. 5 file Examples 1. A basic example The following basic example determines the file type for all the files present in current directory. $ file * cmd: ELFContinue reading “5 UNIX / Linux file Command Examples”

5 Practical Examples To Delete / Remove Directory in Linux ( rmdir )

Question: How can I delete empty directory, directory with files and sub directories in Linux / Unix ? Also, how can I use an alias effectively for rm and rmdir command?   Answer: You can delete empty directory using rmdir command, or directory with content using rm command. Deletion can be done interactively, recursively, forcefully,Continue reading “5 Practical Examples To Delete / Remove Directory in Linux ( rmdir )”

Linux touch command – Why do we need to change Timestamp?

We may use touch command in Linux to create an empty file. Of course we can use another command such as vi, nano or any editing tools to do it. But you may need more steps do it. But do know it that the main function of touch command is not create an empty file?Continue reading “Linux touch command – Why do we need to change Timestamp?”

Linux rm Command Examples – Should be Aware and Cautious

When a file no longer needed, we may delete it to save storage space. On Linux system, we can use rmcommand to do it. What is rm rm is a command to delete a file / directory without confirmation by default. Because of this behavior,users should really sure before deleting files. Run rm command ToContinue reading “Linux rm Command Examples – Should be Aware and Cautious”

15 Linux cp Command Examples – Create a Copy of Files and Directories

Copying files or directories is one of basic activity in every operating system. Backup activity is basically is creating a copy of files and directories. On Linux system, we can use cp command to do it. What is copy command As we mentioned above, cp command is a command to create copy of files andContinue reading “15 Linux cp Command Examples – Create a Copy of Files and Directories”

“unexpand” Command Usage Example in Linux

Examples : 1. Basic Example $ cat -vet file2 One Two Three Four Five six seven$ One Two Three Four Five six seven$ One Two Three Four Five six seven$ One Two Three Four Five six seven$ One Two Three Four Five six seven$ One Two Three Four Five six seven$ One Two Three FourContinue reading ““unexpand” Command Usage Example in Linux”

Sed Command in Unix and Linux Examples

Sed is a Stream Editor used for modifying the files in unix (or linux). Whenever you want to make changes to the file automatically, sed comes in handy to do this. Most people never learn its power; they just simply use sed to replace text. You can do many things apart from replacing text withContinue reading “Sed Command in Unix and Linux Examples”

“fmt” Command Usage Examples in Linux

EXAMPLES 1. Given the contents of file file1.txt, fmt works as follows $ cat file1.txt abc def ghi $ fmt file1.txt abc def ghi Simply using fmt formats text in a single line. 2. Let abc file contains some text, then giving a width of 1 produces output $ cat abc This is a briefContinue reading ““fmt” Command Usage Examples in Linux”