Skip to content

Dipin Krishna

I love to code. If you feel the same, then i have some cool codes for you. They are simple but good to get started.

  • Home
  • Blog
  • Privacy Policy
  • About
  • Contact
  • Home
  • Blog
  • Privacy Policy
  • About
  • Contact

Category Archives: Shell

Home/Archive Category: Shell
SFTP

SSH/SFTP: Create and Restrict a User to his Home Directory on a Ubuntu Server

May 11, 2018Dipin KrishnaShell, Unix/Linuxsftp, ssh, Ubuntu

This is a step by step guide to create a new user and restrict the user to his home directory. 1. Create a new user   sudo adduser TestUser 2. Change the ownership of TestUser’s home directory to root.   sudo chown root:root /home/TestUser 3. Edit the ssh config file   sudo vim /etc/ssh/sshd_config and

Read More

Use WGET to recursively download the whole FTP directory

Feb 15, 2013Dipin KrishnaGeneral, Shelldirectory, download, ftp, recursively, wget

I wanted to copy all of the files and folders from my current host to my new server. And I only have FTP access to that current host. My new server is running Ubuntu, and i hated using the FTP command. But i had to some how download the whole directory of files. Can’t use

Read More

Search Replace

SED: Shell command to find and replace text inside a directory (multiple files)

Jun 21, 2012Dipin KrishnaShell, Unix/Linuxdirectory, find, multiple files, replace, search, sed

I have been using this command for a long time now. Whenever i am in need of this command, i won’t be remembering the correct syntax. So, i google it each time. Now, i am gonna write it down here. sed is a marvelous utility. Unfortunately, most people never learn its real power. The language

Read More

Inline Shell Script with a For Loop

Nov 19, 2008Dipin Krishnafor loop, Inline, Script, Shell

Often I’m asked how to traverse a list of items in a file. You can easily go through a list of items using a for loop. Here’s an example of copying selected contents of originalDir to destinationDir via the command line. #sh #for i in `cat /home/esofthub/mylist.dat` #do #cp -pr /originalDir/$i /destinationDir/. #echo $i done #done

Read More

Search

Theme by Think Up Themes Ltd. Powered by WordPress.