pwd
: or print working directory, shows the directory you are currently inls
: lists all contents of a directory (folder)cd
: or change directories, use this to move to a different part of your computercheck the current working directory (where you are on your computer): pwd
note you should be in the home
directory
list the contents of the home
directory: ls
choose a FOLDER to open, or change the working directory
, with cd
: cd FOLDER
for example cd Downloads
note the command line has autocomplete, hit TAB as you type characters to try to use it!
hit ENTER to run the command
check the command prompt, notice anything different?
my command prompt (for example)
(base) 95-mdpmclapca:~ cta$
(base) 95-mdpmclapca:Downloads cta$
confirm that the present working directory
has changed: pwd
list the contents of the FOLDER directory (Downloads
in my example): ls
return to the home
directory with this SUPER FUN SHORTCUT: cd ~
confirm that the present working directory
is now the home
directory: pwd
note that the command prompt has returned to its default state
my command prompt (for example) (base) 95-mdpmclapca:~ cta$
mkdir
: make and name a new directorytouch
: make and name a new fileecho
: outputs the strings being passed as arguments>
: overwrite data in a file (if the file exists)>>
: append data to a file (if the file exists)cat
: reads data from a file and outputs the datanano
: or GNU nano, a text editormkdir
: mkdir DATA
DATA
: cd DATA
present working directory
has changed: pwd
.txt
file with touch
: touch data.txt
data.txt
is present in DATA
: ls
echo
: echo "Hello World"
echo
to pass information into a file
with >
: echo 'data1' > data.txt
cat
: cat data.txt
data2
to our file with the following: echo 'data2' > data.txt
cat
, see any issues here?: cat data.txt
cat
reveals that the command in step 9 has overwritten data1
with data2
data2
with data1
: echo 'data1' > data.txt
>>
to append data2
to data.txt
: echo 'data2' >> data.txt
confirm the contents of our file with cat
: cat data.txt
you should see both data1
and data2
nano
, the command to launch teh GNU nano text editor. Open data.txt
in nano: nano data.txt
data.txt
with the arrow keys and will notice a rather old-fashioned User Interface at the bottom of the window. Ctl-X to exit