Jump to content
securitybreach

A Command Line Primer for Beginners

Recommended Posts

securitybreach

I know most of us are pretty familiar with the command line but I figured I would post this nice beginner's command line tutorial I just ran across for those that are not:

 

A Command Line Primer for Beginners

 

The command line isn't just for wise Linux beards. It's actually an awesome tool with almost limitless functionality. Here's a primer on how it works, and how you can do almost anything with it.

 

Note: This article is meant for people who are either new to the command line or only have a couple of command-line tricks up their sleeve. If you're already conversant with most basic commands, you can send this article to others that still aren't up to your skill level and spread the good word about how great the command line really is.

 

What Is the Command Line?

 

The command-line interface, sometimes referred to as the CLI, is a tool into which you can type text commands to perform specific tasks—in contrast to the mouse's pointing and clicking on menus and buttons. Since you can directly control the computer by typing, many tasks can be performed more quickly, and some tasks can be automated with special commands that loop through and perform the same action on many files—saving you, potentially, loads of time in the process.

 

The application or user interface that accepts your typed responses and displays the data on the screen is called a shell, and there are many different varieties that you can choose from, but the most common these days is the Bash shell, which is the default on Linux and Mac systems in the Terminal application......

 

http://lifehacker.co...almost-anything

  • Like 4

Share this post


Link to post
Share on other sites
V.T. Eric Layton

Good stuff at Lifehacker occasionally. :yes:

  • Like 1

Share this post


Link to post
Share on other sites
sunrat

Great article. I learned a few things. :thumbsup:

 

As usual, some of the comments are gold:

Only thing a beginner should be typing in a command line is "exit"

:D

 

And more CLI fun:

http://uni.xkcd.com/ B)

  • Like 3

Share this post


Link to post
Share on other sites
ichase

Even with being some what comfortable with the command line, these simple beginner lessons still do show or remind you of things that you may not have known or have forgotten. Always good info. Thanks for posting Josh. :)

  • Like 1

Share this post


Link to post
Share on other sites
V.T. Eric Layton
Only thing a beginner should be typing in a command line is "exit"

 

With just a few weeks' practice, they could probably master CTRL + D, also. ;)

  • Like 1

Share this post


Link to post
Share on other sites
securitybreach

Even with being some what comfortable with the command line, these simple beginner lessons still do show or remind you of things that you may not have known or have forgotten. Always good info. Thanks for posting Josh. :)

 

No problem, glad to see you back around these parts. :)

Share this post


Link to post
Share on other sites
abarbarian

Found a handy tip that may be useful for folk. Did not know where to place it so looked through the site to try and find somewhere. Found these three threads,

 

https://forums.scotsnewsletter.com/index.php?/topic/17727-bashrc/&tab=comments#comment-216281

 

https://forums.scotsnewsletter.com/index.php?/topic/21347-amazing-bashrc/&tab=comments#comment-254698

 

https://forums.scotsnewsletter.com/index.php?/topic/29804-my-new-~bashrc/&tab=comments#comment-280817

 

but they did not seem right so posted here.

 

I think I am a tad dyslexic as I make some very strange mistakes when typing. This can be a real pain on the command line and i think most folk make simple mistakes when typing on the command line. This simple tip will help, simply place this in your .bashrc.

 

# Correct dir spellings
shopt -q -s cdspell

 

I was a tad dubious as I have " ls " and " sl " in my bash commands. Would this tip interfere with either ? My /home contains a folder called " Downloads " and I often just type " downloads " Would the tip automatically sort out my error ? Only one way to find out, trial and error it is then.

 

 Put brain in gear befor pressing enter10:18:35-->Fri May 29-->~
-->cd downloads
Downloads
 Put brain in gear befor pressing enter10:19:17-->Fri May 29-->Downloads
-->cd /eetc
/etc
 Put brain in gear befor pressing enter10:20:21-->Fri May 29-->etc
-->cd cup
cups
 Put brain in gear befor pressing enter10:22:11-->Fri May 29-->cups
-->ls
classes.conf        cups-files.conf          printers.conf.O
cups-browsed.conf   cups-files.conf.default  snmp.conf
cupsd.conf          cups-pdf.conf            snmp.conf.default
cupsd.conf.default  ppd                      ssl
cupsd.conf.O        printers.conf            subscriptions.conf
 Put brain in gear befor pressing enter10:22:22-->Fri May 29-->cups
-->sl
 Put brain in gear befor pressing enter10:22:33-->Fri May 29-->cups
-->cd ~/.BOICN
/home/bloodaxe/.BOINC
 Put brain in gear befor pressing enter10:27:18-->Fri May 29-->.BOINC
-->

As you can see the tip works well auto correcting some pretty bad mistakes. If you make a mistake you do not have to do anything extra, the terminal shows that a mistake has been made but you just press enter as normal so your flow is not interrupted.Oh and ls and sl  work the train still runs.

 

Found the information here,

 

https://bash.cyberciti.biz/guide/Setting_shell_options

 

😎

  • Agree 1

Share this post


Link to post
Share on other sites
securitybreach

You just have to get used to using the tab key for spelling. I haven't used more than 2-3 letters to spell out a directory, command or a file in years.

  • +1 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...