Let’s see what this command does
ls -l -h ~/
Which bit is the command, the options, the argument
ls
commandThis command is the equivalent of a Finder window or a windows explorer window. Instead of navigating with the mouse we do it with text.
pwd
mkdir test
ls
cd test
pwd
The mkdir
command can be used to create a directory
mkdir test
ls
The touch
command can be used to create an empty file.
touch afile
ls
To copy afile
into test
we use the cp
(Copy) command
cp afile test/
ls
ls test
Or we could move mv
the file (Careful)
mv afile test/
ls
ls test
cd
pwd
cd /home/iracooke
Equivalent to
cd /
cd home
cd iracooke
Special paths
cd ..
cd ~
First we need a file with something in it!
We can use the fortune command to generate some text
fortune
Each time you run it will produce something different
fortune
fortune
touch fortunes.txt
for i in $(seq 10);do echo "Fortune $i" >> fortunes.txt; fortune >> fortunes.txt;done
head fortunes.txt
tail fortunes.txt
grep 'Fortune' fortunes.txt
wc fortunes.txt
head fortunes.txt | wc
head fortunes.txt