School of Computing. Dublin City University.
Online coding site: Ancient Brain
coders JavaScript worlds
Explore commands and options by typing
"man (command)"
e.g. "man ps"
clear Clear screen
ls List files ls -a Show "hidden" files (begin with ".") ls -l Detailed ls -alR Recursive cat (file) Type file out in command-line window more (file) Type file, pause for each screenful enter for new line, space for next page, q to quit
cp Copy files mv Move / Rename files rm Remove files mkdir Make directory rmdir Remove directorySee tutorials on manipulating files with cp, mv, rm, etc.
(prog) & Launch a process detached from command-line (e.g. windowed) (prog) Command-line frozen until prog exits. eog file.jpg & Launch image viewer Eye of GNOME on file gedit file & Launch gedit editor on this filename
google-chrome & Launch Web browser from command-line google-chrome "URL" &
sort Sort alphabetically (pipe some stream into sort) sort -n Sort numerically sort -r Reverse sort sort by 5th column: sort -k 5 old syntax to sort 5th column: sort +4
grep Search for a string in a file or files grep (string) (file) grep (string) *html grep -i (string) (file) Ignore case grep -v (string) (file) Return lines that do NOT match
find Find files by type/date/name, in this dir or below find -type d Find all dirs find -mtime -1 Find files modified today
lp (file) Print lpr (file) Print (on some systems) lp -Pl128 (file) Print on printer l128 (L128) lpq See print queue lprm Remove job from queue
cal 8 1752 Calendar for Aug 1752 cal 9 1752 Calendar for Sept 1752 cal 10 1752 Calendar for Oct 1752
which (prog) what runs if "prog" is typed may return nothing if prog is an alias which ls type (prog) returns path of prog or else shows what prog is alias for type h type history whereis (prog) Where the binary, source, manual pages are for this prog whereis perl
w Who is logged in (see this when you ssh student.computing.dcu.ie) (command) ; (command) Multiple commands on same line
wget -q -O - URL Download URL, quiet, output to command-line wget -q -O - URL > file.htm Output to file wget -q -O file.htm URL Output to file wget -q -O - http://site/file.jpg > file.jpg Output JPEG to file (output JPEG to command-line won't work) wget -q -O file.jpg http://site/file.jpg Output JPEG to file see more on wget