kayiwa@catchyname:~$ whoami
kayiwa
kayiwa@catchyname:~$ env
_=/usr/bin/env
TWITTER=kayiwa
EMAIL=kayiwa@pobox.com
PRESENTATION_NAME="Introduction to the command-line"
Code_of_conduct="http://code4libnys.github.io/2016/"
dritchie@cliwkshp:~$ passwd
Changing password for dritchie.
(current) UNIX password:
passwd
online help
man
dritchie@cliwkshp:~$ man -k spell
aspell-autobuildhash (8) - Autobuilding aspell hash files for some dicts.
...
ispell-wrapper (1) - smart wrapper for ispell
man 1 ispell-wrapper
ISPELL-WRAPPER(1) ISPELL-WRAPPER(1)
NAME
ispell-wrapper - smart wrapper for ispell
SYNOPSIS
ispell-wrapper [--emacs=name] [--language=regexp] [--dry-run] [ispell options] file
dritchie@cliwkshp:~$ man man
MAN(1) Manual pager utils MAN(1)
NAME
man - an interface to the on-line reference manuals
SYNOPSIS
man [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale] [-m system[,...]] [-M path]
[-S list] [-e extension] [-i|-I] [--regex|--wildcard] [--names-only] [-a] [-u] [--no-subpages] [-P
pager] [-r prompt] [-7] [-E encoding] [--no-hyphenation] [--no-justification] [-p string] [-t]
[-T[device]] [-H[browser]] [-X[dpi]] [-Z] [[section] page ...] ...
man -k [apropos options] regexp ...
man
help
dritchie@cliwkshp:~$ <command> -h
dritchie@cliwkshp:~$ <command> --help
dritchie@cliwkshp:~$ ispell-wrapper -h
Usage: ispell [-dfile | -pfile | -wchars | -Wn | -t | -n | -H | -x | -b | -S | -B | -C | -P | -m | -Lcontext | -M | -N | -Ttype | -ktype kws | -Fpgm | -V] file .....
ispell [-dfile | -pfile | -wchars | -Wn | -t | -n | -H | -Ttype | -ktype kws | -Fpgm] -l
ispell [-dfile | -pfile | -ffile | -Wn | -t | -n | -H | -B | -C | -P | -m | -Ttype | -ktype kws | -Fpgm] [-a | -A]
ispell [-dfile] [-wchars | -Wn] -c
ispell [-dfile] [-wchars] -e[1-4]
ispell [-dfile] [-wchars] -D
ispell -v
Whenever a word is found that is not in the dictionary,
it is printed on the first line of the screen. If the dictionary
contains any similar words, they are listed with a number
next to each one. You have the option of replacing the word
completely, or choosing one of the suggested words.
apropos
dritchie@cliwkshp:~$ apropos "text editor"
1. Use the online manual to find which command line editors are available
2. Use the online manual to find out how to list files
pwd
dritchie@cliwkshp:~$ pwd
/home/dritchie
ls
dritchie@cliwkshp:~$ ls --help
dritchie@cliwkshp:~$ ls -l
dritchie@cliwkshp:~$ ls -a
dritchie@cliwkshp:~$ ls -latg
dritchie@cliwkshp:~$ ls -hitlar
cat, more, less
dritchie@cliwkshp:~$ cat /etc/motd
dritchie@cliwkshp:~$ more /etc/motd
dritchie@cliwkshp:~$ less /etc/motd
cp
dritchie@cliwkshp:~$ man cp
dritchie@cliwkshp:~$ ls
dritchie@cliwkshp:~$ cp cli_workshop/data_files/22631-0.txt .
dritchie@cliwkshp:~$ ls
mv
dritchie@cliwkshp:~$ mv 22631-0.txt timbuctoo.txt
dritchie@cliwkshp:~$ timbuctoo.txt Desktop/timbuctoo.txt
rm
dritchie@cliwkshp:~$ touch new_file_to_purge.txt
dritchie@cliwkshp:~$ ls
dritchie@cliwkshp:~$ rm -i new_file_to_purge.txt
chmod
dritchie@cliwkshp:~$ chmod o+w 22631-0.txt
dritchie@cliwkshp:~$ chmod g-w 22631-0.txt
dritchie@cliwkshp:~$ chmod 700 22631-0.txt
dritchie@cliwkshp:~$ chown :belllabs 22631-0.txt
cd, mkdir, pwd
dritchie@cliwkshp:~$ cd
dritchie@cliwkshp:~$ cd /usr/bin
dritchie@cliwkshp:~$ cd ~/Desktop
dritchie@cliwkshp:~$ mkdir ~/Desktop/cliworkshop
dritchie@cliwkshp:~$ pwd
emacsmg, nano,vimvi
file redirection
dritchie@cliwkshp:~$ sort < cli_workshop/data_files/library-visits.csv > sorted.csv
dritchie@cliwkshp:~$ in2csv cli_workshop/data_files/Evidovane-knihovny.xls > converted_file.csv
pipes
dritchie@cliwkshp:~$ sort --help | less
dritchie@cliwkshp:~$ in2csv --help | less
alias
dritchie@cliwkshp:~$ alias whereami='ls al && pwd'
dritchie@cliwkshp:~$ alias please='sudo'
dritchie@cliwkshp:~$ alias md='mkdir -p'
dritchie@cliwkshp:~$ w
dritchie@cliwkshp:~$ who
dritchie@cliwkshp:~$ ls
dritchie@cliwkshp:~$ !1
dritchie@cliwkshp:~$ cd /tmp
dritchie@cliwkshp:~$ !3
dritchie@cliwkshp:~$ !c
dritchie@cliwkshp:~$ !w
1. If a user logs into a Unix system and types the following input to the shell, list the commands executed by the shell for each of the history substitutions:
echo
dritchie@cliwkshp:~$ echo print this line of text to standard output
dritchie@cliwkshp:~$ echo -n print this line with the flag
dritchie@cliwkshp:~$ echo --help
dritchie@cliwkshp:~$ echo -e "1,a\n2,b\n3,c" > file.csv
dritchie@cliwkshp:~$ sudo echo "docnow ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
who
dritchie@cliwkshp:~$ who
date
dritchie@cliwkshp:~$ date --help
dritchie@cliwkshp:~$ date
dritchie@cliwkshp:~$ date --set "4 AUGUST 2016 1:40 PM"
cal
dritchie@cliwkshp:~$ cal --help
dritchie@cliwkshp:~$ cal 1999
bc
dritchie@cliwkshp:~$ bc --help
dritchie@cliwkshp:~$ bc
wc
dritchie@cliwkshp:~$ cat ~/cli_workshop/data_files/names.txt
dritchie@cliwkshp:~$ wc --help
dritchie@cliwkshp:~$ wc ~/cli_workshop/data_files/names.txt
dritchie@cliwkshp:~$ wc -cw ~/cli_workshop/data_files/names.txt
script
dritchie@cliwkshp:~$ script
Script started, file is typescript
dritchie@cliwkshp:~$ pwd
/home/dritchie
dritchie@cliwkshp:~$ cal
July 2016
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
dritchie@cliwkshp:~$ echo -e "one\ntwo\nthree" | wc -l
3
dritchie@cliwkshp:~$ who
kayiwa pts/9 2016-07-25 19:37
dritchie@cliwkshp:~$ exit
Script done, file is typescript
du
dritchie@cliwkshp:~$ du --help
dritchie@cliwkshp:~$ du -h ~/Desktop
dritchie@cliwkshp:~$ du -sh ~ | sort -n > ~/diskusage
sudo
dritchie@cliwkshp:~$ sudo --help
dritchie@cliwkshp:~$ sudo -l
dritchie@cliwkshp:~$ visudo
sort
dritchie@cliwkshp:~$ sort --help
dritchie@cliwkshp:~$ sort -r -k2 ~/cli_workshop/data_files/operatingsystemlist
tee
dritchie@cliwkshp:~$ tee --help
dritchie@cliwkshp:~$ pwd > file
dritchie@cliwkshp:~$ cat file
dritchie@cliwkshp:~$ pwd | tee file.txt
grep
dritchie@cliwkshp:~$ grep --help
dritchie@cliwkshp:~$ cat cli_workshop/data_files/operatingsystemlist
dritchie@cliwkshp:~$ grep -F BSD cli_workshop/data_files/operatingsystemlist
dritchie@cliwkshp:~$ grep -F -v BSD cli_workshop/data_files/operatingsystemlist
dritchie@cliwkshp:~$ grep -E '.en+' cli_workshop/data_files/operatingsystemlist
dritchie@cliwkshp:~$ grep -E 'll*' cli_workshop/data_files/operatingsystemlist
dritchie@cliwkshp:~$ grep -E '[no]' cli_workshop/data_files/operatingsystemlist
awk
dritchie@cliwkshp:~$ awk --help
dritchie@cliwkshp:~$ date
dritchie@cliwkshp:~$ date | awk '{print $2 $3}'
dritchie@cliwkshp:~$ date | awk '{ print $2" "$3}'
dritchie@cliwkshp:~$ who
dritchie@cliwkshp:~$ who | awk '{print $1}'
head
dritchie@cliwkshp:~$ head --help
dritchie@cliwkshp:~$ cat cli_workshop/data_files/operatingsystemlist
dritchie@cliwkshp:~$ head -2 cli_workshop/data_files/operatingsystemlist
dritchie@cliwkshp:~$ head -2 cli_workshop/* | cat
tail
dritchie@cliwkshp:~$ tail --help
dritchie@cliwkshp:~$ cat cli_workshop/data_files/operatingsystemlist
dritchie@cliwkshp:~$ tail -2 cli_workshop/data_files/operatingsystemlist
cut
dritchie@cliwkshp:~$ cut --help
dritchie@cliwkshp:~$ cat ~/cli_workshop/data_files/cut_example.txt
dritchie@cliwkshp:~$ cut -c4 ~/cli_workshop/data_files/cut_example.txt
dritchie@cliwkshp:~$ cut -c4-6 ~/cli_workshop/data_files/cut_example.txt
tar
dritchie@cliwkshp:~$ tar --help
dritchie@cliwkshp:~$ tar cvpf /tmp/desktop.tar ~/Desktop/
gzip, zcat, gunzip
dritchie@cliwkshp:~$ gzip --help
dritchie@cliwkshp:~$ gzip -c -r ~/Desktop/ > /tmp/desktop.gz
dritchie@cliwkshp:~$ zcat /tmp/desktop.gz | less