Skip to content

Commit

Permalink
Intro to Linux added
Browse files Browse the repository at this point in the history
  • Loading branch information
Jigyasa3 authored Aug 26, 2016
1 parent bb601fc commit faa2eeb
Showing 1 changed file with 239 additions and 0 deletions.
239 changes: 239 additions & 0 deletions notebooks/Introduction to Linux.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# History of Linux\n",
" ## Linux was developed by Linus Torvalds, a computer science student at University of Helsinki. \n",
" He wanted to make a freely available version of # Hist UNIX for home users as UNIX was only available at Universities or Offices. So he developed LINUX. (http://www.tldp.org/LDP/intro-linux/html/sect_01_03.html)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Common Linux commands-\n",
"\n",
"cd /directorypath\tChange to directory.\n",
"\n",
"clear\tClear a command line screen/window for a fresh start.\n",
"\n",
"cp [options] source destination\tCopy files and directories.\n",
"\n",
"date [options]\tDisplay or set the system date and time.\n",
"\n",
"file [options] filename\tDetermine what type of data is within a file.\n",
"\n",
"find [pathname] [expression]\tSearch for files matching a provided pattern.\n",
"\n",
"grep [options] pattern [filesname]\tSearch files or output for a particular pattern.\n",
"\n",
"less [options] [filename]\tView the contents of a file one page at a time.\n",
"\n",
"ls [options]\tList directory contents.\n",
"\n",
"man [command]\tDisplay the help information for the specified command.\n",
"\n",
"mkdir [options] directory\tCreate a new directory.\n",
"\n",
"mv [options] source destination\tRename or move file(s) or directories.\n",
"\n",
"pwd\tDisplay the pathname for the current directory.\n",
"\n",
"rm [options] directory\tRemove (delete) file(s) and/or directories.\n",
"\n",
"rmdir [options] directory\tDelete empty directories.\n",
"\n",
"tail [options] [filename]\tDisplay the last n lines of a file (the default is 10).\n",
"\n",
"head [options] [filenname] Displays the first n lines of a file (the default is 10)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Now lets use some of these commands on our phage data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 1. ls command lists the content of the directory"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Volume in drive C is Windows\n",
" Volume Serial Number is 0EDB-005C\n",
"\n",
" Directory of C:\\Users\\Jigyasa\\phage-lab-master\\notebooks\n",
"\n",
"2016-08-25 04:14 PM <DIR> .\n",
"2016-08-25 04:14 PM <DIR> ..\n",
"2016-08-25 04:11 PM <DIR> .ipynb_checkpoints\n",
"2016-08-22 06:59 PM 10,802 1. Raw data.ipynb\n",
"2016-08-25 04:14 PM 2,542 Introduction to Linux.ipynb\n",
"2016-08-22 06:59 PM <DIR> reads\n",
" 2 File(s) 13,344 bytes\n",
" 4 Dir(s) 133,559,926,784 bytes free\n"
]
}
],
"source": [
"ls"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2. pwd displays the pathname of the current working directory"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"u'C:\\\\Users\\\\Jigyasa\\\\phage-lab-master\\\\notebooks'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pwd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 3. cd helps to change the current directory"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"C:\\Users\\Jigyasa\\phage-lab-master\\notebooks\\reads\n"
]
}
],
"source": [
"cd reads"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 4. cd .. takes you back to parent directory which is \"notebooks\" in this case.\n",
"### You can also use cd / which takes you to the root directory"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"C:\\Users\\Jigyasa\\phage-lab-master\\notebooks\n"
]
}
],
"source": [
"cd .."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 5. ls -lh lists the files in long format with readable file size\n",
"### ./ command lets you run a file in current directory"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"'ls' is not recognized as an internal or external command,\n",
"operable program or batch file.\n"
]
}
],
"source": [
"!ls -lh ./reads"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

0 comments on commit faa2eeb

Please sign in to comment.