Email Subscription Form

Saturday, January 4, 2020

The Command Line, Demystified- Part I

When I first started out as a software tester, I would always get nervous when I had to do anything with the command line, and I was so impressed when my coworkers could type tiny commands and get dozens of lines of text in response.  The one thing that helped me when learning the command line was a course I took in Linux.  I was confused for much of the course, but I did manage to learn some commands, and over the years I've been able to gradually expand my knowledge.

The command line is hugely helpful when you want to navigate through your system's folder structure, create new folders or files, or execute runnable files.  In this post, I'll be walking you through some simple commands that can help you get started using the command line like a pro.  Most of the commands I'll be sharing will work in both Mac and Windows; when there are differences between the two, I'll point them out.


First, let's look at some useful keys:

The up arrow
The up arrow copies whatever command you just ran, and if you click on the up arrow more than once, you can cycle back through all of the commands you have run so far.  For example, if you ran these three commands:
ls
cd Documents
cd ..
and then you were to click the up arrow, you'd see cd .. . If you clicked the up arrow again, you'd see cd Documents, and if you were to click it a third time, you'd see ls.

The up arrow is really helpful for those times when you ran a complicated command and you need to run it again, but you don't feel like typing it all over again.  Simply click the up arrow until you've returned to the command you want, then click Return to run the command again.

The tab key
The tab key has auto-complete functionality.  To see how this works, let's imagine that you have a folder called MyFolder that contains three sub-folders:
LettersToDad
LettersToMom
graduationPics
If you wanted to navigate from MyFolder to graduationPics using the cd command (more on this later), you could simply type:
cd grad
and then click the tab key.  The folder name will auto-complete to graduationPics.

This command is helpful when you don't feel like typing out an entire folder name.  Typing just the first few letters of the folder and hitting tab, then Return, is a really fast way to navigate.

In order for the auto-complete to work, you need to type enough letters that there's only one possible option left when you click the tab key.  For example, when you type
cd LettersTo
and then click the tab key, the command line doesn't know if you mean LettersToDad or LettersToMom.  The Windows command line will cycle through the possible options as you repeatedly click the tab key.  In Mac, if you click the tab key a second time, it will return your possible options.

Next, let's learn some navigation skills:

The command prompt:  The command prompt is a symbol that indicates that the command line is ready to receive commands.  In Mac, the command prompt looks like this: $.  In Windows, the command prompt looks like this: >.  The command prompt is preceded by the working directory.

Working directory:
The term working directory refers to whatever directory (folder) you are in when you are using the command line.  When you first open the command line window, you'll be in your home directory.  This is your own personal directory.  For example, in Windows, my personal directory is C:/users/kjackvony.  In Mac, my personal directory is /Users/K.Jackvony, but the directory location will display only as ~ , which means the home directory.

ls or dir
This command - ls in Mac and dir in Windows - will list all the files and folders in your working directory.

cd <folder name>
This command will change your working directory to the folder you specify.  For example, if you said cd Documents, your working directory would change to the Documents folder.

cd ..
This command moves you up one level in the directory.

Let's look at an example.  I am using a Mac, so I'll use ls rather than dir.

1. I begin in my home directory:
~$

2. I type ls to see what's in my home directory, and I get this response:
Desktop
Documents
Pictures
Projects

3. I type cd Documents, and my working directory is now the Documents folder:
Documents$

4. I type ls to see what's in my Documents folder, and I get this response:
Blog Post Notes
Images for Testing
ProfilePhoto.jpg

5. I type cd "Blog Post Notes" (I'm using quote marks because the directory name has spaces in it), and my working directory is now the Blog Post Notes folder:
Blog Post Notes$

6. I type cd .. and I'm taken back to the Documents folder:
Documents$

7.  I type cd .. again and I'm taken back to my home folder:
~$

Now that you see how the example works, take some time to try it in your own command line, with your own folders!  Remember that if you are using Windows, your prompt will look like a > rather than a $, and you'll want to type dir instead of ls to see what's in your working directory.

Next week we'll continue the command line adventure by learning some more navigation skills and how to create our own files and folders.


9 comments:

  1. Nice post, thanks! I'm looking forward to the next part.

    ReplyDelete
    Replies
    1. I'm glad you liked it, Claudio! :-)

      Delete
    2. Hello all
      am looking few years that some guys comes into the market
      they called themselves hacker, carder or spammer they rip the
      peoples with different ways and it’s a badly impact to real hacker
      now situation is that peoples doesn’t believe that real hackers and carder scammer exists.
      Anyone want to make deal with me any type am available but first
      I‘ll show the proof that am real then make a deal like

      Available Services

      ..Wire Bank Transfer all over the world

      ..Western Union Transfer all over the world

      ..Credit Cards (USA, UK, AUS, CAN, NZ)

      ..School Grade upgrade / remove Records

      ..Spamming Tool

      ..keyloggers / rats

      ..Social Media recovery

      .. Teaching Hacking / spamming / carding (1/2 hours course)

      discount for re-seller

      Contact: 24/7

      fixitrogers@gmail.com

      Delete
  2. Wow, Well explained all the commands, thanks for this.

    ReplyDelete
    Replies
    1. I'm glad you found it helpful, Arjun! Be sure to check out Part II when it comes out this weekend! :-)

      Delete
  3. Hey Guys !

    USA Fresh & Verified SSN Leads with DL Number AVAILABLE with 99.9% connectivity
    All Leads have genuine & valid information

    **HEADERS IN LEADS**
    First Name | Last Name | SSN | Dob | DL Number | Address | City | State | Zip | Phone Number | Account Number | Bank Name | Employee Details | IP Address

    *Price for SSN lead $2
    *You can ask for sample before any deal
    *If anyone buy in bulk, we can negotiate
    *Sampling is just for serious buyers

    ==>ACTIVE, FRESH CC & CVV FULLZ AVAILABLE<==
    ->$5 PER EACH

    ->Hope for the long term deal
    ->Interested buyers will be welcome

    **Contact 24/7**
    Whatsapp > +923172721122
    Email > leads.sellers1212@gmail.com
    Telegram > @leadsupplier
    ICQ > 752822040

    ReplyDelete




  4. Hello World
    I’m hacker and Services provider
    interested in any thing i do fair deals.
    I will show you each and everything to start business
    also teaching Hacking / spamming short courses
    I have all tools that you need to spam

    .. Western Union transfer
    .. Credit cards
    .. Money adders
    .. Bill paying
    .. College fee
    .. Fake documents
    .. Grade change

    Contact:

    omoskovitz@gmail.com


    ReplyDelete
  5. If you are in need of financial Help, don't hesitate to place order for deserve Programmed card that can withdraw any amount limit you want. Deserve Card are very transparent aand easy to deal with. You can Purchase Deserve card that can withdraw up to $50,000 to $100,000 limit without being detected because of the programming of the card. I'm extremely grateful to them for being honest with their words and delivering the card to me. This is the third day of receiving the card and i have withdraw $9,500 from the Deserve Programmed Card. I tried purchasing the card previously from someone else, but it never arrived until i tried skylink technology for those in need of more money, you can also contact them. you can place order for the card Via whatsapp / telegram+1(213)785-1553 or their E-mail: skylinktechnes@yahoo.com

    ReplyDelete
  6. Excellent and professional investigative services. I hired Mr White for a very private and difficult matter of hacking my wife's phone and he far exceeded my expectations. He helped me get some info such as whatsApp, facebook, text messages, call logs and even phone conversations that I needed for proof of her secretive affair. The first time we spoke, we had a very long phone consultation in which he gave me all my options that he could think of to resolve my case, and he even recommended I try other options before hiring him, which shows that he is honest. I decided to hire him and I am glad I did. He is a fantastic investigator and a hacker; to all loyal partners out there if you have a dishonest partner don't hesitate to send him a mail Contact: Whitehatstech@gmail.com

    ReplyDelete

New Blog Location!

I've moved!  I've really enjoyed using Blogger for my blog, but it didn't integrate with my website in the way I wanted.  So I&#...