Basic Linux Command Line Information


SUBMITTED BY: Filodata

DATE: Nov. 21, 2017, 1:53 a.m.

FORMAT: Text only

SIZE: 4.5 kB

HITS: 828

  1. Now, most of you should know the Linux CLI pretty well by now as of what I've seen. If you already feel you know this, you dont have to attend this lesson. If you aren't very farmiliar with the base Linux CLI, feel free to listen in :)
  2. So to begin the venture into the command line, we need to think about how it works. The command line, also referred to as the CLI (Command Line Interface) is a window on your screen that you can type into. This window can control your entire computer and every process in it. It is essentially THE computer. Think of it like a place to send commands to the brain of a person. Thats basically what this is.
  3. It's commonly referred to as a terminal, because people call the linux CLI "terminal" and use the name "command prompt" for windows machines. We'll be talking about the linux CLI in this demonstration.
  4. Once you load up your terminal, it'll show something along these lines:
  5. Username@hostname:- $_
  6. The >Username< is the user that the terminal was opened with. For example, if it shows ' Root@hostname' then you are the root user.
  7. The >Hostname< is the name of your computer that other machines on the network see it as
  8. The >~< means home directory. This tells the terminal that you are cureently in the home directory inside the terminal. Finally, the >$< signifies that the terminal is done showing the presentable information and is awaiting a command, this is usually followed by a flashing cursor block or a flashing underscore, signifying it wants user input.
  9. Now, the terminal is basically an all text desktop. You dont need to use your mouse in the terminal because only the keyboard is needed when doing work in here. Basically, you can do everything on the computer from this box, you can launch websites and browsers, programs, etc. exactly how you would on your desktop. But instead of double clicking something, you type in a string of charectors to make it work.
  10. This takes us into commands. Commands of the terminal help you navagate and use it more efficiently. Hackers love the terminal because it's a central point of operation and isn't cluttered with design, like what most operating systems try to do with their GUI desktop environments. Anyways, lets take a look at some of the most basic commands you can launch.
  11. If you type in 'ls' into the terminal, it will show you the files currently inside the direcrory you are in.
  12. >> Now, this may consuse you. Because what directory are you in anyways? Well, in the terminal, right when you launch it it takes you to the home folder of the system. So if you were to type ls, it would show you every file and subfolder inside that directory.
  13. If you type 'cd directoryname' into terminal, replacing "directoryname' with an actual directory name, it'll move you to that directory. An example of this would be typing "cd Desktop" into the terminal right when it opens, because then it'll take you to your desktop directory, which is just the desktop of the computer. The terminak will remember that you are in your desktop directory by displaying the current directory before the $. Typing in the "ls" command while in the Desktop directory will display all files that are on your desktop.
  14. Now what happens when you want to go back? Lets say you were in your desktop directory, and on your desktop you have a folder called "ThotExterminator." Now, if you type in "cd ThotExterminator" (keep in mind the terminal is completely case sensitive) it
  15. Will bring you into the subfolder of the Desktop called "ThotExterminator" so if you want to get back into the desktop, you can't just type in "cd Desktop" again, because you already moved through and past that directory. So, to go back, use the following command:
  16. >cd ..<
  17. (Keep in mind the "><" are not included in the command)
  18. If you type this in, the system will register the ".." as the user wanting to go back a step in the directories and subfolders.
  19. So, if you are in Desktop/ThotExterminator/ (the terminal will let you know this by putting that behind the $) and want to get back into Desktop, just type "cd .."
  20. Now, a quick thing to remember. When we saw that $ shows you the terminal is awaiting input, keep in mind that is only for a normal user. If you are the root user in the terminal, (this is accomplished by either typing "sudo su" then a password, or right clicking the terminal icon and selecting "run as root") it will look different. As a root user, your $ changes to an # to show that you have system wide administrator privilages!

comments powered by Disqus