Diving Into Bash: Difference between revisions

From HackRVA
Jump to navigation Jump to search
No edit summary
No edit summary
Line 6: Line 6:
At this point you should have your shell open and ready for input.
At this point you should have your shell open and ready for input.


To find which directory you are in type the following command.
To find which directory you are in, type the following command.


   pwd
   pwd
Line 15: Line 15:


== Make a directory==
== Make a directory==
Now, let's make a new directory!
Type the following command:
   mkdir myNewDirectory
   mkdir myNewDirectory
[http://linux.die.net/man/1/mkdir mkdir] stands for ''Make Directories''.




== See contents of that Directory ==
If you type [http://linux.die.net/man/1/ls ls], you will see the directory you just created.
 
   ls
   ls
The ls command will ''list'' the contents of a directory.   
The ls command will ''list'' the contents of a directory.   


== Change Directory ==
== Change Directory ==
To navigate between directories, you will need to use the [http://linux.die.net/man/1/cd Change Directory] command.  Take note of the output of pwd:
   cd myNewDirectory
   cd myNewDirectory
  pwd
   cd ..
   cd ..
  pwd
   cd /
   cd /
  pwd
   cd /home/linux101
   cd /home/linux101
  pwd
   ls -l
   ls -l
Notice that we've added more to the end of the ls command.  This is a parameter.  You can learn more parameters by prefacing your command with man.
 
i.e. ''man ls'' will output the man page of ''ls''
Notice that we've added a parameter to the end of the ls command.  Passing parameters to a command can allow you to make that function behave differently. 
 
If you compare the difference between ls and ls -l , you will see that ls -l gives you a more detailed view of this data (i.e. a long list.) You can discover more parameters of a command by looking at it's man page.
 
Yo dawg, take a look at the man page of the man command.
  man man
 
A man page will typically give you a synopsis, description, examples of the command and what options(parameters) it will take.
 


   cd /
   cd /

Revision as of 11:21, 10 March 2016

Introduction to Linux(Linux 4 n00bs)


Where am I?

At this point you should have your shell open and ready for input.

To find which directory you are in, type the following command.

 pwd

This will output the directory that you are currently working in.

pwd stands for Print Working Directory.

Make a directory

Now, let's make a new directory!

Type the following command:

 mkdir myNewDirectory

mkdir stands for Make Directories.


If you type ls, you will see the directory you just created.

 ls

The ls command will list the contents of a directory.

Change Directory

To navigate between directories, you will need to use the Change Directory command. Take note of the output of pwd:

 cd myNewDirectory
 pwd
 cd ..
 pwd
 cd /
 pwd
 cd /home/linux101
 pwd
 ls -l

Notice that we've added a parameter to the end of the ls command. Passing parameters to a command can allow you to make that function behave differently.

If you compare the difference between ls and ls -l , you will see that ls -l gives you a more detailed view of this data (i.e. a long list.) You can discover more parameters of a command by looking at it's man page.

Yo dawg, take a look at the man page of the man command.

 man man

A man page will typically give you a synopsis, description, examples of the command and what options(parameters) it will take.


 cd /
 cd ~
 pwd
 ls -l
 chmod 777 myNewDirectory
 ls -l
 rmdir myNewDirectory

External Links

  1. linux.com : Bash 101: Working at the CLI, Joe 'Zonker' Brockmeier