Diving Into Bash: Difference between revisions

From HackRVA
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


== Where am I? ==
== Where am I? ==
At this point you should have your shell open and ready for input.
At this point you should have your [http://www.linfo.org/shell.html 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.
Line 54: Line 54:




  cd /
Exit it out of the man page and you should see the output of your last command
  cd ~
 
  pwd
'''drwxr-xr-x 2 linux101 linux101  4096 Mar 10 11:29 myNewDirectory'''
  ls -l
 
The output is showing us the permissions, ownership, datestamp and Name of the directory.
You can read more on permissions [http://www.linux.org/threads/file-permissions-chmod.4094/ here.]
 
 
 
For the sake of learning, let's throw security out the window.  Change the permissions on your new directory to Allow All.  You can do this by running the following command:


   chmod 777 myNewDirectory
   chmod 777 myNewDirectory
   ls -l
   ls -l
You should now see something similar to this:
'''drwxrwxrwx 2 linux101 linux101  4096 Mar 10 11:29 myNewDirectory'''
Read, Write and Execute is enabled for the User, the Group and Others.
[[File:LinuxPermissions.jpg]]
   rmdir myNewDirectory
   rmdir myNewDirectory


== External Links ==
== External Links ==
# linux.com : [https://www.linux.com/learn/tutorials/272346-bash-101-working-at-the-cli ''Bash 101: Working at the CLI''], Joe 'Zonker' Brockmeier
# linux.com : [https://www.linux.com/learn/tutorials/272346-bash-101-working-at-the-cli ''Bash 101: Working at the CLI''], Joe 'Zonker' Brockmeier

Revision as of 11:57, 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.


Exit it out of the man page and you should see the output of your last command

drwxr-xr-x 2 linux101 linux101 4096 Mar 10 11:29 myNewDirectory

The output is showing us the permissions, ownership, datestamp and Name of the directory. You can read more on permissions here.


For the sake of learning, let's throw security out the window. Change the permissions on your new directory to Allow All. You can do this by running the following command:

 chmod 777 myNewDirectory
 ls -l


You should now see something similar to this:

drwxrwxrwx 2 linux101 linux101 4096 Mar 10 11:29 myNewDirectory

Read, Write and Execute is enabled for the User, the Group and Others.





 rmdir myNewDirectory

External Links

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