<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ishan Sharma</title>
    <description>The latest articles on DEV Community by Ishan Sharma (@real_ishan).</description>
    <link>https://dev.to/real_ishan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F16422%2F11a7bbfb-fb89-4322-acc4-b195ded1b68d.jpg</url>
      <title>DEV Community: Ishan Sharma</title>
      <link>https://dev.to/real_ishan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/real_ishan"/>
    <language>en</language>
    <item>
      <title>7 Essential Linux Commands You Need To Know</title>
      <dc:creator>Ishan Sharma</dc:creator>
      <pubDate>Thu, 31 Jan 2019 18:06:57 +0000</pubDate>
      <link>https://dev.to/real_ishan/7-essential-linux-commands-you-need-to-know-3151</link>
      <guid>https://dev.to/real_ishan/7-essential-linux-commands-you-need-to-know-3151</guid>
      <description>&lt;p&gt;A close friend and mentor once told me that you only need to know around 10 commands to use Linux properly. After 10 years of Linux server use, I can confidently say that the number is pretty accurate.&lt;/p&gt;

&lt;p&gt;However, if you are only looking for basic operations for a small project, you can do with much less. In this article, I’ll go through 7 Linux commands that you’ll use 99.99% of the times.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Quick note&lt;/strong&gt; : I’m only covering the most frequent uses here. If you want to learn more, type &lt;code&gt;man &amp;lt;command&amp;gt;&lt;/code&gt; in your terminal to see the manual (you can quit using q)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  File Navigation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ls
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ls&lt;/code&gt; is a simple command to list all the files in current directory. If you go ahead and just type &lt;code&gt;ls&lt;/code&gt; in your (macOS or Linux) terminal, you’ll see the list of files in your home folder.&lt;/p&gt;

&lt;p&gt;By itself, &lt;code&gt;ls&lt;/code&gt; doesn’t give much information. I mostly use it with 3 arguments, like this: &lt;code&gt;ls -lah&lt;/code&gt;. Here’s what the arguments do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;l&lt;/code&gt;: This is lowercase ‘ell’, not ‘ei’. It will display the list in long format with file permissions (don’t bother with these for now) and lot of other details&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;h&lt;/code&gt;: By default, Linux will display file sizes in &lt;code&gt;ls -l&lt;/code&gt; list in bytes, without any units. Using &lt;code&gt;h&lt;/code&gt; argument will make these file sizes human readable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;a&lt;/code&gt;: This shows all hidden files (files started with &lt;code&gt;.&lt;/code&gt; [dot] in linux).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  cd
&lt;/h3&gt;

&lt;p&gt;You most probably know &lt;code&gt;cd&lt;/code&gt; from Windows. It lets you navigate to a new folder (directory).&lt;/p&gt;

&lt;p&gt;Quick 3 step usage:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;cd folder-name&lt;/code&gt; switches to folder with name &lt;code&gt;folder-name&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd&lt;/code&gt; goes to your home folder (the one where you are by default when you log in, usually &lt;code&gt;/home/&amp;lt;username&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd ..&lt;/code&gt; goes to the parent folder&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;A quick detour about paths&lt;/strong&gt; : cd can take both relative and absolute paths. Absolute paths have either &lt;code&gt;/&lt;/code&gt; or &lt;code&gt;~&lt;/code&gt; in the beginning, for example &lt;code&gt;/etc/hosts&lt;/code&gt; or &lt;code&gt;/usr/local/bin&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Relative paths are, well, relative to the current folder. If you’re in &lt;code&gt;songs&lt;/code&gt; folder and it has another folder &lt;code&gt;maroon_5&lt;/code&gt; inside it, &lt;code&gt;cd maroon_5&lt;/code&gt; will switch currently active folder to &lt;code&gt;maroon_5&lt;/code&gt;, but only in &lt;code&gt;songs&lt;/code&gt; folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  File Management
&lt;/h2&gt;

&lt;p&gt;These commands are useful for copying, moving and removing files. As a general rule, remember that these commands follow this format:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;command &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  cp &amp;amp; mv
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;cp &amp;lt;source&amp;gt; &amp;lt;destination&amp;gt;&lt;/code&gt; copies the source file to destination.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Quick example:&lt;/em&gt; You have a file called &lt;code&gt;notes.txt&lt;/code&gt; inside your home directory and want to move it to the folder &lt;code&gt;all_notes&lt;/code&gt;. Then you’ll use &lt;code&gt;cp notes.txt all_notes/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will fail if you try to copy a folder (directory in Linux). For copying folders, you have to use &lt;code&gt;r&lt;/code&gt; parameter. To copy a folder &lt;code&gt;notes_2018&lt;/code&gt; to the folder &lt;code&gt;all_notes&lt;/code&gt;, you’ll use &lt;code&gt;cp -r notes_2018 all_notes&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv&lt;/code&gt; moves the files instead of copying, think cut and paste in windows. It follows same format as &lt;code&gt;cp&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  rm
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;rm&lt;/code&gt; removes a file or directory. Just like &lt;code&gt;cp&lt;/code&gt;, you’ll need to specify &lt;code&gt;-r&lt;/code&gt; argument if you are trying to remove folder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt; I’m not covering editing files here. But if you ever need to do that, you can use &lt;code&gt;vi &amp;lt;filename&amp;gt;&lt;/code&gt; or (much preferred) &lt;code&gt;nano &amp;lt;filename&amp;gt;&lt;/code&gt; on Ubuntu like distros. Beware of &lt;code&gt;vi&lt;/code&gt; though:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I've been using Vim for about 2 years now, mostly because I can't figure out how to exit it.&lt;/p&gt;

&lt;p&gt;— I Am Devloper (@iamdevloper) &lt;a href="https://twitter.com/iamdevloper/status/435555976687923200?ref_src=twsrc%5Etfw"&gt;February 17, 2014&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Interacting with servers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ssh
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ssh&lt;/code&gt; lets you login to remote servers. If you need to login to a Linux server, you’ll need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It’s IP address or hostname&lt;/li&gt;
&lt;li&gt;A valid username &amp;amp; password for the server&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use &lt;code&gt;ssh &amp;lt;username&amp;gt;@&amp;lt;server&amp;gt;&lt;/code&gt; to start authentication. In most cases, server will prompt you for password and if it’s valid, you’ll be logged in.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick tip: Once you’re done, you can use &lt;code&gt;exit&lt;/code&gt; to log out of the remote server.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  scp
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;scp&lt;/code&gt; is handy when you want to transfer files between different servers or machines.&lt;/p&gt;

&lt;p&gt;You’ll use it when you have some files on your laptop and want to move them to a remote server. Just use &lt;code&gt;scp &amp;lt;local-file&amp;gt; &amp;lt;username&amp;gt;@&amp;lt;server&amp;gt;:&amp;lt;path&amp;gt;&lt;/code&gt;. For example, if you have a file on your Mac at &lt;code&gt;/Users/sam/secret.txt&lt;/code&gt;, and you want to copy it to a secure server at &lt;code&gt;192.168.0.1&lt;/code&gt; in the folder &lt;code&gt;/tmp&lt;/code&gt;, you will use scp like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;scp secret.txt &amp;lt;server-username&amp;gt;@192.168.0.1:/tmp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Done? These were the 7 commands that’ll work on any Linux (or Mac) server and desktop.&lt;/p&gt;

&lt;p&gt;Liked the post? Do share it on Twitter or Reddit.&lt;/p&gt;

&lt;p&gt;Have questions? Leave a comment and I’ll answer soon.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on my blog, &lt;a href="https://ishan.co/essential-linux-commands"&gt;7 Essential Linux Commands You Need To Know&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>linux</category>
      <category>macos</category>
    </item>
    <item>
      <title>Customizing Keyboard Shortcuts for any macOS App</title>
      <dc:creator>Ishan Sharma</dc:creator>
      <pubDate>Sat, 11 Aug 2018 19:12:45 +0000</pubDate>
      <link>https://dev.to/real_ishan/customizing-keyboard-shortcuts-for-any-macos-app-2l9f</link>
      <guid>https://dev.to/real_ishan/customizing-keyboard-shortcuts-for-any-macos-app-2l9f</guid>
      <description>&lt;p&gt;If you are reading this, chances are that you use keyboard shortcuts as part of your daily workflow. From cut, copy, paste to the “Paste and Match Style” to IDE's code folding and unfolding, there are shortcuts that you use without even realizing. Most apps allow you to customize the shortcuts, but you may find a few that do not support that.&lt;/p&gt;

&lt;p&gt;I was in this situation a couple of weeks ago when I needed a quick shortcut to archive the messages in Mail app. The default shortcut was not very intuitive and I needed something quick, like &lt;code&gt;⌘ + A&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After some searching, I found that macOS has a built-in setting that lets you customize shortcuts for any app.&lt;/p&gt;

&lt;p&gt;You just need to go to System Preferences → Keyboard → Shortcuts → App Shortcuts and add a new one. You can either add a shortcut for a specific app or system wide.&lt;/p&gt;

&lt;p&gt;Some other shortcuts that I use in the Mail app:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;⌘ + 1&lt;/code&gt; for numbered lists&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;⌘ + 8&lt;/code&gt; for unnumbered lists&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s the tweet that inspired me to write this post (good tip, though I don’t use it):&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--KcM-Inao--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/811695151445741568/WVpqkOAs_normal.jpg" alt="Ally MacDonald profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Ally MacDonald
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @allymacdonald
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Want to improve your quality of life in 5 seconds? &lt;br&gt;&lt;br&gt;1. Go to System Preferences&lt;br&gt;2. Keyboard&lt;br&gt;3. App Shortcuts&lt;br&gt;4. All Applications --&amp;gt; add "Paste and Match Style" ⌘V&lt;br&gt;&lt;br&gt;Done.
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      14:03 PM - 01 Aug 2018
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1024656834571976705" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1024656834571976705" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1024656834571976705" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;And here’s Apple’s documentation if you prefer detailed steps: &lt;a href="https://support.apple.com/kb/PH25377?locale=en_US"&gt;macOS Sierra: Create keyboard shortcuts for apps&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Know any other tips like this? Go ahead and share in the comments or on &lt;a href="https://twitter.com/real_ishan"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>keyboard</category>
      <category>shortcuts</category>
    </item>
  </channel>
</rss>
