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 )”
Author Archives: Farzand Ali
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”
Tee Command Usage Examples
Tee command is used to store and view (both at the same time) the output of any other command. Tee command writes to the STDOUT, and to a file at a time as shown in the examples below. Example 1: Write output to stdout, and also to a file The following command displays output onlyContinue reading “Tee Command Usage Examples”
“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”
9 Linux Uname Command Examples To Get Operating System Details
When you are in console mode, there is no ‘Right click > About’ to give you information about your operating system. In Linux, you can use command uname to help you about that. Uname is the short name for unixname. Just type uname in console. When you type uname without parameter, it will only showContinue reading “9 Linux Uname Command Examples To Get Operating System Details”
Difference between bash and shell ( bash and sh ) ( #!/bin/sh and #!/bin/bash )
Bash (Bourne Again Shell ) is the free version of the Bourne shell distributed with Linux and GNU operating systems. Bash is similar to the original, but has added features such as command line editing. Created to improve on the earlier sh shell, Bash includes features from the Korn shell and the C shell. Bash isContinue reading “Difference between bash and shell ( bash and sh ) ( #!/bin/sh and #!/bin/bash )”