Posts

Linux ssh auto login

As simply as this: ssh-copy-id user@server.name ssh user@server.name And that is it no more password login!!!

VI search and replace command examples

VI search and replace command examples Let us say you would like to find a word called “foo” and replace with “bar”. First hit [Esc] key Type : (colon) followed by %s/foo/bar/ and hit [Enter] key. :%s/foo/bar/

Basic Find Commands

Basic Find Commands for Finding Files with Names 1. Find Files Using Name in Current Directory Find all the files whose name is weballround.txt in a current working directory. # find . -name weballround.txt ./weballround.txt 2. Find Files Under Home Directory Find all the files under /home directory with name weballround.txt. # find /home -name weballround.txt /home/weballround.txt 3. Find Files Using Name and Ignoring Case Find all the files whose name is weballround.txt and contains both capital and small letters in /home directory. # find /home -iname weballround.txt ./weballround.txt ./weballround.txt 4. Find Directories Using Name Find all directories whose name is weballround in / directory. # find / -type d -name weballround /weballround 5. Find PHP Files Using Name Find all php files whose name is weballround.php in a current working directory. # find . -type f -name weballround.php ./weballround

Exim Cheat Sheet

Basic information Print a count of the messages in the queue: root@localhost# exim -bpc Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient): root@localhost# exim -bp Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals): root@localhost# exim -bp | exiqsumm Print what Exim is doing right now: root@localhost# exiwhat Test how exim will route a given address: root@localhost# exim -bt alias@localdomain.com user@thishost.com <-- alias@localdomain.com router = localuser, transport = local_delivery root@localhost# exim -bt user@thishost.com user@thishost.com router = localuser, transport = local_delivery root@localhost# exim -bt user@remotehost.com router = lookuphost, transport = remote_smtp host mail.remotehost.com [1.2.3.4] MX=0 Run a pretend SMTP transaction from the command line, as if it were coming from the given IP address. This will display Exim's checks, ACLs, and

How to Use the wget Linux Command to Download Web Pages

 How To Download A Website Using wget For this guide, you will learn how to download this linux blog. wget www.everydaylinuxuser.com It is worth creating your own folder on your machine using the mkdir command and then moving into the folder using the cd command. For example: mkdir everydaylinuxuser cd everydaylinuxuser wget www.everydaylinuxuser.com The result is a single index.html file. On its own, this file is fairly useless as the content is still pulled from Google and the images and stylesheets are still all held on Google. To download the full site and all the pages you can use the following command: wget -r www.everydaylinuxuser.com This downloads the pages recursively up to a maximum of 5 levels deep. 5 levels deep might not be enough to get everything from the site. You can use the -l switch to set the number of levels you wish to go to as follows: wget -r -l10 www.everydaylinuxuser.com If you want infinite recursion you can use the following: wget -r -l inf www.everydaylinu

Finding all large files in the root filesystem

find . -type d -size +100M find -type f -exec du -Sh {} + | sort -rh | head -n 5