<< Back: Part 3 <<
Week Three Quick Reminders
[some of the topics and commands covered]
More Basic Commands
- mkdir [create a new directory]
- touch [create new file]
- mv [move/rename file]
- mv -i [include flag to protect from overwriting and existing file accidentally]
- cp [copy file or directory]
- cp -r [include recursive flag to copy all files,
including sub-directories]
- cp -i [interactive flag to help prevent
accidentally overwriting an existing file]
- cp -p [preserves the date stamp]
- rm [remove file. with an asterick rm* all files in a directory can
be removed]
- rmdir [remove directory]
- whereis [find a command or file. must know exact name. gives
full path]
- whereis -b - add to search for only binary files
- find [find a file by name, partial name, size, date, permissions,
ownership, or other. if no specific info is included with command, will search
all files]
- expressions - define criteria to apply to your search
[example: certain file type]
- -name [ file name - when using the * the partial file
name must be quoted - example: 'more*' ]
- -type: [file type - f=file d=directory l=link]
- -user: [name or ID of user]
- -perm: [specify permissions]
- -ctime [last time ownership or permissions were changed]
- -mtime [ last time file was modified]
- -exec << command>> {} \; [to execute
a command. careful
with this one! use -i flag
for prompt to give yourself a way to bail
out]
- locate [exhaustive listing of all system files containing a particular word
or search term]
- head [access to the first few lines of a file. you
define the number of lines with -# flag]
- tail [access to the last few lines of a file. you
define the number of lines with -# flag]
- file [gives you information about the file type]
- stty sane [PuTTY reset menu command - a way out of garbled
messes and back to command prompt]
- wc [count lines, words bytes, in that order in a file]
- wc -l [ lines only]
- wc -w [ words only]
- wc -c [bytes only]
- cmp & diff [show differences between files]
- cmp [compare]
- diff [show difference]
- sdiff [side-by-side comparison]
- sdiff -s [limits to actual differences only]
- grep [search through files for specific words]
- grep -i [turns off case specific]
- grep -c [number of times a word occurs in a file]
- * [asterick wildcard to find all instances of a word's use in a directory]
- quotation marks [around phrases to search]
- fgrep can be used as an alternative to speed up for large files
- stdin [standard input - assumed to be keyboard]
- stdout [standard output - assumed to be terminal]
- stderr [standard error]
- > [for redirecting output to a specified file or device]
- | [for piping the output from one command to another
command]
- >> [append out specifies output should be added to
the end of a document]
- --help or -h [typed as a flag after a command will bring up the help manual
info on that topic]
- man [access to the manual installed on server]
- man split [split file into pieces]
- man -k split [split by keyword]
- man apropos split [same results as -k split]
- add | more (or | less) after one of the
two above for more/less functions
- More flags for cat
- cat -n [number all output lines]
- cat -s [squeeze out extra blank lines]
Using Pico
Notes on using Pico can be found in part two of this week's lesson. I won't retype here.
<< Back: Part 3 <<