- GUI file managers are built on top of coreutils (GNU/BSD)
- you can just run the coreutils directly in a shell
- reads command and spits out the result
- matrix of monospaced text
- syntax: binary space arg1 space arg2 space ...
Run in a terminal next to a Finder window in the same directory to see results:
touch filename
ls
cp
mv
rm
ln -s
mkdir filename
cd
pwd
But the shell does more flexible things too!
cat filename
echo "text"
- every command can take an arbitrary amount of text as input (
stdin
) and spit output onstdout
- by default:
stdin
is emptystdout
is connected to the terminal
- you can take the contents of files as input: "taking a file as
stdin
" - you can put the output of a command into a file: "redirecting
stdout
to file" - you can feed the output of a command and feed it as input to another: "piping"
stderr
is likestdout
but usually connected to a terminal in case something goes wrong
echo "hello" > hello.txt
echo "world" >> hello.txt
echo "angry message" | tr a-z A-Z
echo "NICE MESSAGE" | tr A-Z a-z
echo "angry message" | tr a-z A-Z > email.txt
rm email.txt
tr a-z A-Z < hello.txt > HELLO.txt
echo "proprietary software sucks" | lolcat
yes "proprietary software sucks" | head | lolcat
yes "proprietary software sucks" | lolcat
mosh / ssh
nvim
htop
tmux
sl
^C
^Z
bg
fg
some_command &
pbpst
curl