How to generate public/private keys
This post shows how to generate public / private key pair. To generate public/private key pair, simply run the following command:$ ssh-keygen -t rsa Following are step-by-step instructions: 1. Open your terminal window in your Linux, Mac, or Windows machine by typing terminal in the search box or spotlight....
Linux: How to delete files recursively
The rm command deletes files. To delete a directory which is not empty and its subdirectories, use $ rm -rf directory However, sometimes you would need to remove specific subdirectory rather than the entire directory and its contents. For example: |-- engine|-- mod |-- .svn |-- anytext ...
Creating empty files from Linux command line
There are many ways to create an empty text file from command line. This post shows 3 ways. To create empty file from Linux command line, you can use one of the following methods:1. touch filename2. vi filename and close file3. echo > filename touch is a tool that...
bash: How to change file extensions
This post shows how to change file extensions using bash. To change file extensions, we simple need to loop through file in a directory and use the “mv” command to rename each file. The following code requests directory address from the user and then renames all “.log” files to...
bash: Renaming multiple files
To rename multiple files using the command line, you can use the rename command or a shell script. Its syntax is as follows. $ rename regular_expression files As you can see, the catch is that you need to know regular expressions. But for simpler tasks, regular expressions are really...
bash: renaming files in a directory
Suppose you have 2000 photos in a directory and you need to rename them. The files are named as: We need to rename them as follows: Here is how: j in is the counter. Line 5 increments j. s is a string. Line 4 uses the mv command renaming...