Don's Pages and my Music

Monday, June 3, 2013

Linux Terminal Basics and some Commands - Codecademy

Here's a nice little article about the Linux Terminal Basics and some Commands from Codecademy. Just try to ignore the beginning words, about how they think that everyone is "Afraid" of the Terminal - Command Line". I get to tired of reading this kind of lingo in every article about the Linux Terminal or Command Line. I'm not a bit afraid of the Terminal. I just don't want to waste my time Mucking Around with hard to remember and even harder to type accurately Commands. Not, if i can find a faster way to do what I need to do in a GUI App. And since I started using Linux in 2005. I have found many ways around using the Terminal. But, I do use it. When it is faster to get something done, with a few simple commands. Or if necessary to get something done. When I can find no way to do it easier in the GUI. And I can copy and past some more complicated commands in, from a Web Site or something that I have saved on my Computer. Then, I can do it and I am not afraid. What's there to be afraid of, anyway? The Terminal tells you when you try to do something wrong and asks if you want to do it. But, in many GUI Apps. You can very quickly mess or even break your Linux OS. Without any warning message at all. Just open up GParted and got to work in there. Without knowing what you are doing and see... So, that's my rant for today... Now, here's the info...

Don

Getting Comfortable in the Terminal: Linux

If needed, You can Read the first Steps on the Site. Here are some Basic Terminal Commands...

Step 2: Start an Application

The most basic operation that a user can do from the terminal is start an application. On almost every Linux system, simply using the name of the executable in the /usr/bin directory will start the application. For example, starting the Firefox web browser simply requires typing “firefox” into the command line and pressing enter. You should now see a session of Firefox launch on your desktop. Congratulations! You just executed your first command from the terminal!

Note: Launching an application from the terminal will lock that terminal instance so that you cannot do anything else with it. If you want to be able to use the terminal for other activities, trailing the application executable name with a “&” will put the process in the background of the terminal and you will be able to use the terminal for other things.

Step 3: Get Specific

Launching an application is not all that the terminal can do. You can launch applications and tell the application to edit such and such file (in the case of a text editor, such as Nano, Vim, or Emacs. Nano is the default terminal text editor for most Linux distributions) or you can tell a web browser to launch such and such a web page. For example, the command:

firefox www.codecademy.com  

will launch a session of firefox and open the session on the Codecademy home page.

Step 4: Entering Commands

Now that you know how to launch an application, you will also need to know how to traverse the file system straight from the terminal as doing so is a big part of many operations that are done in the terminal.

To start off, enter the command pwd. You should now see something along the lines of

/home/{username}/  

The above command stands for Print Working Directory so the directory that you see posted to the terminal is the directory that the terminal is currently in. Now enter the command “ls”. You should now see something along the lines of:

Desktop/    Documents/    Downloads/    Music/    Pictures/    Videos/  

And all of the other folders that your home directory contains. The ls command can be thought of as standing for LiSt the contents of the present folder.

A Brief Note on Flags

Before we go any further, you will need to know about flags. Flags are options that are passed to a command that extend the command to accomplish another task at the same time.

Now type the command ls -a (-a meaning all). You should see everything that you saw using the ls command but also you should see a bunch of folders and files that begin with a .. These extra files/folders are “hidden” so as not to clutter up your home directory with files that you may only open once in the life of the computer (if that). As you may have guessed, the difference between a hidden and not hidden file is the beginning dot. The dot tells Linux to hide the folder/file.

Step 5: Change Directories

One last command that you must know to be able to start using the terminal effectively is the cd command. If you type cd by itself, you most likely will go back to your home directory or nothing will happen. This is because the cd command stands for Change Directory.

Because you didn’t pass cd an argument, the terminal has no clue what folder it should enter. The most important cd arguments that you will need to know are {childFolderName}, .., . and ~.

  • {childFolderName} argument tells the terminal to enter the folder in the current directory by the name of {childFolderName}
  • .. tells the terminal to go to the parent folder of the current directory
  • . when used in conjunction with /{folderName} tells the terminal to enter the child folder of the current directory by the name of {folderName}
  • ~ tells the terminal to go back to the home directory (/home/{username}).

Other Useful Commands

Here is a list of other commands that you will probably find useful:

  • mkdir “Makes” a directory in the file system at the specified file path.
  • rm Deletes (“removes”) the file at the specified file path.
  • rmdir Deletes the directory at the specified path.
  • man Opens the MANual pages for the specified command or application. For example, man ls will open the man page that contains all of the information and flag options for the “list” command. This is especially useful to see if a program offers any extra functionality or to figure out how to configure a program.

That's it! Now you're ready to get started in your terminal.

Want to start with the basics? Try our Python track to get started.


Read More...
http://www.codecademy.com/blog/72-getting-comfortable-in-the-terminal-linux

Command Line - Terminal info


20 Popular Command-Line Tips for Linux | TuxArena
Anatomy of command line arguments in Linux | MyLinuxBook
Audiovox Online Store
Command-line Photographic Workflow on Linux « Scribbles and Snaps
Download 10 command-line tools that refuse to die | TechRepublic
Grub's Command Line Boot Winxp
HOWTO: Control the gnome VNC vino-server from the command line - Ubuntu Forums
HOWTO: Control the gnome VNC vino-server from the command line - Ubuntu Forums
[Jamie Zawinski] controls his drapes from the command line
[Jamie Zawinski] controls his drapes from the command line - Hack a Day
Linux Today - Anatomy of command line arguments in Linux
Linux Today - Command Line vs. GUI Reality Check
Linux Today - How to post content to a WordPress blog from the command line
Linux Today - Manage Google Services from the Command Line on Linux
Linux Today - The Command Line: Nothing to be scared of
Linux Today - The funny side of Linux command line
ls* Commands Are Even More Useful Than You May Have Thought
Make CD-ROM Recovery (mkCDrec) (Command line but has some commands listed)
Make CD-ROM Recovery (mkCDrec) (Command line but has some commands listed)
Make CD-ROM Recovery (mkCDrec) (Command line but has some commands listed)
Movgrab : Cool Command Line Tool for Downloading Video Clips and Movies - Ubuntu Portal
mpg321 - command line mp3 player
mpg321 - command line mp3 player
mpg321 - command line mp3 player
Realeyes Technology: Command Line vs. GUI Reality Check
[Solved] How to delete line breaks with global command? (View topic) • OpenOffice.org Community Forum
Getting Comfortable in the Terminal: Linux | Codecademy
Linux Today - Have Online Communities become Havens for the Terminally Angry?
GNULinux terminal server supplementals
Linux Today - 15 Great Tools for the Terminal
9 Good Terminal Emulators for Linux | Tech Drive-in
Linux Today - Create Bash Aliases For Faster Terminal Commands In Linux
How to Manage Processes from the Linux Terminal: 10 Commands You Need to Know - How-To Geek
How to Quickly Resize, Convert & Modify Images from the Linux Terminal - How-To Geek
Set up a free and secure Terminal Server with Linux | TechRepublic
Set up a free and secure Terminal Server with Linux | TechRepublic
GNU/Linux terminal server supplementals
Set up a free and secure Terminal Server with Linux | TechRepublic
Set up a free and secure Terminal Server with Linux | TechRepublic
Linux Today - Getting Comfortable in the Linux Terminal
Linux Today - Determine If Shell Input is Coming From the Terminal or From a Pipe
Stellaris® Flash Programmer, GUI and command line - LMFLASHPROGRAMMER - TI Software Folder
The funny side of Linux command line - MyLinuxBook | MyLinuxBook
Ubiquity, a browser command line - Hack a Day
Ubiquity, a browser command line - Hack a Day
WinZipr Command Line Add-On
xclip - Copy contents from command line to X clipboard in openSUSE | SUSE & openSUSE
xclip - Copy contents from command line to X clipboard in openSUSE | SUSE & openSUSE
xclip - Copy contents from command line to X clipboard in openSUSE | SUSE & openSUSE
yum upgrade kernel commands fedora 12 - Google Search

No comments:

Post a Comment