-->

  • top 5 linux command for beginners


    top 5 linux command for beginners




    As data sets are getting larger and more prevalent, researchers are having to try to to tons of leg add reference to core programming - resulting in longer spent with tools like GIT and Kali Linux (something we have seen Hardly done before!).

    For software engineers reading this post: you would possibly not find the subsequent useful, but as someone who has been through those early self-taught days as a junior researcher, i might like to see data scientists or ML researchers Feeling of budding pain!

    Looking at all of that, i assumed about what commands i exploit daily and in my routine and which commands I wanted to understand beforehand. So from this, i'm now presenting my top 5 Kali Linux commands which have helped me reach the highest of my career! top 5 linux command for beginners


    Command 1: grep


    grep sounds like the noise frogs make, but actually it stands for Global regular expression print. That long phrase doesn’t make much sense outright, but the essential use case for the grep command is to search for a particular string in a given file.



    The function is fairly quick and incredibly helpful when you’re trying to diagnose an issue on your production box, in which for example, you may think a TXT file has some bad data.



    As an example, say we’re searching for the string 'this’ in any file which begins with the name 'demo_’:


    $ grep "this" demo_*
    demo_file:this line is the 1st lower case line in this file.
    demo_file:Two lines above this line is empty.
    demo_file:And this is the last line.
    demo_file1:this line is the 1st lower case line in this file.
    demo_file1:Two lines above this line is empty.
    demo_file1:And this is the last line.


    Not so bad huh? We can see on the left hand side that there are two files that begin with demo (demo_file and demo_file1)





    Command 2: wget


    Now we move onto something a little bit more sophisticated but still something we use quite a lot. The wget command is a useful utility used to download files from the internet. It runs in the background so can be used in scripts and cron jobs.

    To utility is called as follows:


    wget <URL> -O <file_name>

    Where the following is an example if we wanted to download a file:

    wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.2.tar.xz




    Command 3: wc


    Often you have a file of arbitrary length and something smells fishy: maybe the size of the file seems too small for the number of rows you expect or something you’re just curious how many words are in it. Either way, you want to inspect it a bit more and need a command to do so.

    The wc command helps out in that it essentially counts a few different things for the file in reference:


    # wc --help
    Usage: wc [OPTION]... [FILE]...
      -c, --bytes            print the byte counts
      -m, --chars            print the character counts
      -l, --lines            print the newline counts
      -L, --max-line-length  print the length of the longest line
      -w, --words            print the word counts
          --help            display this help and exit
          --version            output version information and exi

    So, say we want to count the number of lines in a file:


    wc -L tecmintt.txt


    16 tecmintt.txt


    or maybe the number of characters:


    wc -m tecmintt.txt


    112 tecmintt.txt


    Awesome!




     

    Command 4: Vi



    The vi command is super helpful as it allows you to open and explore a file. The command works as follows:


    vi [filepath]


    And it takes you into an editor sort of thing. Now in this editor, you can use the following characters to navigate:


    k    Up one line 
    j    Down one line 
    h    Left one character 
    l    Right one character (or use <Spacebar>)
    w    Right one word
    b    Left one word



    However, in reality, you’ll find navigation pretty naturally. The following commands will be the most useful though:



    ZZ     Write (if there were changes), then quit
    :wq    Write, then quit 
    :q     Quit (will only work if file has not been changed) 
    :q!    Quit without saving changes to file


    You’ll learn to love vi, I swear!




     

    Command 5: CTRL+R



    So I’ve saved the best for last as I really use this command quite a lot. CTRL+R isn’t really a command but more a shortcut type of thing. It allows you to search your history of used commands by typing in something which resembles the command, and then similar commands that you’ve used before come up!


    For example, say you’ve just run a really long command and for whatever reason your terminal session breaks and you have to re-run the command again. With this command, you can quickly search for it again instead of reconstructing the command from scratch!


    Let’s say I’m trying to remember a command that begins with hi, but I can’t remember it all. I type in ctrl+r and then I see what it recommends:



    $ historybck-i-search: his_



    Perfect! The command history has been recommended and that’s exactly the
    command we were looking for. If you press tab at this point, the autocomplete fills in the line:



    $ history




    I’ve actually always struggled to use both Linux and GIT but over time, I’ve managed to remember a few key commands that’ve helped my development as an independent researcher. I can work fairly independently now and it’s thanks to the above command line tools that I’m able to so.

    Therefore, I really recommend spending a few hours getting used to linux as the small lessons you take now will really help progress your use of the system going forward. It’s pure upside!




    I hope you liked this post, then you should not forget to share this post at all.
    Thank you so much :-)


  • 0 comments:

    Post a Comment

    For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.