You should see something like this:
For Windows users:
You should see somethign like this:
In [6]:
# To run these commands in the Jupyter Notebook, preceed with a exclamation mark (!)
!pwd
Creates a directory
mkdir # mkdir directory
mkdir # mkdir directory
In [3]:
!mkdir test
In [4]:
!ls
Changes directories with a specified path (absolute path)
cd pathname # cd /directory/directory
cd pathname # cd C:/directory/directory
In [5]:
!cd test
Changes directories with a relative path
cd .. # cd ..
cd.. # cd..
In [7]:
!pwd
In [ ]:
Absolute paths start at the root directory in Linux and at the Hard drive Letter in Windows:
/Users/username/Document/BIOF309/file.txt
C:/Users/username/Documents/BIOF309/file.txt
Relative paths are "relative" to the programs currentl location.
A file in the same directory can be prefaced with "./" in linux but Jupyter Notebook does not require it
.\file.txt # Current directory
Lists files
ls # ls
dir # dir
Create a file
nano # nano hello.txt
dir > # dir > hello.txt
Copies files
cp # cp thisfile.txt /home/thisdirectory
copy # copy thisfile.txt C:/Users/thisdirectory
In [ ]:
Moves files
mv # mv thisfile.txt /home/thisdirectory
move # move thisfile.txt C:/Users/thisdirectory
In [ ]:
Deletes files
rm # rm thisfile.txt
del # rm thisfile.txt
In [ ]:
Compares the contents of files
diff # diff file1 file2
fc # diff file1 file2
In [ ]:
Finds a string of text in a file
grep # grep word or phrase thisfile.txt
find # grep word or phrase thisfile.txt
In [ ]:
Views contents of a file
less # less thisfile.txt
more # less thisfile.txt
To get out type "q"
In [ ]:
Renames a file
mv # mv thisfile.txt thatfile.txt
ren # ren thisfile.txt thatfile.txt
In [ ]: